Skip to main content

MCP Server for CortexDB — expose memory operations to AI agents

Project description

CortexDB MCP Server

MCP (Model Context Protocol) server that gives AI tools persistent long-term memory via CortexDB. Works with Claude Desktop, Cursor, Windsurf, VS Code Copilot, and any MCP-compatible client.

Quick Start

# Install
pip install -e .

# Or with uvx (no install needed)
uvx --from . cortexdb-mcp

Set your environment variables:

export CORTEXDB_URL="https://api.cortexdb.ai"
export CORTEXDB_API_KEY="cx_live_your_key_here"

Run:

cortexdb-mcp

IDE Setup

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "cortexdb": {
      "command": "cortexdb-mcp",
      "env": {
        "CORTEXDB_URL": "https://api.cortexdb.ai",
        "CORTEXDB_API_KEY": "cx_live_your_key_here"
      }
    }
  }
}

Claude Code (CLI)

Edit ~/.claude/mcp.json:

{
  "mcpServers": {
    "cortexdb": {
      "command": "cortexdb-mcp",
      "env": {
        "CORTEXDB_URL": "https://api.cortexdb.ai",
        "CORTEXDB_API_KEY": "cx_live_your_key_here"
      }
    }
  }
}

Cursor

Edit ~/.cursor/mcp.json:

{
  "mcpServers": {
    "cortexdb": {
      "command": "cortexdb-mcp",
      "env": {
        "CORTEXDB_URL": "https://api.cortexdb.ai",
        "CORTEXDB_API_KEY": "cx_live_your_key_here"
      }
    }
  }
}

Or in Cursor Settings > MCP Servers > Add Server.

Windsurf

Edit ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "cortexdb": {
      "command": "cortexdb-mcp",
      "env": {
        "CORTEXDB_URL": "https://api.cortexdb.ai",
        "CORTEXDB_API_KEY": "cx_live_your_key_here"
      }
    }
  }
}

VS Code (GitHub Copilot)

Add to .vscode/mcp.json in your project or ~/.vscode/mcp.json globally:

{
  "servers": {
    "cortexdb": {
      "command": "cortexdb-mcp",
      "env": {
        "CORTEXDB_URL": "https://api.cortexdb.ai",
        "CORTEXDB_API_KEY": "cx_live_your_key_here"
      }
    }
  }
}

Tools

Memory Operations

Tool Description
memory_store Store a new memory with optional source, type, tags, TTL
memory_search Search memories using natural language (hybrid retrieval)
memory_forget Delete memories with audit trail (GDPR-compliant)
get_context Deep contextual retrieval combining search + graph
advanced_search Search with structured filters (source, type, time range)

Episode Management

Tool Description
memory_list List episodes with pagination and type filter
memory_get Get a specific episode by ID
memory_update Update episode content or metadata
memory_delete Delete a specific episode by ID
memory_bulk_delete Bulk delete with query matching and dry-run support

Knowledge Graph

Tool Description
entity_list List entities (people, services, projects, concepts)
entity_get Get entity details including relationships and recent episodes
entity_edges Get all relationships for an entity
entity_link Create a relationship between two entities

Admin & Observability

Tool Description
health_check Check CortexDB server health
get_usage View usage stats and tier limits
get_insights Generate proactive insights (incident spikes, gaps, risks)
get_ontology View entity types and relationship types
export_data Export memories as JSON
import_data Import memories from JSON

Resources

Resources provide read-only data that AI tools can access:

Resource URI Description
cortexdb://health Server health status
cortexdb://metrics Request metrics (total, active, errors, rate-limited)
cortexdb://usage Usage statistics and tier limits
cortexdb://episodes Recent 50 episodes
cortexdb://entities Top 100 knowledge graph entities
cortexdb://insights Proactive insights
cortexdb://ontology Entity and relationship type schema

Prompts

Pre-built prompt templates:

Prompt Description
investigate_incident Investigate an incident using stored memories
summarize_knowledge Summarize everything known about a topic
deployment_review Pre-deployment safety review
onboard_to_codebase Onboard to a codebase using stored knowledge
weekly_digest Generate a weekly activity summary

Configuration

Environment Variable Default Description
CORTEXDB_URL https://api.cortexdb.ai CortexDB server URL
CORTEXDB_API_KEY (none) API key for authentication
CORTEXDB_TIMEOUT 30.0 HTTP request timeout (seconds)

Examples

Store a memory from Cursor

Ask your AI assistant:

"Remember that the payments service was migrated to Stripe v3 on March 15th"

The assistant will call memory_store with the content.

Search memories

"What do we know about the payments service?"

The assistant calls memory_search and gets relevant context from CortexDB.

Explore the knowledge graph

"Show me all entities related to the auth service"

The assistant calls entity_get or entity_edges to traverse relationships.

Pre-deployment review

"Run a deployment review for the user-service"

Uses the deployment_review prompt to check for recent incidents, dependencies, and risks.

Architecture

┌─────────────┐     stdio/SSE     ┌──────────────┐     HTTP     ┌──────────┐
│  AI Client  │ ◄──────────────► │  MCP Server  │ ◄──────────► │ CortexDB │
│  (Cursor,   │     MCP JSON-RPC  │  (this pkg)  │   REST API   │  Server  │
│   Claude,   │                   │              │              │          │
│   VS Code)  │                   └──────────────┘              └──────────┘
└─────────────┘

The MCP server is a thin translation layer:

  1. Receives MCP tool calls from the AI client
  2. Translates them to CortexDB REST API calls
  3. Formats responses for the AI to consume

License

MIT

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

cortexdb_mcp-0.2.2.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

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

cortexdb_mcp-0.2.2-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file cortexdb_mcp-0.2.2.tar.gz.

File metadata

  • Download URL: cortexdb_mcp-0.2.2.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for cortexdb_mcp-0.2.2.tar.gz
Algorithm Hash digest
SHA256 4b8c74d8c403708a74e75b7bef95f3a2b6cd178c5b6f461a7c17b09826fc6c43
MD5 423072ccdf392063252399ef4b600b79
BLAKE2b-256 f6c621b19c68d105530867ae3d5c665a8493e6fe8b97e091f8d4c17553edc8e8

See more details on using hashes here.

File details

Details for the file cortexdb_mcp-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: cortexdb_mcp-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for cortexdb_mcp-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fd8c04cb0cbd361c42225cdcbff8281a72e35cb9c73f97f71cefdf7d3d326d36
MD5 2fbed7ba1f3db9f88b55c8a6f624fe88
BLAKE2b-256 91ba42793f628de405342ce4947093b395b5b476a64be8909d7886c7f76f6791

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