接入你的智能体
從發布者安裝。不是 PlugMCP 端點。
遠端 URL 還是本機指令? 兩種安裝方式的差異
SmartDB is a universal multi-paradigm data-infrastructure gateway that implements the Model Context Protocol (MCP) server interface. This gateway allows MCP-compatible clients to connect and explore different data sources in a unified way.
It currently covers 6 data paradigms and 10 data sources: 5 relational databases (MySQL, PostgreSQL, Oracle, SQL Server, Dameng), KV store (Redis), document store (MongoDB), vector database (Milvus), search engine (Elasticsearch), and message queue (Apache Kafka), with 26 MCP tools in total. Tools are dynamically filtered and exposed according to the paradigm of each connection pool.
Compared to similar products, SmartDB not only provides basic database connection and exploration capabilities but also adds advanced features such as OAuth 2.0 authentication, health checks, SQL optimization, and index health detection, making database management and maintenance more secure and intelligent.
There are 26 tools in total. get_db_health and get_db_version are universal tools available for every data source; the other tools are exposed according to the paradigm of the connection pool.
# Database configuration file path
DATABASE_CONFIG_FILE=/Volumes/SmartDB/src/config/database_config.json
#========Server========
# Server listen host
SERVER_HOST=0.0.0.0
# Server listen port
SERVER_PORT=3000
#========OAuth2========
# OAuth2 client ID
CLIENT_ID=smart_db_client_id
# OAuth2 client secret
CLIENT_SECRET=smart_db_client_secret
# Access token expiration time (minutes)
ACCESS_TOKEN_EXPIRE_MINUTES=30
# Refresh token expiration time (days)
REFRESH_TOKEN_EXPIRE_DAYS=30
# Token encryption key
TOKEN_SECRET_KEY=smart_db_token_secret
# Username
OAUTH_USER_NAME=admin
# Password
OAUTH_USER_PASSWORD=wenb1n
Note: If you adjust the client ID and key in the oauth configuration, please also modify the corresponding configuration in the static/config file in the previous code
{
"default": {
"host": "192.168.xxx.xxx",
"port": 3306,
"user": "root",
"password": "root",
"database": "a_llm",
"role": "readonly",
"pool_size": 10,
"max_overflow": 20,
"pool_recycle": 3600,
"pool_timeout": 30,
"type": "mysql"
},
"postgresql": {
"host": "192.168.xxx.xxx",
"port": 5432,
"user": "postgres",
"password": "123456",
"database": "postgres",
"schema": "public",
"role": "readonly",
"pool_size": 5,
"max_overflow": 10,
"pool_recycle": 3600,
"pool_timeout": 30,
"type": "postgresql"
},
"oracle": {
"host": "192.168.xxx.xxx",
"port": 1521,
"user": "U_ORACLE",
"password": "123456",
"database": "123456",
"service_name": "ORCL",
"role": "readonly",
"pool_size": 5,
"max_overflow": 10,
"pool_recycle": 3600,
"pool_timeout": 30,
"type": "oracle"
},
"mssql": {
"host": "192.168.xxx.xxx",
"port": 1433,
"user": "test",
"password": "123456",
"database": "TEST",
"schema": "dbo",
"role": "readonly",
"pool_size": 5,
"max_overflow": 10,
"pool_recycle": 3600,
"pool_timeout": 30,
"type": "mssqlserver"
},
"redis": {
"host": "127.0.0.1",
"port": 6379,
"password": "your_redis_password",
"db": 0,
"role": "readonly",
"pool_size": 50,
"type": "redis"
},
"mongodb": {
"host": "127.0.0.1",
"port": 27017,
"user": "your_user",
"password": "your_password",
"database": "your_database",
"auth_source": "admin",
"role": "readonly",
"pool_size": 50,
"min_pool_size": 5,
"type": "mongodb"
},
"milvus": {
"host": "127.0.0.1",
"port": 19530,
"user": "your_user",
"password": "your_password",
"database": "default",
"role": "readonly",
"pool_size": 10,
"type": "milvus"
},
"elasticsearch": {
"host": "127.0.0.1",
"port": 9200,
"user": "your_user",
"password": "your_password",
"use_ssl": false,
"verify_certs": true,
"role": "readonly",
"pool_size": 10,
"type": "elasticsearch"
},
"kafka": {
"host": "127.0.0.1",
"port": 9092,
"user": "your_user",
"password": "your_password",
"role": "readonly",
"pool_size": 10,
"type": "kafka"
}
}
For Elasticsearch and Kafka,
user/passwordare optional: omit them for clusters without authentication. Kafka uses SASL/PLAIN when both are provided. A ready-to-use template is available atsrc/config/database_config.example.json.
The following table details the meaning and usage of each parameter in the database connection configuration file:
"readonly": ["SELECT", "SHOW", "DESCRIBE", "EXPLAIN"], # readonly permission
"writer": ["SELECT", "SHOW", "DESCRIBE", "EXPLAIN", "INSERT", "UPDATE", "DELETE"], # read/write permission
"admin": ["SELECT", "SHOW", "DESCRIBE", "EXPLAIN", "INSERT", "UPDATE", "DELETE",
"CREATE", "ALTER", "DROP", "TRUNCATE"] # administrator permission
For non-relational data sources (Redis, MongoDB, Milvus, Elasticsearch, Kafka), the same three roles are enforced via a READ / WRITE / ADMIN / DANGEROUS category-based permission policy. For example, a readonly role is rejected when calling execute_mongo_write, Redis write commands, etc.
"default" is the default database connection configuration and must be configured. Other database configurations should be added as needed.
pip install SmartDB-MCP
Parameter explanation:
--mode: transmission mode (stdio, sse, streamablehttp)--envfile: path of the environment variable file--oauth: enable OAuth authentication (currently only supported in streamablehttp mode)Start command:
smartdb --envfile=/path/to/.env --oauth=true
# Start service using docker-compose
docker-compose up -d
# Check service status
docker-compose ps
# View logs
docker-compose logs -f smartdb
# Build image
docker build -t smartdb-mcp:latest .
# Run container
docker run -d \
--name smartdb-mcp-server \
-p 3000:3000 \
-e DATABASE_CONFIG_FILE=/app/src/config/database_config.json \
-e CLIENT_ID=smart_db_client_id \
-e CLIENT_SECRET=smart_db_client_secret \
-e TOKEN_SECRET_KEY=your_secret_key \
-v $(pwd)/src/config:/app/src/config:ro \
-v $(pwd)/logs:/app/logs \
smartdb-mcp:latest
Add the following content to your MCP client tools, such as cursor, cline, etc.
MCP JSON as follows:
{
"mcpServers": {
"smartdb": {
"name": "smartdb",
"type": "streamableHttp",
"description": "",
"isActive": true,
"url": "http://localhost:3000/mcp/"
}
}
}
Start command:
# Download dependencies
uv sync
# Start
uv run -m core.server
# Custom env file location
uv run -m core.server --envfile /path/to/.env
Add the following content to your MCP client tools, such as cursor, cline, etc.
MCP JSON as follows:
{
"mcpServers": {
"smartdb": {
"name": "smartdb",
"description": "",
"isActive": true,
"url": "http://localhost:3000/sse"
}
}
}
Start command:
# Download dependencies
uv sync
# Start
uv run -m core.server --mode sse
# Custom env file location
uv run -m core.server --mode sse --envfile /path/to/.env
Add the following content to your MCP client tools, such as cursor, cline, etc.
MCP JSON as follows:
{
"mcpServers": {
"smartdb": {
"name": "smartdb",
"type": "stdio",
"isActive": false,
"registryUrl": "",
"command": "uv",
"args": [
"--directory",
"/Volumes/python/SmartDB/",
"run",
"-m",
"core.server",
"--mode",
"stdio"
],
"env": {
"DATABASE_CONFIG_FILE": "/Volumes/database_config.json"
}
}
}
}
}
uv run -m core.server --oauth=true
Access the authentication service at http://localhost:3000/login. Default account and password are configured in the env file.
Copy the token and add it to the request header, for example:
{
"mcpServers": {
"smartdb": {
"name": "smartdb",
"type": "streamableHttp",
"description": "",
"isActive": true,
"url": "http://localhost:3000/mcp/",
"headers": {
"authorization": "bearer TOKEN_VALUE"
}
}
}
}
Query the table data of the default connection pool
Query the table data of the others connection pool
Query data from tables in other connection pools and other databases
Query database health status
Sql Optimize
Universal database MCP server connecting to MySQL, PostgreSQL, SQL Server, MariaDB,DM8,Oracle,Redis,kafka,Milvus,not only provides basic database connection such as OAuth 2.0 authentication , health c
總覽
Universal database MCP server connecting to MySQL, PostgreSQL, SQL Server, MariaDB,DM8,Oracle,Redis,kafka,Milvus,not only provides basic database connection such as OAuth 2.0 authentication , health checks, SQL optimization, and index health detection
工具
尚無工具清單。遠端伺服器會在首次健康檢查後取得工具清單。
常見問題
在本頁複製適用於 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 設定。它使用發布者的安裝方式,而不是 PlugMCP 代理伺服器。
這筆記錄未列出必要的環境變數。
SmartDB 透過 stdio 在本機執行。
上次檢查時間:2026-10-27。 Universal database MCP server connecting to MySQL, PostgreSQL, SQL Server, MariaDB,DM8,Oracle,Redis,kafka,Milvus,not only provides basic database connection such as OAuth 2.0 authentication , health checks, SQL optimization, and index health detection