nuget adomcpstdioMITupdated 18d ago
AdoMcp is a Model Context Protocol (MCP) server that helps large language models (LLMs) understand database structure, read table comments, and execute SQL queries.
¿Qué puedes hacer con AdoMcp?
AdoMcp
AdoMcp is a Model Context Protocol (MCP) server that helps large language models (LLMs) understand database structure, read table comments, and execute SQL queries.
AdoMcp 是一个基于 Model Context Protocol (MCP) 的数据库工具服务,帮助大型语言模型(LLM)理解数据库结构、读取表注释、执行 SQL 查询。
MCP Tools
| Tool | Description |
|---|---|
list_connections |
List configured database connections |
add_connection |
Add (or replace) a database connection at runtime |
remove_connection |
Remove a dynamically-added connection |
list_objects |
List database objects (table/view/procedure/function/trigger/sequence/synonym, etc.) |
get_table_schema |
Get table schema details (columns/types/nullability/PK/default/comments) |
get_table_indexes |
Get table indexes |
query_sql |
Execute read-only SQL and return CSV |
execute_sql |
Execute write SQL (requires --allow-any-sql) |
Recommended Tool Workflow (for LLM agents)
To reduce mistakes (wrong database/schema/object), use tools in this order:
list_connectionsto discover available connections.- If none are available, call
add_connection. - Before inspecting a table/view, call
list_objectsto locateschema + objectType + objectName. - Use
get_table_schemafor column details (type, nullability, PK, default, comments). - Use
get_table_indexeswhen index/key design matters. - Use
query_sqlonly for read-only verification. - Use
execute_sqlonly when explicitly authorized and server is started with--allow-any-sql.
Oracle note: objects without owner prefix may be synonyms. Always confirm the real schema via list_objects first.
Supported Databases
| Database | Driver | Comment support |
|---|---|---|
| SQL Server | Microsoft.Data.SqlClient |
MS_Description extended properties |
| MySQL / MariaDB | MySqlConnector |
TABLE_COMMENT / COLUMN_COMMENT |
| PostgreSQL | Npgsql |
obj_description / col_description |
| SQLite | Microsoft.Data.Sqlite |
— (SQLite has no native comments) |
| Oracle | Oracle.ManagedDataAccess.Core |
ALL_TAB_COMMENTS / ALL_COL_COMMENTS (includes PUBLIC synonyms) |
ORM support: Dapper
Requirements
Quick Start
1. Configure database connections (optional)
AdoMcp loads configuration from multiple sources (later sources override earlier ones):
appsettings.json(in the app directory)appsettings.{Environment}.json~/.adomcp.json— user-level config (%USERPROFILE%\.adomcp.jsonon Windows), persists connections andAllowAnySqlwithout touching the app directory- Environment variables prefixed
ADOMCP_ - .NET User Secrets
You can pre-configure connections in any of these. You can also skip this step entirely and let the LLM add connections dynamically via the add_connection tool.
{
"AllowAnySql": false,
"Databases": [
{
"Name": "mydb",
"DbType": "SqlServer",
"ConnectionString": "Server=localhost;Database=MyDb;User Id=sa;Password=***;TrustServerCertificate=true;",
"Description": "Main business database"
}
]
}
Supported DbType values: SqlServer | MySql | PostgreSql | Sqlite | Oracle
Security tip: Use .NET User Secrets or environment variables to manage connection strings in production.
User-level config example (~/.adomcp.json)
Create ~/.adomcp.json in your home directory to persist personal connections and settings across projects:
{
"AllowAnySql": true,
"Databases": [
{
"Name": "local-pg",
"DbType": "PostgreSql",
"ConnectionString": "Host=localhost;Database=dev;Username=postgres;Password=***;",
"Description": "Local PostgreSQL dev DB"
}
]
}
2. Run the server
Default mode
By default the server runs in stdio mode (the standard MCP transport for local clients).
Use --http (or ADOMCP_MODE=http) to switch to HTTP/SSE mode.
# stdio mode (default) - all logs go to stderr; stdout carries only MCP JSON-RPC
dnx -y AdoMcp
Specify mode manually
# stdio mode (all logs go to stderr; stdout carries only MCP JSON-RPC)
dnx -y AdoMcp -- --stdio
# HTTP/SSE mode (default: http://localhost:5100, MCP endpoint /mcp)
dnx -y AdoMcp -- --http
# Via environment variable
ADOMCP_MODE=http
dnx -y AdoMcp
Enable execute_sql (write operations)
By default the execute_sql tool is disabled to prevent unauthorised writes.
Enable it via CLI flag, config file, or environment variable (CLI flag wins when explicitly set):
# CLI flag
# Combine with transport mode
dnx -y AdoMcp -- --http --allow-any-sql
// ~/.adomcp.json or appsettings.json
{
"AllowAnySql": true
}
# Environment variable
# ADOMCP_ALLOWANYSQL=true dnx -y AdoMcp
Priority: --allow-any-sql CLI > ADOMCP_ALLOWANYSQL env > ~/.adomcp.json AllowAnySql > appsettings.json AllowAnySql > false (default).
3. Alternative: Install as a global .NET tool
After the package is published to NuGet.org, you can also install it as a global tool:
dotnet tool install -g AdoMcp
adomcp
You can also run dnx directly (installs and runs on demand, .NET 10+):
dnx -y AdoMcp -- --allow-any-sql
Dynamic connections at runtime (no config file needed)
LLMs can add new database connections during a session using add_connection:
User: Connect me to Oracle database oradb01
LLM → calls add_connection(
connectionString = "Data Source=oradb01:1521/PROD;User Id=appuser;Password=***;",
dbType = "Oracle",
name = "prod-oracle",
description = "Production Oracle DB"
)
→ returns: Connection 'prod-oracle' (Oracle) added successfully.
LLM → calls list_objects(connectionName = "prod-oracle")
Dynamically-added connections exist only for the lifetime of the process; restart the server or add the connection to appsettings.json for persistence.
Client configuration
Via dnx (stdio)
{
"mcpServers": {
"adomcp": {
"command": "dnx",
"args": ["-y", "AdoMcp"]
}
}
}
Via HTTP/SSE
Start the server first:
dnx -y AdoMcp -- --http
Then configure the client:
{
"mcpServers": {
"adomcp": {
"url": "http://localhost:5100/mcp"
}
}
}
Environment variables
All environment variables are prefixed with ADOMCP_ (override appsettings.json):
| Variable | Description |
|---|---|
ADOMCP_MODE |
Transport mode: stdio or http (auto-detected when not set) |
ADOMCP_URLS |
HTTP listen address, e.g. http://0.0.0.0:5100 |
ADOMCP_ALLOWANYSQL |
Enable the execute_sql tool: true or false (default false) |
ADOMCP_DATABASES |
JSON-encoded Databases array (overrides config-file connections) |
MCP Registries
AdoMcp is registered in the official MCP Registry under the server name io.github.John0King/adomcp.
Instalación
Añade AdoMcp a tu cliente. Elige el que uses.
claude mcp add adomcp -- dnx adomcp --yescodex mcp add adomcp -- dnx adomcp --yesamp mcp add adomcp -- dnx adomcp --yes{
"mcpServers": {
"adomcp": {
"command": "dnx",
"args": [
"adomcp",
"--yes"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"adomcp": {
"command": "dnx",
"args": [
"adomcp",
"--yes"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"adomcp","command":"dnx","args":["adomcp","--yes"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"adomcp": {
"command": "dnx",
"args": [
"adomcp",
"--yes"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"adomcp": {
"command": "dnx",
"args": [
"adomcp",
"--yes"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"adomcp": {
"command": "dnx",
"args": [
"adomcp",
"--yes"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"adomcp": {
"type": "local",
"command": "dnx",
"args": [
"adomcp",
"--yes"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"adomcp": {
"command": {
"path": "dnx",
"args": [
"adomcp",
"--yes"
]
}
}
}
}Add to your Zed `settings.json`.
dnx adomcp --yesRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
Puntuación
39 / 100
Incompleta
- Documentación25/25
- Mantenimiento25/25
- Confianza13/20
- Capacidad0/15
- Instalación12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 11 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
Historial de versiones
| Versiones | Publicada |
|---|---|
| 1.2.0Última | 21 ago 2026 |
| 1.1.0 | 7 ago 2026 |
| 1.0.3 | 9 jul 2026 |
| 1.0.2 | 25 abr 2026 |