The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Coremcp listing page.
A Model Context Protocol (MCP) server, written in Go, that exposes SQL databases as MCP tools and prompts. It runs as a single static binary, embeds its drivers, and talks either stdio (for local MCP clients like Claude Desktop) or an outbound WebSocket (for remote operation behind NAT).
Currently ships with MSSQL (SQL Server 2000+, Turkish_CI_AS collation aware) and PostgreSQL adapters. Firebird is in progress; MySQL is on the roadmap.
CoreMCP is read-only by default. Omitting readonly in a source config leaves SELECT-only mode active; you have to set readonly: false to enable execute_procedure. Even so, the recommended posture is a dedicated DB user with SELECT (and EXECUTE only on the procedures you intend to expose) — defense in depth rather than relying solely on the server-side guard.
Download from the Releases page — linux/amd64, linux/arm64, darwin/{amd64,arm64}, windows/amd64.
One-line installer (Linux/macOS):
Multi-arch image (linux/amd64, linux/arm64).
Requires Go 1.23+.
coremcp.yaml in the working directory:
See coremcp.example.yaml for a fuller example.
MSSQL:
PostgreSQL:
Dummy adapter (for testing without a real DB):
| Option | Type | Default | Description |
|---|---|---|---|
name | string | — | Unique source identifier |
type | string | — | Adapter type: mssql, postgres (or postgresql), rest, graphql, dummy |
dsn | string | — | Connection string |
readonly | bool | true | SELECT-only at the config level. Set false explicitly to allow execute_procedure. |
no_lock | bool | false | (MSSQL only) Run SELECTs under READ UNCOMMITTED. Equivalent to WITH (NOLOCK) on every table reference. Eliminates shared lock acquisition on busy OLTP. Trade-off: dirty reads possible. |
normalize_turkish | bool | false | (MSSQL only) Two-way middleware. Outgoing: Turkish characters inside SQL string literals are folded to ASCII uppercase before the query is sent ('Hüseyin' → 'HUSEYIN'). Incoming: Windows-1254 / Windows-1252 mojibake in result strings is auto-corrected. Intended for legacy Turkish ERP databases on Turkish_CI_AS. |
How the Turkish middleware behaves:
| Model emits | Sent to DB | Why |
|---|---|---|
WHERE ADI = 'Hüseyin' | WHERE ADI = 'HUSEYIN' | ERP stores names as uppercase ASCII |
WHERE SEHIR LIKE '%şeker%' | WHERE SEHIR LIKE '%SEKER%' | Ş → S |
WHERE SEHIR = 'İstanbul' | WHERE SEHIR = 'ISTANBUL' | İ → I |
Mojibake correction on inbound rows:
| DB returns | Fixed | Cause |
|---|---|---|
GÐKHAN | GĞKHAN | Win-1254 byte 0xD0 read as Win-1252 |
ÝSTANBUL | İSTANBUL | Win-1254 byte 0xDD read as Win-1252 |
ÞEHİR | ŞEHİR | Win-1254 byte 0xDE read as Win-1252 |
What this enables:
SELECT and WITH pass. DROP, ALTER, UPDATE, DELETE, TRUNCATE, EXEC, OPENROWSET, SELECT…INTO and similar are rejected before reaching the DB. Multi-statement payloads (any ; outside strings/comments) are fatal — stacked-query attacks blocked dialect-independently. Chosen over third-party Go SQL parsers (xwb1989/sqlparser, vitess, cockroachdb) because they fail-closed on T-SQL hints and any "fall through to regex" relaxation is bypassable via EX/**/EC and similar tricks. Treat as one layer, not the only layer — pair with a least-privilege DB role.LIMIT is appended (or wrapped) on every SELECT so a model never streams millions of rows back through the protocol.CoreMCP has two operation modes.
serve)For local MCP clients (Claude Desktop, etc.):
stdio is the default transport:
Claude Desktop config (claude_desktop_config.json):
connect)connect opens an outbound WebSocket to a relay (typically CoreBase Cloud) and serves MCP traffic over it. The agent never accepts inbound connections, so it works from inside networks that don't allow inbound 443 (factory floors, corporate VPCs, hospital networks).
Flags:
Example, long-running:
Wire commands supported by the relay protocol:
run_sql — execute SQLget_schema — dump cached schemalist_sources — enumerate configured sourceshealth_check — agent livenessconfig_sync — push updated source configs to the running agentquery_databaseArbitrary SQL against a configured source.
source_name (required)query (required)list_tablesTables with column counts, primary keys, foreign key counts.
source_name (required)describe_tableFull schema for one table: columns, types, nullability, PKs, FKs, column comments.
source_name (required)table_name (required)list_viewsAll views with column definitions.
source_name (required)list_proceduresStored procedures with parameter names, types, modes (IN/OUT/INOUT), and a ready-to-copy example call.
source_name (required)execute_procedureCalls a stored procedure with named parameters. Only enabled when readonly: false.
source_name (required)procedure_name (required)params (optional) — JSON object of name/value pairsHardening:
^[a-zA-Z_][a-zA-Z0-9_#@.]*$sql.Named — no string interpolationreadonly: trueExample:
Define reusable parameterized queries as first-class MCP tools:
These get exposed to the model with their declared parameter schema, so the model can call them directly rather than re-deriving the SQL each turn.
database_schema promptOn startup CoreMCP connects to every configured source, scans tables / columns / keys / relationships, and extracts column comments (e.g. MS_Description on MSSQL). The result is exposed as a single MCP prompt that primes the model with schema context — including the comments — so it can write correct queries without manual schema dumps in every conversation.
pkg/adapter/yourdb/.core.Source.pkg/adapter/factory.go.pkg/adapter/dummy/dummy.go is the minimum reference implementation.
list_tables / describe_tableconnect modelist_views, list_procedures, execute_procedure)See CONTRIBUTING.md. Security reports: SECURITY.md.
Apache License 2.0 — see LICENSE.
CoreMCP is the open-source, on-prem gateway component of CoreBase, an AI agent platform for your company's data. Chat with your databases and APIs directly, or let autonomous and event-triggered agents run multi-step automations across them — databases (SQL Server 2000+, PostgreSQL), REST and GraphQL APIs, and 50+ SaaS connectors.
CoreMCP is how those agents reach the systems behind your firewall, including the legacy and on-prem ones nothing else connects to: it runs on your own server, keeps database credentials local, and connects zero-trust — outbound port 443 only, no inbound ports. On top of that access, CoreBase layers Unified Context and Query Memory: the schema relationships, terminology, and proven query patterns that turn raw access into accurate answers.