CoreMCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/corebasehq/coremcp.git
cd coremcp
go build -o coremcp ./cmd/coremcp
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add coremcp -- node "<FULL_PATH_TO_COREMCP>/dist/index.js"

Replace <FULL_PATH_TO_COREMCP>/dist/index.js with the actual folder you prepared in step 1.

README.md

Connect Legacy Databases to AI Agents via Model Context Protocol

CoreMCP

Model Context Protocol (MCP) server for database operations

CoreMCP by CoreBaseHQ provides a secure, extensible bridge between AI assistants (like Claude Desktop) and your databases through the Model Context Protocol.

🚀 Features

⚠️ Safety First: CoreMCP is designed to be Read-Only by default. We strongly recommend creating a specific database user with SELECT permissions only.

  • 🔌 Multiple Database Support: MSSQL, Firebird (coming soon), and extensible adapter system
  • 🧠 Automatic Schema Discovery: CoreMCP automatically scans your database tables, columns, foreign keys, and descriptions to provide AI context
  • 📝 Column Comments Support: Extracts and presents database column comments/descriptions to the AI for better query understanding
  • 🛠️ Dynamic Tool Generation: Built-in tools for common operations (list tables, describe schema) plus custom tool support
  • 🎯 Custom Query Tools: Define reusable SQL queries as MCP tools in your config file
  • 🛡️ NOLOCK / Read Uncommitted: Per-source option to run all SELECT queries under READ UNCOMMITTED isolation (MSSQL WITH (NOLOCK) equivalent) for zero-locking reads on busy OLTP databases
  • 🛡️ Secure: Read-only mode support, connection string isolation
  • 🎯 MCP Native: Built specifically for Model Context Protocol
  • 🔧 Easy Configuration: Simple YAML-based setup
  • 📦 Lightweight: Single binary, no runtime dependencies

📋 Requirements

  • Go 1.23 or higher (for building from source)
  • Database drivers are embedded in the binary

🔧 Installation

From Source

git clone https://github.com/corebasehq/coremcp.git
cd coremcp
go build -o coremcp ./cmd/coremcp

Binary Release

Download the latest release from the Releases page.

⚙️ Configuration

Create a coremcp.yaml file in your working directory:

server:
  name: "coremcp-agent"
  version: "0.1.0"
  transport: "stdio"
  port: 8080

logging:
  level: "info"
  format: "json"

sources:
  - name: "my_database"
    type: "mssql"
    dsn: "sqlserver://username:password@localhost:1433?database=mydb&encrypt=disable"
    readonly: true
    no_lock: true            # Optional: READ UNCOMMITTED isolation (WITH (NOLOCK) equivalent)
    normalize_turkish: true  # Optional: Turkish character normalization for legacy ERP databases

See coremcp.example.yaml for more examples.

DSN Format

Microsoft SQL Server:

sqlserver://username:password@host:port?database=dbname&encrypt=disable

Dummy (for testing):

dummy://test

Security Configuration

CoreMCP includes enterprise-grade security features:

security:
  # Maximum rows to return (prevents DB overload)
  max_row_limit: 1000
  
  # Enable PII masking
  enable_pii_masking: true
  
  # PII patterns to mask
  pii_patterns:
    - name: "credit_card"
      pattern: '\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b'
      replacement: "****-****-****-****"
      enabled: true
    - name: "email"
      pattern: '\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'
      replacement: "***@***.***"
      enabled: true
    - name: "turkish_id"
      pattern: '\b[1-9]\d{10}\b'
      replacement: "***********"
      enabled: true

Security Features:

  • AST-Based Query Validation: Uses sqlparser to analyze SQL queries and block dangerous operations (DROP, ALTER, UPDATE, DELETE, TRUNCATE, EXEC, etc.)
  • Automatic Row Limiting: Adds LIMIT clause to prevent accidentally returning millions of rows
  • PII Data Masking: Automatically masks sensitive data like credit cards, emails, SSNs, Turkish IDs, IBANs
  • Configurable Patterns: Define custom regex patterns for your specific PII requirements

Source Options

Option Type Default Description
name string Unique source identifier
type string Adapter type: mssql, dummy
dsn string Connection string
readonly bool false Restrict to SELECT-only at the config level
no_lock bool false (MSSQL only) Run all SELECT queries under READ UNCOMMITTED transaction isolation level. Equivalent to adding WITH (NOLOCK) to every table reference. Eliminates shared lock acquisition, improving read throughput on busy OLTP databases. Trade-off: may return dirty (uncommitted) rows.
normalize_turkish bool false **(MSSQL only)

Tools (2)

list_tablesLists all tables available in the connected database schema.
describe_schemaProvides detailed schema information including columns, types, and foreign keys.

Configuration

claude_desktop_config.json
{"mcpServers": {"coremcp": {"command": "coremcp", "args": ["--config", "/path/to/coremcp.yaml"]}}}

Try it

List all the tables available in my connected MSSQL database.
Describe the schema for the 'users' table so I can understand its structure.
Can you explain the relationship between the 'orders' and 'customers' tables based on the schema?
Generate a SQL query to select the top 10 recent entries from the 'logs' table.

Frequently Asked Questions

What are the key features of CoreMCP?

Automatic schema discovery of tables, columns, and foreign keys. AST-based query validation to block dangerous operations like DROP or DELETE. Built-in PII data masking for sensitive information like emails and credit cards. Support for READ UNCOMMITTED isolation to improve performance on busy databases. Extensible adapter system with native MSSQL support.

What can I use CoreMCP for?

Enabling AI agents to perform read-only data analysis on legacy ERP databases. Providing natural language interfaces for database schema exploration. Securely exposing database insights to LLMs without risking data modification. Optimizing database read performance for AI agents using NOLOCK isolation.

How do I install CoreMCP?

Install CoreMCP by running: git clone https://github.com/corebasehq/coremcp.git && cd coremcp && go build -o coremcp ./cmd/coremcp

What MCP clients work with CoreMCP?

CoreMCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep CoreMCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare