RestDb.McpServer exposes the RestDb HTTP API over MCP using a REST-proxy model. The MCP server does not implement database logic itself; it forwards to RestDb so behavior stays aligned with the HTTP API.
- HTTP MCP:
http://localhost:8010/mcp - TCP JSON-RPC/MCP:
tcp://localhost:8011 - WebSocket MCP:
ws://localhost:8012/mcp - stdio:
dotnet run --project src/RestDb.McpServer/RestDb.McpServer.csproj -- --stdio
Compose defaults:
RESTDB_MCP_SERVER_URL=http://restdb:8000RESTDB_MCP_API_KEY=defaultRESTDB_MCP_API_KEY_HEADER=x-api-key
RESTDB_MCP_API_KEY, RESTDB_MCP_API_KEY_HEADER, and RESTDB_MCP_BEARER_TOKEN are used by RestDb.McpServer when it calls the protected RestDb HTTP API. MCP clients connecting to the HTTP endpoint do not need to send those RestDb auth headers.
Optional CLI flags:
install--server-url--api-key--api-key-header--bearer-token--http-host--http-port--tcp-host--tcp-port--ws-host--ws-port--stdio--dry-run--yes
RestDb.McpServer includes a built-in installer for the common agent clients:
- Claude Code
- Codex
- Gemini CLI
- Cursor
Example:
dotnet run --project src\RestDb.McpServer\RestDb.McpServer.csproj -- install --yesPreview the generated config without writing files:
dotnet run --project src\RestDb.McpServer\RestDb.McpServer.csproj -- install --dry-runThe installer writes user-scoped config files:
~/.claude.json~/.codex/config.toml~/.gemini/settings.json~/.cursor/mcp.json
The installer only writes client-side MCP endpoint definitions. Configure downstream RestDb authentication on the RestDb.McpServer process itself with --api-key, --bearer-token, or RESTDB_MCP_* environment variables. The generated MCP client definitions remain plain HTTP endpoint definitions and do not inject RestDb API-key headers into the client transport.
Each tool returns the proxied REST result with:
SuccessStatusCodeReasonPhraseHeadersBody
| Tool | REST route |
|---|---|
restdb_check_system_health |
GET / |
restdb_retrieve_database_client_capabilities |
GET /_databaseclients |
restdb_retrieve_database_list |
GET /_databases |
restdb_retrieve_server_settings |
GET /_settings |
restdb_update_server_settings |
PUT /_settings |
restdb_reload_server_settings |
POST /_settings/reload |
restdb_retrieve_context_document |
GET /_context |
restdb_update_context_document |
PUT /_context |
restdb_reload_context_document |
POST /_context/reload |
restdb_retrieve_database_context |
GET /_context/{database} |
restdb_update_database_context |
PUT /_context/{database} |
restdb_retrieve_table_context |
GET /_context/{database}/{table} |
restdb_update_table_context |
PUT /_context/{database}/{table} |
| Tool | REST route |
|---|---|
restdb_inspect_database |
GET /{database} or GET /{database}?_context=true |
restdb_inspect_database_with_schema |
GET /{database}?_describe=true or GET /{database}?_describe=true&_context=true |
restdb_inspect_table_schema |
GET /{database}/{table}?_describe=true or GET /{database}/{table}?_describe=true&_context=true |
| Tool | REST route |
|---|---|
restdb_enumerate_table_records |
GET /{database}/{table} |
restdb_retrieve_table_record_by_id |
GET /{database}/{table}/{id} |
restdb_search_table_records |
PUT /{database}/{table} |
restdb_update_table_record_by_id |
PUT /{database}/{table}/{id} |
restdb_create_table |
POST /{database} |
restdb_insert_table_record |
POST /{database}/{table} |
restdb_insert_table_records |
POST /{database}/{table}?_multiple=true |
restdb_execute_raw_sql |
POST /{database}?raw=true |
restdb_delete_table_records |
DELETE /{database}/{table} |
restdb_delete_table_record_by_id |
DELETE /{database}/{table}/{id} |
restdb_truncate_table |
DELETE /{database}/{table}?_truncate=true |
restdb_drop_table |
DELETE /{database}/{table}?_drop=true |
- Database tools use
databaseName. - Table tools use
databaseNameandtableName. - Metadata inspection tools also accept
includeContext. Whentrue, the MCP proxy appends?_context=trueto the underlying REST metadata route. - Row-by-ID tools use
rowId. - Equality query filters are passed as a
filtersobject. restdb_search_table_recordsaccepts anexpressionpayload compatible with theExpressionTreeREST body.- Bulk insert uses a
recordsarray. - Full-document config editors use
settingsorcontext.
- HTTP and WebSocket both use
/mcpon their respective transports. - On HTTP streamable transport,
notifications/initializedand other notification-only POSTs return202 Acceptedwith an empty body. - HTTP and stdio expose proper MCP tools and tool metadata.
- TCP and WebSocket expose the same operations as registered methods and also publish
tools/list. - The MCP service uses the configured RestDb API key or bearer token when proxying requests downstream.