CockroachDB MCP Server

CockroachDB MCP Server

Production-grade MCP server in Python using FastAPI and CockroachDB with CRUD APIs and JSONB storage.

0
Stars
0
Forks
0
Releases

Overview

cockroachdb-mcp-server is a production-grade, spec-aligned MCP server implemented in Python with FastAPI and CockroachDB. It provides full MCP functionality with CRUD APIs to manage model contexts, and stores context definitions as JSONB to support arbitrary input/output schemas. The server is designed to work seamlessly with the cockroachdb-mcp-client CLI for managing contexts, simulating LLM runs, exporting data, and batch testing across providers. It exposes a REST API at /contexts with endpoints to create, list, retrieve, update, and delete contexts, and includes schema bootstrapping capabilities that can be triggered via a CLI flag (--init-schema) or an environment variable (MCP_AUTO_INIT_SCHEMA). The bootstrap creates a mcp_contexts table with id UUID, context_name, context_version, body JSONB, and created_at fields. The project emphasizes interoperability with CockroachDB, URL auto-detection and dialect fixes, structured logging, and readiness for extensions such as /run, /deploy, and /evaluate.

Details

Owner
viragtripathi
Language
Python
License
MIT License
Updated
2025-12-01

Features

REST API for MCP context management

Exposes full CRUD APIs for managing MCP contexts via the /contexts endpoints (create, list, get, update, delete).

Schema bootstrapping

Supports automatic and CLI/ENV-driven schema initialization to create the mcp_contexts table.

CRDB URL auto-detection and dialect fix

Automatically rewrites CRDB URLs for compatibility and fixes dialect issues.

JSONB-based context storage

Stores context definitions as JSONB to support arbitrary input/output schemas.

Structured logging

Provides structured logging with configurable log levels for observability.

LLM-ready CLI integration

Works with the cockroachdb-mcp-client CLI for context management, simulations, exports, and batch tests.

Extensible MCP workflow endpoints

Ready for future /run, /deploy, /evaluate extensions to support end-to-end MCP workflows.

Audience

ML EngineersManage MCP contexts via CRUD REST APIs and run LLM simulations using the CLI.
Backend / Full-stack DevelopersBuild integrations with FastAPI services and store MCP contexts in JSONB within CockroachDB.
DevOps / Platform EngineersConfigure schema bootstrapping, manage DB connections via CRDB URLs, and enable observability with structured logging.

Tags

MCPFastAPICockroachDBJSONBREST APICLISchema BootstrappingLLM Integration