Back to catalog
CockroachDB MCP Server
An enterprise Model Context Protocol (MCP) server that uses CockroachDB as a reliable backend for managing model contexts with full CRUD operations and JSONB storage.
An enterprise Model Context Protocol (MCP) server that uses CockroachDB as a reliable backend for managing model contexts with full CRUD operations and JSONB storage.
Installation
PyPI
pip install cockroachdb-mcp-server
Available Tools
| Tool | Description |
|---|---|
create_context |
Create a new model context |
list_contexts |
Get a list of all contexts |
get_context |
Get a context by ID |
update_context |
Update an existing context |
delete_context |
Delete a context by ID |
Features
- REST API for managing MCP contexts
- Schema initialization via CLI flag or environment variable
- Auto-detection of CRDB URL and dialect correction
- Structured logging with configurable level
- JSONB storage allowing arbitrary input/output data schemas
- Ready for /run, /deploy, /evaluate extensions
Environment Variables
Required
CRDB_URL- CockroachDB connection URL (supports postgresql:// and cockroachdb:// formats)
Optional
MCP_AUTO_INIT_SCHEMA- Automatically initialize the database schema on startup
Notes
The server runs on http://localhost:8081 by default. Works seamlessly with the cockroachdb-mcp-client CLI tool. Includes automatic schema creation with UUID primary keys and JSONB storage for contexts.
