Database MCP server for schema discovery, comments, and SQL queries.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
💡 Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by AdoMcp.
list_connectionsList configured database connections
add_connectionAdd (or replace) a database connection at runtime
remove_connectionRemove a dynamically-added connection
list_objectsList database objects (table/view/procedure/function/trigger/sequence/synonym, etc.)
get_table_schemaGet table schema details (columns/types/nullability/PK/default/comments)
get_table_indexesGet table indexes
一个开箱即用的数据库 Model Context Protocol (MCP) Server,让 AI Agent 能够发现数据库对象、理解表结构和注释、检查索引,并安全地执行 SQL。
A ready-to-run database MCP server for schema discovery, comments, indexes, and controlled SQL execution.
支持 SQL Server、MySQL/MariaDB、PostgreSQL、SQLite 和 Oracle;插件核心遵循 Agent Plugins(Open Plugin Spec)1.0,可用于 Codex、Claude Code、GitHub Copilot App 和 Copilot CLI。
Server name 和 version 由 MCP SDK 根据程序集元数据自动生成;Server 会在 MCP initialize/server/discover 响应中返回根级 instructions,指导客户端先定位连接与对象、只用 query_sql 读数据,并仅在明确授权后调用 execute_sql。
| Tool | 说明 |
|---|---|
list_connections | 列出已配置的数据库连接 |
add_connection | 在当前进程中新增或替换连接 |
remove_connection | 删除运行时新增的连接 |
list_objects | 查找表、视图、存储过程、函数、触发器、序列和同义词等对象 |
get_table_schema | 获取字段、类型、可空性、主键、默认值和注释 |
get_table_indexes | 获取表索引 |
query_sql | 执行只读 SQL,返回 CSV |
execute_sql | 执行写 SQL;默认禁用,需显式启用 |
| 数据库 | 驱动 | 注释支持 |
|---|---|---|
| SQL Server | Microsoft.Data.SqlClient | MS_Description 扩展属性 |
| MySQL / MariaDB | MySqlConnector | TABLE_COMMENT / COLUMN_COMMENT |
| PostgreSQL | Npgsql | obj_description / col_description |
| SQLite | Microsoft.Data.Sqlite | SQLite 无原生注释 |
| Oracle | Oracle.ManagedDataAccess.Core | ALL_TAB_COMMENTS / ALL_COL_COMMENTS,包含 PUBLIC synonym |
dnx 进程无需提前安装 AdoMcp。插件和示例配置使用 dnx -y AdoMcp,首次运行时会从 NuGet 获取包。
仓库根目录的 plugin.json、mcp.json 和 skills/adomcp/SKILL.md 是通用的 Agent Plugins 1.0 插件核心。.codex-plugin/、.claude-plugin/、.mcp.json 和 marketplace 文件是客户端兼容与分发入口。插件默认以 stdio 启动 AdoMcp,且不会开启写 SQL。
仓库包含 .codex-plugin/plugin.json,可被 Codex 插件市场或本地插件源使用。若只需要 MCP Server,可直接添加:
安装后执行 /reload-plugins;使用 /mcp 检查 adomcp 是否已连接。
可以从 GitHub 仓库直接安装:
也可以通过 marketplace 安装:
在 Copilot App 中打开 Customize → Plugins,添加 John0King/AdoMCP marketplace,然后安装 AdoMcp。本仓库的 .github/plugin/marketplace.json、plugin.json、.mcp.json 和 skill 会作为一个插件加载。
Copilot App/云端 Agent 必须能运行 .NET 10 和访问 NuGet,才能启动这个本地 stdio MCP Server。若运行环境不允许本地进程,请先自行以 HTTP 模式部署 AdoMcp,再按下文配置远程地址。
适用于任何支持本地 MCP 的客户端:
HTTP 模式需先启动服务:
然后连接端点:
AdoMcp 按以下顺序加载配置,后面的来源覆盖前面的来源:
appsettings.jsonappsettings.{Environment}.json~/.adomcp.json(Windows 为 %USERPROFILE%\.adomcp.json)ADOMCP_ 前缀的环境变量--allow-any-sql(仅覆盖写 SQL 开关)最常用的方式是在用户目录创建 .adomcp.json:
DbType 可选值:SqlServer、MySql、PostgreSql、Sqlite、Oracle。
也可以不创建配置文件,让 Agent 在会话中调用 add_connection。动态连接仅在当前 AdoMcp 进程中有效,重启后不会保留。
不要把真实连接字符串提交到 Git。生产环境建议使用环境变量、User Secrets 或客户端的密钥管理能力。
默认使用 stdio;stdout 仅传输 MCP JSON-RPC,日志写入 stderr。
execute_sql 默认不可用。只有在用户明确授权写操作后,才应通过以下任一方式开启:
或在配置中设置 "AllowAnySql": true,或设置环境变量 ADOMCP_ALLOWANYSQL=true。命令行参数优先级最高。
list_connections 确认连接。add_connection 添加。list_objects 确认 schema、对象类型和对象名。get_table_schema 查看结构和注释。get_table_indexes。query_sql。execute_sql。Oracle 中未带 owner 的对象可能是 synonym,应先通过 list_objects 解析真实 schema。
| 变量 | 说明 |
|---|---|
ADOMCP_MODE | stdio 或 http |
ADOMCP_URLS | HTTP 监听地址,例如 http://0.0.0.0:5100 |
ADOMCP_ALLOWANYSQL | 是否启用 execute_sql,默认 false |
ADOMCP_DATABASES | JSON 编码的 Databases 数组 |
AdoMcp 已注册到官方 MCP Registry,Server name 为 io.github.John0King/adomcp。
Factual signals from GitHub, npm, and our automated checks — not a rating.
No reviews yet — be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/adomcp)<a href="https://allmcps.com/mcp/adomcp"><img src="https://allmcps.com/api/badge/adomcp?style=directory" alt="AdoMcp on AllMCPs" /></a>