Skip to main content
AllMCPs
BrowseBestCategoriesStackCompareToolsGuidesBlog
Log in Submit MCP

Stay in the loop

Get new MCP servers and top picks in your inbox.

AllMCPs

The open directory for discovering and installing Model Context Protocol servers.

AllMCPs on GitHub (opens in a new tab)
Launched onTiny Startupstinystartups.com
Explore
  • Browse servers
  • Best MCP servers
  • Categories
  • MCP clients
  • Agent prompts
  • Stack Builder
  • Compare servers
  • Random discovery New
  • Submit a server
  • Pricing & Boost Boost
Learn
  • Guides hub
  • What is MCP?
  • Install guide
  • Build an MCP server
  • Deploy an MCP server
  • Security guide
  • Troubleshooting
  • MCP for SEO & AEO
  • Protocol versioning
  • Transports: stdio vs HTTP
  • State of MCP (stats)
  • Blog & updates
Tools
  • All developer tools
  • Config generator
  • Config validator
  • Config auditor
  • MCP playground
  • Token calculator
  • OpenAPI → MCP
  • Badge generator
For agents
  • REST API docs
  • Trust & traffic Live
  • Remote MCP server SSE ↗ (opens in a new tab)
  • llms.txt ↗ (opens in a new tab)
  • Catalog JSON ↗ (opens in a new tab)
Company
  • About
  • Advertise Sponsor
  • Contact
  • GitHub ↗ (opens in a new tab)
  • Terms
  • Privacy
AllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZoneAllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZone
© 2026 Jackalope Digital LLC. All rights reserved.
  1. Home
  2. Databases
  3. AdoMcp
  4. README

AdoMcp README

The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the AdoMcp listing page.

Back to AdoMcp View source on GitHub

AdoMcp

NuGet License: MIT

一个开箱即用的数据库 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 ServerMicrosoft.Data.SqlClientMS_Description 扩展属性
MySQL / MariaDBMySqlConnectorTABLE_COMMENT / COLUMN_COMMENT
PostgreSQLNpgsqlobj_description / col_description
SQLiteMicrosoft.Data.SqliteSQLite 无原生注释
OracleOracle.ManagedDataAccess.CoreALL_TAB_COMMENTS / ALL_COL_COMMENTS,包含 PUBLIC synonym

前置要求

  • .NET 10 SDK
  • 使用插件时,客户端需要允许启动本地 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

仓库包含 .codex-plugin/plugin.json,可被 Codex 插件市场或本地插件源使用。若只需要 MCP Server,可直接添加:

bash
codex mcp add adomcp -- dnx -y AdoMcp

Claude Code(cc)

text
/plugin marketplace add John0King/AdoMCP
/plugin install adomcp@adomcp-plugins

安装后执行 /reload-plugins;使用 /mcp 检查 adomcp 是否已连接。

GitHub Copilot CLI

可以从 GitHub 仓库直接安装:

bash
copilot plugin install John0King/AdoMCP
copilot mcp get adomcp

也可以通过 marketplace 安装:

bash
copilot plugin marketplace add John0King/AdoMCP
copilot plugin install adomcp@adomcp-plugins

GitHub Copilot App

在 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

适用于任何支持本地 MCP 的客户端:

config.json
{
  "mcpServers": {
    "adomcp": {
      "command": "dnx",
      "args": ["-y", "AdoMcp"]
    }
  }
}

HTTP 模式需先启动服务:

bash
dnx -y AdoMcp -- --http

然后连接端点:

config.json
{
  "mcpServers": {
    "adomcp": {
      "url": "http://localhost:5100/mcp"
    }
  }
}

数据库连接配置

AdoMcp 按以下顺序加载配置,后面的来源覆盖前面的来源:

  1. 应用目录中的 appsettings.json
  2. appsettings.{Environment}.json
  3. 用户配置 ~/.adomcp.json(Windows 为 %USERPROFILE%\.adomcp.json)
  4. ADOMCP_ 前缀的环境变量
  5. .NET User Secrets
  6. 命令行 --allow-any-sql(仅覆盖写 SQL 开关)

最常用的方式是在用户目录创建 .adomcp.json:

config.json
{
  "AllowAnySql": false,
  "Databases": [
    {
      "Name": "mydb",
      "DbType": "PostgreSql",
      "ConnectionString": "Host=localhost;Database=app;Username=postgres;Password=***;",
      "Description": "Local development database"
    }
  ]
}

DbType 可选值:SqlServer、MySql、PostgreSql、Sqlite、Oracle。

也可以不创建配置文件,让 Agent 在会话中调用 add_connection。动态连接仅在当前 AdoMcp 进程中有效,重启后不会保留。

不要把真实连接字符串提交到 Git。生产环境建议使用环境变量、User Secrets 或客户端的密钥管理能力。

运行模式

默认使用 stdio;stdout 仅传输 MCP JSON-RPC,日志写入 stderr。

bash
# 默认 stdio
dnx -y AdoMcp

# 显式 stdio(兼容旧配置)
dnx -y AdoMcp -- --stdio

# HTTP,默认监听 http://localhost:5100/mcp
dnx -y AdoMcp -- --http

# 安装为全局 .NET tool
dotnet tool install -g AdoMcp
adomcp

写 SQL 安全开关

execute_sql 默认不可用。只有在用户明确授权写操作后,才应通过以下任一方式开启:

bash
dnx -y AdoMcp -- --allow-any-sql
dnx -y AdoMcp -- --http --allow-any-sql

或在配置中设置 "AllowAnySql": true,或设置环境变量 ADOMCP_ALLOWANYSQL=true。命令行参数优先级最高。

Agent 推荐工作流

  1. 用 list_connections 确认连接。
  2. 缺少连接时用 add_connection 添加。
  3. 用 list_objects 确认 schema、对象类型和对象名。
  4. 用 get_table_schema 查看结构和注释。
  5. 涉及键或性能时用 get_table_indexes。
  6. 只读验证使用 query_sql。
  7. 仅在用户明确授权且 Server 开启写入能力时使用 execute_sql。

Oracle 中未带 owner 的对象可能是 synonym,应先通过 list_objects 解析真实 schema。

环境变量

变量说明
ADOMCP_MODEstdio 或 http
ADOMCP_URLSHTTP 监听地址,例如 http://0.0.0.0:5100
ADOMCP_ALLOWANYSQL是否启用 execute_sql,默认 false
ADOMCP_DATABASESJSON 编码的 Databases 数组

MCP Registry

AdoMcp 已注册到官方 MCP Registry,Server name 为 io.github.John0King/adomcp。

License

MIT