cockroachdb-mcp-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cockroachdb-mcp-servercreate a new context for user session tracking"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cockroachdb-mcp-server
A Model Context Protocol (MCP) server implemented in Python using FastAPI and CockroachDB.
๐ง What This Is
cockroachdb-mcp-server is a production-grade, spec-aligned MCP server that:
Implements the Model Context Protocol
Uses CockroachDB as a resilient, SQL-compatible backend
Exposes full CRUD APIs for managing model contexts
Stores context definitions as JSONB, allowing arbitrary input/output schema
Works seamlessly with the
cockroachdb-mcp-clientCLI
Related MCP server: MCP TapData Server
โ Feature Highlights
โ REST API for MCP context management (
/contexts)โ Schema bootstrapping via CLI flag or env var
โ CRDB URL auto-detection and dialect fix
โ Structured logging and configurable log level
โ Ready for
/run,/deploy,/evaluateextensions
๐ Quickstart
๐ฆ Install from PyPI
pip install cockroachdb-mcp-server๐ Run with schema init
cockroachdb-mcp-server serve --init-schema --log-level INFOOr:
export MCP_AUTO_INIT_SCHEMA=true
cockroachdb-mcp-server serveServer runs at
http://localhost:8081by default
๐ง CLI Usage
cockroachdb-mcp-server serve --init-schema
cockroachdb-mcp-server serve --port 8081 --host 127.0.0.1 --reload
cockroachdb-mcp-server --version๐ Configuring the Database
โ
Set the CRDB_URL environment variable
export 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.
๐งช API Endpoints
Method | Path | Description |
POST |
| Create a context |
GET |
| List all contexts |
GET |
| Get context by ID |
PUT |
| Update context |
DELETE |
| Delete context |
๐ View full API reference โ
๐ View hosted API Docs
๐งฑ Schema Auto-Bootstrap
Run this manually:
cockroachdb-mcp-server serve --init-schemaOr automatically with:
export MCP_AUTO_INIT_SCHEMA=trueThe 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()
);๐ Related Projects
cockroachdb-mcp-client: CLI tool to manage MCP contexts, simulate LLM runs, export, and batch simulate across providers.
๐ Contributions
This project is designed for internal and community use.
PRs welcome to extend functionality (auth, deployment support, /evaluate, telemetry, etc.).
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/viragtripathi/cockroachdb-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server