Apisql
一个 MCP Server 连接你的所有数据库,数据库 MCP Server 的瑞士军刀。One MCP Server for all your databases. The Swiss Army Knife of Database MCP Servers.
What is Apisql?
Apisql is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 一个 mcp server 连接你的所有数据库,数据库 mcp server 的瑞士军刀。one mcp server for all your databases. the swiss army knife of database mcp servers.
一个 MCP Server 连接你的所有数据库,数据库 MCP Server 的瑞士军刀。One MCP Server for all your databases. The Swiss Army Knife of Database MCP Servers.
This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- 一个 MCP Server 连接你的所有数据库,数据库 MCP Server 的瑞士军刀。One MCP Server
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx apisqlConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Apisql
Apisql MCP Server is the Swiss Army Knife of database MCP servers — a single MCP integration that connects your AI assistant to virtually any relational database through the apiSQL gateway service. It exposes a single powerful execute_sql tool that lets you run SELECT, INSERT, UPDATE, DELETE, DDL, stored procedures, and CTEs against MySQL, MariaDB, PostgreSQL, SQL Server, Oracle, SQLite, DuckDB, Apache Doris, TiDB, OceanBase, Trino, Presto, Dameng, and any JDBC-compatible database, with the ability to switch between multiple datasources dynamically at query time. Data engineers and analysts who work across multiple database engines will find this a dramatically simpler alternative to maintaining separate MCP servers for each database.
Prerequisites
- Node.js 18 or later
- An apiSQL account at https://open.apisql.cn with a configured gateway connected to your database(s)
- An apiSQL API URL (e.g. https://open.apisql.cn/api/mytest/$sudb) from your apiSQL dashboard
- An apiSQL API key (Bearer token) from your apiSQL account
- An MCP client such as Claude Desktop, Cursor, or any agent supporting the Model Context Protocol
Sign up for apiSQL and connect your database
Create an account at https://open.apisql.cn and set up an apiSQL gateway connected to your database. The gateway handles the actual database connectivity; you only need the API URL and API key from your apiSQL dashboard to proceed.
Note your API URL and API key
From your apiSQL dashboard, copy the MCP API URL (it will look like https://open.apisql.cn/api/yourproject/$sudb) and your API key. These are the two required credentials for the MCP server.
Add the server to your MCP client configuration
Open your MCP client configuration file (e.g. claude_desktop_config.json) and add the apisql-mcp server block with your credentials. Optionally set APISQL_MCP_DS to the name of your default datasource.
{
"mcpServers": {
"apisql-mcp": {
"command": "npx",
"args": ["-y", "apisql-mcp"],
"env": {
"APISQL_MCP_API_URL": "https://open.apisql.cn/api/yourproject/$sudb",
"APISQL_MCP_API_KEY": "Bearer your-api-key-here",
"APISQL_MCP_DS": "mysql"
}
}
}
}Restart your MCP client
Save the configuration and restart your MCP client so it picks up the new apisql-mcp server. The server will be downloaded automatically via npx on first use.
Test with a simple query
Ask your AI assistant to run a SELECT query to verify the connection is working. The execute_sql tool accepts any valid SQL for your target database engine.
Apisql Examples
Client configuration (Claude Desktop)
Add this block to claude_desktop_config.json, replacing the URL, key, and datasource name with your real apiSQL credentials.
{
"mcpServers": {
"apisql-mcp": {
"command": "npx",
"args": ["-y", "apisql-mcp"],
"env": {
"APISQL_MCP_API_URL": "https://open.apisql.cn/api/myproject/$sudb",
"APISQL_MCP_API_KEY": "Bearer your-api-key-here",
"APISQL_MCP_DS": "mysql"
}
}
}
}Prompts to try
Use these prompts with your MCP client to query and manage your databases through natural language.
- "Show me the first 10 rows from the users table."
- "How many orders were placed in the last 7 days? Query the orders table."
- "Switch to the PostgreSQL datasource and list all tables in the public schema."
- "What are the top 5 products by total sales revenue? Join the orders and products tables."
- "Create a summary of monthly revenue for this year from the transactions table."Troubleshooting Apisql
Authentication error or 401 response when executing queries
Verify that APISQL_MCP_API_KEY is set to 'Bearer your-key' (including the 'Bearer ' prefix). Confirm the key is active in your apiSQL dashboard and has not been revoked. The API URL must also match exactly what is shown in your apiSQL project settings.
Datasource not found or connection timeout
Check that the datasource name in APISQL_MCP_DS matches the name configured in your apiSQL gateway (case-sensitive). If your database is behind a firewall, ensure the apiSQL gateway service has network access to it. You can also pass the 'ds' parameter explicitly in each query to override the default datasource.
npx fails to download or run apisql-mcp
Ensure Node.js 18+ is installed and npx is in your PATH. If you are behind a corporate proxy, configure the npm proxy settings. You can also install globally first with 'npm install -g apisql-mcp' and then change the command in your config to 'apisql-mcp' without the npx wrapper.
Frequently Asked Questions about Apisql
What is Apisql?
Apisql is a Model Context Protocol (MCP) server that 一个 mcp server 连接你的所有数据库,数据库 mcp server 的瑞士军刀。one mcp server for all your databases. the swiss army knife of database mcp servers. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Apisql?
Follow the installation instructions on the Apisql GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Apisql?
Apisql works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Apisql free to use?
Yes, Apisql is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Apisql Alternatives — Similar Databases Servers
Looking for alternatives to Apisql? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
★ 20.6kGo language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
★ 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
DBHub
★ 2.8kA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
Tabularis
★ 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
★ 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
★ 1.7k🏎️ 🏠 ☁️ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
Browse More Databases MCP Servers
Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Apisql in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Apisql?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.