mcp server for polardb mysql
Project description
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
The following environment variables are required to connect to PolarDB MySQL database,environment Variables can be set in .env file or set in command line
- 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_WRITE: Enable write operation(default:false)
- POLARDB_MYSQL_ENABLE_INSER: 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: execute sql
- polar4ai_create_models: create AI models using Polar4ai syntax. Please ensure that the PolarDB AI node has been activated in the current database. For usage instructions, please refer to: https://help.aliyun.com/zh/polardb/polardb-for-mysql/user-guide/polardb-for-ai/?spm=a2c4g.11186623.help-menu-2249963.d_5_25.5cef3367txDrU2&scm=20140722.H_439225._.OR_help-T_cn~zh-V_1
Resources
- polardb-mysql://tables: List all tables for PolarDB MySQL in the current database
- polardb-mysql://models: List all AI models for PolarDB MySQL AI node in the current database
Resource Templates
- polardb-mysql://{table}/field: get the name,type and comment of the field in the table
- polardb-mysql://{table}/data: get data from the table,default limit 50 rows
Usage
Cursor
- config for mcp.json
{
"mcpServers": {
"polardb-mysql-mcp-server": {
"command": "uvx",
"args": [
"run_polardb_mysql_mcp_server@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_UPDATE": "false",
"POLARDB_MYSQL_ENABLE_INSER": "false",
"POLARDB_MYSQL_ENABLE_DDL": "false"
}
}
}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file polardb_mysql_mcp_server-0.3.0.tar.gz.
File metadata
- Download URL: polardb_mysql_mcp_server-0.3.0.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3fb3d54a4c4803e9ca177fc6e572495d44618a399ab1d5c64010c4fe1fdf628
|
|
| MD5 |
e7e141d870e51ac926756c165ff2afed
|
|
| BLAKE2b-256 |
be41eca48307fc0457374b93ec96e5809d0dd2cc50344b83a419155776ae06fe
|
File details
Details for the file polardb_mysql_mcp_server-0.3.0-py2.py3-none-any.whl.
File metadata
- Download URL: polardb_mysql_mcp_server-0.3.0-py2.py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b005a8ca24d400a22225ffe584fe812428ad53b2b1ccd19d8e9fea64ca55aa2
|
|
| MD5 |
16ff84627bf18fce399ef1082752ff9f
|
|
| BLAKE2b-256 |
c0e8715cd361e55080efba572349fcb1cd1f14b6a2782df4638aa32571d97bbf
|