Skip to main content

PolarDB MySQL MCP Server

PolarDB MySQL MCP Server serves as a universal interface between AI Agents and PolarDB MySQL databases. It enables seamless communication between AI Agents and PolarDB MySQL, helping AI Agents retrieve PolarDB MySQL database metadata and execute SQL operations.

Environment Variables

  • POLARDB_MYSQL_HOST: Database host address
  • POLARDB_MYSQL_PORT: Database port
  • POLARDB_MYSQL_USER: Database user
  • POLARDB_MYSQL_PASSWORD: Database password
  • POLARDB_MYSQL_DATABASE: Database name
  • POLARDB_MYSQL_ENABLE_UPDATE: Enable update operation(default:false)
  • POLARDB_MYSQL_ENABLE_DELETE: Enable delete operation(default:false)
  • POLARDB_MYSQL_ENABLE_INSERT: Enable insert operation(default:false)
  • POLARDB_MYSQL_ENABLE_DDL: Enable ddl operation(default:false)
  • SSE_BIND_HOST: The host address to bind for SSE mode
  • SSE_BIND_PORT: The port to bind for SSE mode
  • RUN_MODE: The run mode(sse|stdio),(default:sse)

Components

Tools

  • execute_sql: 执行符合PolarDB MySQL语法的SQL语句
  • polar4ai_update_index_for_text_2_sql: 利用polardb的AI节点,对当前库的表建索引,用于文本转SQL或者文本转chart
  • polar4ai_text_2_sql:利用polardb的AI节点,将用户的文本转换成sql语句
  • polar4ai_text_2_chart:利用polardb的AI节点,将用户的文本统计需求直接转换成图表
  • polar4ai_create_models:使用polar4ai语法,创建各种自定义算法模型
  • polar4ai_import_doc:利用polardb的AI节点,将用户本地目录的文档导入到PolarDB中形成知识库
  • polar4ai_search_doc:利用polardb的AI节点,从PolarDB中的知识库中搜索用户问题并返回答案

Resources

  • polardb-mysql://tables: 列出当前数据库中所有的表
  • polardb-mysql://models: 列出当前数据库中创建的所有自定义算法模型

Resource Templates

  • polardb-mysql://{table}/field: 获取到表中字段的名称、类型和注释
  • polardb-mysql://{table}/data: 从表中获取数据,默认获取50条数据

Cursor

  1. config for mcp.json
{
  "mcpServers": {
    "polardb-mysql-mcp-server": {
      "command": "uvx",
      "args": [
        "--from",
        "polardb-mysql-mcp-server",
        "run_polardb_mysql_mcp_server"
      ],
      "env": {
        "POLARDB_MYSQL_HOST": "127.0.0.1",
        "POLARDB_MYSQL_PORT": "15001",
        "POLARDB_MYSQL_USER": "xxxx",
        "POLARDB_MYSQL_PASSWORD": "xxx",
        "POLARDB_MYSQL_DATABASE": "xxx",
        "RUN_MODE": "stdio",
        "POLARDB_MYSQL_ENABLE_UPDATE": "false",
        "POLARDB_MYSQL_ENABLE_DELETE": "false",
        "POLARDB_MYSQL_ENABLE_INSERT": "false",
        "POLARDB_MYSQL_ENABLE_DDL": "false"
      }
    }
  }
}

Metadata

Release files for polardb-mysql-mcp-server 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for polardb-mysql-mcp-server 0.8.0
File Size Uploaded Provenance Actions
polardb_mysql_mcp_server-0.8.0.tar.gz 12.9 kB Without provenance Details for polardb_mysql_mcp_server-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for polardb-mysql-mcp-server 0.8.0
File Interpreter ABI Platform Actions
polardb_mysql_mcp_server-0.8.0-py3-none-any.whl Python 3 none any Details for polardb_mysql_mcp_server-0.8.0-py3-none-any.whl

Total release size: 24.0 kB

Release files / polardb_mysql_mcp_server-0.8.0.tar.gz

Download URL polardb_mysql_mcp_server-0.8.0.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0f2bef9590f4d01d421d21966a5218b3e7138a47b3c45feff22524add19ab1d0
BLAKE2b-256 checksum
How to use checksums
ec14e28dca128f15dc7161b9d248a180408ead5437b8f521b6b5b8ea9bdd7739
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.14

Release files / polardb_mysql_mcp_server-0.8.0-py3-none-any.whl

Download URL polardb_mysql_mcp_server-0.8.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de3408e9c6ff46e711f1efe6cbc9934d83149ad250a26e7cf43069e2651c22e3
BLAKE2b-256 checksum
How to use checksums
eb7d4662f46b9ed638751da7eeb9ef65db9f7b4e36aefcf33778a3898f7aeb73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.14

Security for polardb-mysql-mcp-server 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page