Full - featured MCP implementation built with FastAPI and CockroachDB. Supports schema bootstrapping, JSONB storage, LLM-ready CLI, and optional /debug
endpoints.
A Model Context Protocol (MCP) server implemented in Python using FastAPI and CockroachDB.
cockroachdb-mcp-server
is a production-grade, spec-aligned MCP server that:
cockroachdb-mcp-client
CLI/contexts
)/run
, /deploy
, /evaluate
extensionspip install cockroachdb-mcp-server
cockroachdb-mcp-server serve --init-schema --log-level INFO
Or:
export MCP_AUTO_INIT_SCHEMA=true
cockroachdb-mcp-server serve
Server runs at
http://localhost:8081
by default
cockroachdb-mcp-server serve --init-schema
cockroachdb-mcp-server serve --port 8081 --host 127.0.0.1 --reload
cockroachdb-mcp-server --version
CRDB_URL
environment variableexport CRDB_URL="postgresql://root@localhost:26257/defaultdb?sslmode=disable"
Automatically rewritten to
cockroachdb://...
under the hood for compatibility.
Alternatively, set it directly:
export CRDB_URL="cockroachdb://root@localhost:26257/defaultdb?sslmode=disable"
โ Both formats are supported.
Method | Path | Description |
---|---|---|
POST | /contexts |
Create a context |
GET | /contexts |
List all contexts |
GET | /contexts/{id} |
Get context by ID |
PUT | /contexts/{id} |
Update context |
DELETE | /contexts/{id} |
Delete context |
๐ View full API reference โ
๐ View hosted API Docs
Run this manually:
cockroachdb-mcp-server serve --init-schema
Or automatically with:
export MCP_AUTO_INIT_SCHEMA=true
The schema created is:
CREATE TABLE IF NOT EXISTS mcp_contexts (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
context_name STRING NOT NULL,
context_version STRING NOT NULL,
body JSONB NOT NULL,
created_at TIMESTAMP DEFAULT now()
);
This project is designed for internal and community use.
PRs welcome to extend functionality (auth, deployment support, /evaluate
, telemetry, etc.).