cockroachdb-mcp-server

cockroachdb-mcp-server

A Model Context Protocol server that uses CockroachDB to store and manage model contexts via RESTful CRUD APIs, with automatic schema initialization.

Category
Visit Server

README

cockroachdb-mcp-server

PyPI Python License CI MCP Compatible

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-client CLI

โœ… 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, /evaluate extensions

๐Ÿš€ Quickstart

๐Ÿ“ฆ Install from PyPI

pip install cockroachdb-mcp-server

๐Ÿƒ Run with schema init

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


๐Ÿ”ง 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 /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


๐Ÿงฑ Schema Auto-Bootstrap

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()
);

๐Ÿ”— 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.).

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured