# corebasehq/coremcp [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/corebasehq/coremcp  
**GitHub Stars:** 11  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/corebasehq-coremcp

## Description
A secure, tunnel-native database bridge for AI agents. Connects localhost & on-premise databases (MSSQL, etc.) to LLMs with AST-based query safety and PII masking.

## Tools
Capabilities this server exposes over MCP:

- **query_database** — Arbitrary SQL against a configured source.
- **list_tables** — Tables with column counts, primary keys, foreign key counts.
- **describe_table** — Full schema for one table: columns, types, nullability, PKs, FKs, column comments.
- **list_views** — All views with column definitions.
- **list_procedures** — Stored procedures with parameter names, types, modes (`IN`/`OUT`/`INOUT`), and a ready-to-copy example call.
- **execute_procedure** — Calls a stored procedure with named parameters. **Only enabled when `readonly: false`.**

## Claude Desktop Quick Installation
Heuristic fallback — verify the package name and runner against the repository README before running it. Uses `npx` (confidence: low):

```json
"mcpServers": {
  "coremcp": {
    "command": "npx",
    "args": ["-y","corebasehq-coremcp"]
  }
}
```

## Documentation

## What corebasehq/coremcp MCP server does

The corebasehq/coremcp MCP server connects MCP clients to configured SQL data sources. Its stable database adapters are MSSQL and PostgreSQL, with a dummy adapter available for testing without a real database. The project is distributed as a Go binary that includes its database drivers.

Agents can run SQL against a named source and inspect database structure. Schema discovery includes tables, columns, primary and foreign key information, views, and stored procedures. Procedure metadata includes parameter names, types, modes, and an example call. Calling a stored procedure is available only when the source explicitly sets `readonly: false`.

## How it works

Local operation uses the `serve` command and stdio transport. This is intended for desktop MCP clients and other local processes. Remote operation uses `connect`, which opens an outbound WebSocket to a relay. Because the agent initiates the connection, the database host does not need to accept inbound connections; the README describes this mode for networks such as corporate VPCs and on-premise sites.

The corebasehq/coremcp MCP server applies security processing before and after database access. Its T-SQL-aware validation allows `SELECT` and `WITH` statements in read-only query mode and rejects disallowed statements, multiple statements, and several SQL Server features that could modify or expose data. A forced row limit caps result size, and regex-based masking can replace configured patterns such as email addresses, credit card numbers, and Turkish identity numbers in returned strings.

MSSQL sources can optionally use `READ UNCOMMITTED` behavior through `no_lock`. The `normalize_turkish` option supports selected legacy Turkish database encoding and comparison cases, including normalization of SQL string literals and correction of some mojibake in returned text.

## Setup and configuration

Install options include a release binary, the Linux/macOS installer, Docker, or building from source with Go 1.23 or newer. A YAML file named `coremcp.yaml` is used by the local server. Each source requires a unique name, adapter type, and database connection string. MSSQL uses a `sqlserver://` DSN; PostgreSQL uses a `postgresql://` DSN.

The default source setting is read-only. Set `readonly: false` only when procedure execution is needed, and use a database account limited to the intended `SELECT` and `EXECUTE` permissions. Server settings also control logging, transport, port, row limits, PII masking, and custom masking patterns.

For remote mode, provide a relay WebSocket URL and authentication token to `coremcp connect`. An agent ID can be supplied for identification, and reconnect behavior can be configured with command-line flags.

## Tools and capabilities

The corebasehq/coremcp MCP server provides these database tools:

- `query_database` runs SQL against a selected configured source.
- `list_tables` reports tables, column counts, primary keys, and foreign key counts.
- `describe_table` returns detailed column and constraint metadata, including comments.
- `list_views` returns views and their column definitions.
- `list_procedures` returns stored procedure parameters and example calls.
- `execute_procedure` invokes a procedure with named parameters when writes are enabled for that source.

The remote relay protocol additionally supports SQL execution, cached schema retrieval, source listing, health checks, and configuration synchronization.

## Limitations and notes

Firebird support is still in progress and currently returns a placeholder error. MySQL is listed as roadmap work, while HTTP transport, audit logging, and query-result caching are also not yet available. Query safeguards are intended as one security layer; the documentation recommends pairing them with least-privilege database roles rather than relying on validation alone. `no_lock` can produce dirty reads, so it should be used with that trade-off understood.

_Full upstream README: https://allmcps.com/mcp/corebasehq-coremcp/readme_

