Skip to main content

CLI for interacting with a CRDB-backed Model Context Protocol server

Project description

crdb-mcpctl

PyPI Python License CI

A developer-friendly, model-provider-agnostic CLI tool for working with Model Context Protocol servers — built specifically for use with CockroachDB backends.

crdb-mcpctl CLI screenshot


🧠 What This Is

crdb-mcpctl is a spec-aligned, CLI-first interface for creating, managing, exporting, and running Model Context Protocol resources.

It works with crdb-mcp-server, a FastAPI-based MCP implementation backed by CockroachDB. Together, they offer:

  • A reliable MCP context registry (server)
  • A CLI for simulation, LLM runs, and batch workflows (client)

✅ Feature Highlights

  • 🌱 MCP-spec-compliant context management (create, list, get, delete)
  • 📦 Export individual or all contexts to YAML or JSON
  • 🔁 Run contexts against real LLMs (OpenAI, Anthropic, etc.)
  • 💬 Supports streaming, retry, model override
  • 📚 Batch simulation of inputs
  • ⚙️ Reads config from ~/.config/crdb-mcpctl/config.yaml or env vars
  • 🧱 Extensible provider system (Claude, GPT-4, Mistral, etc.)
  • 📈 Configurable logging per command (--log-level)

🚀 Quickstart

📦 Install from PyPI

pip install crdb-mcpctl

🛠 Or install from source

git clone https://github.com/viragtripathi/crdb-mcpctl
cd crdb-mcpctl
pip install -e .

You’ll also need a running instance of crdb-mcp-server


🔐 Configuration Options

✅ Environment Variables (preferred for CI and scripting)

Variable Description
MCP_SERVER_URL Base URL for the MCP server
MCP_API_TOKEN Bearer token for protected endpoints
OPENAI_API_KEY API key for OpenAI LLMs
ANTHROPIC_API_KEY API key for Anthropic Claude LLMs
export MCP_SERVER_URL=http://localhost:8081
export OPENAI_API_KEY=sk-...

🗂 ~/.config/crdb-mcpctl/config.yaml (alternative for local/dev)

server: http://localhost:8081

openai:
  api_key: sk-...

anthropic:
  api_key: your-anthropic-key

✅ Env vars take precedence over config file.


🧪 CLI Commands

# Show version and top-level help
crdb-mcpctl --version
crdb-mcpctl --help

# Create a context
crdb-mcpctl create context --file summarizer.yaml

# List all contexts
crdb-mcpctl list contexts

# Get or delete a context
crdb-mcpctl get context <uuid>
crdb-mcpctl delete context <uuid> -y

# Export one or all
crdb-mcpctl export context <uuid> --file out.yaml
crdb-mcpctl export all --output-dir exported_contexts/

# Run a single input
crdb-mcpctl run context --provider openai --file context.yaml --input "Summarize this article"

# Simulate a batch of inputs
crdb-mcpctl simulate context \
  --provider anthropic \
  --file summarizer.yaml \
  --inputs inputs.txt

🧰 Logging

Enable structured logging with:

crdb-mcpctl create context --file ctx.yaml --log-level DEBUG

♻️ Retry Logic

All network operations (GET, POST, DELETE) retry up to 3 times with 2s backoff using tenacity.


💡 Error Feedback Example

On connection failure:

❌ Failed to connect to MCP server at http://localhost:8081

🔧 Is the server running? Start it with:
  crdb-mcp-server serve --init-schema

🌍 To override the server URL:
  --server http://localhost:8081
  OR
  export MCP_SERVER_URL=http://localhost:8081

🙌 Contributions

This project is open for internal and public usage.

If you want to support additional providers, improve UX, or standardize context specs, contributions are welcome.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crdb_mcpctl-0.1.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crdb_mcpctl-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file crdb_mcpctl-0.1.0.tar.gz.

File metadata

  • Download URL: crdb_mcpctl-0.1.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for crdb_mcpctl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 367991e8de6e6b5be3cc2176bbd59a1f6f72cd48f8f77d9b8f6c249614732b52
MD5 882e5a399c807f4153c08d25fbcf8edd
BLAKE2b-256 20da0fab4ba9082ba58ecd21e84af765056b5cc01f0ff6376a245b05af85d2ff

See more details on using hashes here.

File details

Details for the file crdb_mcpctl-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: crdb_mcpctl-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for crdb_mcpctl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c0aeb214e2ad9acb54290c0d0a7bb65169cf6a692829061aab50479fadf985c
MD5 4e4ec54d0099af8ed0c0e1b2405a42a8
BLAKE2b-256 d5906810f2bb5b4077f5f4e4351c7e4da22f77397c633d946b410ad2ea1a2e26

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page