query_databaseLABSCO SUMMARY
Two layers between a model and the database, and the project tells you plainly not to trust either one on its own.
The lexer is the part worth reading about: instead of reaching for a general SQL parser, it tokenises, strips comments and literals, and admits only SELECT and WITH, with any stray semicolon fatal so stacked queries die independently of dialect. The forced row cap and the PII masking sit behind it. The documentation is unusually direct that this is defence in depth and the real boundary is a least-privilege database role. The NOLOCK and Turkish-normalisation options make clear which kind of estate it was built against.
What it is
A Go server that exposes configured SQL sources as MCP tools: run a query, list tables, describe one, list views and stored procedures, and — only when writes are enabled — call a procedure. It ships as a single binary with its drivers embedded, speaking stdio or an outbound WebSocket for a database behind NAT.
What you get
- query_database runs SQL against a named source; list_tables returns tables with column counts, primary keys and foreign key counts; describe_table gives one table's columns, types, nullability, keys and column comments
- list_views returns views with their column definitions, and list_procedures returns stored procedures with parameter names, types and modes plus a ready-to-copy example call
- execute_procedure calls a procedure with named parameters bound rather than interpolated, and exists only on a source where readonly has been set to false
- Custom tools: a parameterised query declared in the configuration becomes a first-class MCP tool with its own parameter schema, so a recurring report is one call rather than SQL re-derived every turn
- A database_schema prompt built at startup from every source — tables, columns, keys, relationships and column comments such as MS_Description — so the model has schema context without a manual dump in each conversation
- A T-SQL aware lexer strips comments and string literals, then admits only SELECT and WITH; DROP, ALTER, UPDATE, DELETE, TRUNCATE, EXEC, OPENROWSET and SELECT…INTO are rejected before the database sees them, and any semicolon outside a string or comment is fatal, so stacked queries fail regardless of dialect
- A forced row cap is appended or wrapped around every SELECT, so a query cannot stream millions of rows back through the protocol
- Regex-based PII masking over result strings before they leave the server, with the patterns and replacements declared in the configuration
- Two options aimed at legacy MSSQL estates: no_lock runs SELECTs under READ UNCOMMITTED, and normalize_turkish folds Turkish characters in string literals on the way out and repairs Windows-1254 mojibake on the way back
Requirements
A single static binary for Linux, macOS and Windows from the releases page, a one-line installer, a multi-arch Docker image, or a build from source with Go 1.23 or newer. Configuration is a coremcp.yaml naming each source and its DSN. The MSSQL adapter covers SQL Server 2000 and newer and the PostgreSQL adapter is stable; Firebird is in progress and its factory currently returns a placeholder error, and MySQL is on the roadmap. Sources are read-only unless readonly is set to false, and the project recommends a dedicated database user holding SELECT — and EXECUTE only on the procedures you meant to expose — rather than relying on the server-side guard alone.
Setup effort
One command plus credentials — curl -fsSL https://get.corebasehq.com | sh, then supply credentials
USE CASES
Letting an assistant answer questions from a real database
List the tables, read the schema of the one that matters, then run the SELECT — under the row cap and the statement filter.
Giving the model schema context once instead of every turn
The startup scan builds a prompt from tables, keys, relationships and column comments, so queries are written against real column names.
Turning a recurring report into a tool
Declare the parameterised query in the config and it appears as its own tool with a parameter schema the model can fill in.
Calling a stored procedure on purpose
List the procedures with their parameter modes and example call, then execute one with named parameters — on a source where writes were explicitly enabled.
Querying a busy OLTP database without taking locks
With no_lock set, SELECTs run under READ UNCOMMITTED, at the cost of dirty reads — a trade the config makes explicit.
6 tools
Listed in project docs. Your client may show a different list.
list_tablesdescribe_tablelist_viewslist_proceduresexecute_procedureBEFORE YOU INSTALL
What to know first
Tools you get
6 tools named in the project's documentation. execute_procedure registers only with readonly: false; by default the server is SELECT-only and shows 5. custom_tools in coremcp.yaml turns your own parameterised queries into extra tools.
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
Install the binary: curl -fsSL https://get.corebasehq.com | sh (or download the release asset for your platform, or docker pull y11t0/coremcp:latest)
From source instead (requires Go 1.23+):
git clone https://github.com/corebasehq/coremcp.git
cd coremcp
go build -o coremcp ./cmd/coremcpCreate coremcp.yaml in the working directory with your server/logging/sources config — the binary needs this file before it can serve anything
Local mode: coremcp serve --config coremcp.yaml, and add the mcpServers block below to claude_desktop_config.json
Remote mode instead:
coremcp connect --server="wss://api.corebasehq.com/ws/agent" --token="<YOUR_TOKEN>"MCP Clients
Claude Desktop
{
"mcpServers": {
"coremcp": {
"command": "<YOUR_PATH_TO_COREMCP>",
"args": [
"serve",
"-c",
"<YOUR_PATH_TO_COREMCP>"
],
"env": {}
}
}
}