Skip to main content
MCP server CX Codex

mcp-context-server — Claude Code MCP server: how to install

Saves text and image context across agent runs in SQLite or PostgreSQL. Lets multiple assistants share state across threads with fine-grained access rules.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env LOG_LEVEL=<LOG_LEVEL> --env STORAGE_BACKEND=<STORAGE_BACKEND> --env MAX_IMAGE_SIZE_MB=<MAX_IMAGE_SIZE_MB> --env MAX_TOTAL_SIZE_MB=<MAX_TOTAL_SIZE_MB> --env DB_PATH=<DB_PATH> --transport stdio mcp-context-server -- uvx mcp-context-server
Open on GitHub

What mcp-context-server does

The server keeps multimodal entries keyed by UUIDv7 timestamps, operating on local SQLite by default or PostgreSQL for shared setups. Retrieval combines full-text indexing, vector similarity, and line-by-line matching with grep_context. Agents can map document outlines via navigate_context and retrieve targeted sections using read_context_range without pulling complete documents into memory.

Access controls govern entries down to specific owners, public views, and JWT grants, with optional PostgreSQL row-level security. Existing v2 databases require running mcp-context-server-migrate before running v3, as the storage schema does not load legacy tables automatically.

What it helps with

  • persist multimodal notes across agent sessions
  • search shared memory via hybrid vector and lexical ranking
  • inspect sections of large documents without flooding the agent prompt
  • isolate context entries between collaborators using token grants

Example prompts for the agent

  • Store this error screenshot and stack trace under thread deploy-bug
  • Use grep_context to locate references to database pool limits in stored records
  • Inspect the entry outline with navigate_context and pull lines 1 to 40 using read_context_range

How to install mcp-context-server

Platform CLI

claude mcp add --env LOG_LEVEL=<LOG_LEVEL> --env STORAGE_BACKEND=<STORAGE_BACKEND> --env MAX_IMAGE_SIZE_MB=<MAX_IMAGE_SIZE_MB> --env MAX_TOTAL_SIZE_MB=<MAX_TOTAL_SIZE_MB> --env DB_PATH=<DB_PATH> --transport stdio mcp-context-server -- uvx mcp-context-server

Replace <…> with your own values. 128 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-context-server <command>

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about mcp-context-server

How to install mcp-context-server in Claude Code?

Run `claude mcp add --env LOG_LEVEL=<LOG_LEVEL> --env STORAGE_BACKEND=<STORAGE_BACKEND> --env MAX_IMAGE_SIZE_MB=<MAX_IMAGE_SIZE_MB> --env MAX_TOTAL_SIZE_MB=<MAX_TOTAL_SIZE_MB> --env DB_PATH=<DB_PATH> --transport stdio mcp-context-server -- uvx mcp-context-server`. Replace each placeholder with your environment values.

What does mcp-context-server do?

It acts as an external memory backend for LLM clients, storing text and images while supporting hybrid search, outline navigation, and thread scoping.

How do you migrate data from version 2 to version 3?

Version 3 introduces UUIDv7 primary keys, requiring existing installations to run the bundled mcp-context-server-migrate CLI before launching the updated server.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor