Apisql

v1.0.0Databasesstable

一个 MCP Server 连接你的所有数据库,数据库 MCP Server 的瑞士军刀。One MCP Server for all your databases. The Swiss Army Knife of Database MCP Servers.

damengdatabasedorisduckdbmcp
Share:
33
Stars
0
Downloads
0
Weekly
0/5

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

Connect to multiple databases
Query with natural language
Support MySQL, PostgreSQL, DuckDB
apisql-dev

Maintainer

LicenseMIT
Languagejavascript
Versionv1.0.0
UpdatedMay 15, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx apisql

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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.

2

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.

3

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"
      }
    }
  }
}
4

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.

5

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.

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.

Quick Config Preview

{ "mcpServers": { "apisql": { "command": "npx", "args": ["-y", "apisql"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides