Context RepoContext Repo Docs
MCP Server

MCP Server

Connect your AI assistant to Context Repo with the Model Context Protocol (MCP) to manage prompts, documents, collections, and search from Claude, Cursor, VS Code, and more.

The Model Context Protocol (MCP) is an open standard that lets AI assistants connect to external tools and data sources. Instead of copying and pasting between your AI assistant and Context Repo, MCP gives your assistant direct access to your prompts, documents, and collections — so it can read, create, update, and search your workspace without you ever leaving the conversation.

Why MCP Matters

Without MCP, working with AI context looks something like this:

  • Open Context Repo in one tab, your AI assistant in another
  • Copy a prompt, switch tabs, paste it in
  • Get a response, switch back, save it as a document
  • Repeat for every interaction

With the Context Repo MCP Server, your AI assistant handles all of this directly. Ask it to list your prompts, create a document, search your collections, or explore content chunk by chunk — all through natural conversation.

One connection. The current hosted tool set. Zero tab-switching.

Tools Overview

The hosted MCP Server defines the tools available to every connection, including the search and fetch aliases used by ChatGPT. The context-repo-mcp v3 command is a stdio bridge to that same hosted endpoint, so its tool schemas and behavior update with the hosted server rather than a separate package implementation.

User Info

ToolDescription
get_user_infoGet your account details (name, email, profile image)

Prompts (7 tools)

ToolDescription
search_promptsList all your prompts with optional search filtering
read_promptGet a specific prompt's full content, variables, and metadata
create_promptCreate a new prompt template with title, description, and content
update_promptUpdate an existing prompt's title, description, or content
delete_promptPermanently delete a prompt
get_prompt_versionsView a prompt's version history with change logs
restore_prompt_versionRestore a prompt to a previous version

Documents (7 tools)

ToolDescription
list_documentsList all your documents with optional search filtering
get_documentGet a specific document's full content and metadata
create_documentCreate a new text document with optional tags
update_documentUpdate canonical document fields with no-op detection and optional revision/lease inputs
delete_documentPermanently delete a document
get_document_versionsView a document's version history with change logs
restore_document_versionRestore a document to a previous version

Collections (7 tools)

ToolDescription
list_collectionsList all your collections with optional search filtering
get_collectionGet a collection's details and its items
create_collectionCreate a new collection with name, description, icon, and color
update_collectionUpdate a collection's name, description, icon, or color
delete_collectionDelete a collection (items aren't deleted — they stay in your workspace)
add_to_collectionAdd prompts or documents to a collection
remove_from_collectionRemove prompts or documents from a collection

Search (1 tool)

ToolDescription
find_itemsSearch across prompts, documents, and collections using semantic similarity or keyword matching. Filter by type and toggle between search modes.

Deep Search (3 tools)

ToolDescription
deep_searchSearch within document content and get ranked, hierarchical chunks with navigation links
deep_readRead a specific chunk with full content, structural position, and metadata
deep_expandNavigate from a chunk in 5 directions: up (parent), down (children), next, previous, or surrounding

Deep Search is designed for exploring large documents progressively. Start with deep_search to find relevant passages, use deep_read to examine them in detail, and deep_expand to navigate through the document's structure without loading everything at once.

The safe document revision and lease parameters described here come from the hosted https://contextrepo.com/mcp endpoint and pass through the context-repo-mcp v3 stdio bridge unchanged.

Reasoning (1 tool)

ToolDescription
reasonAsk a question and get a synthesized, cited answer composed across your documents — with inline citations, an explicit list of gaps, and any conflicts between sources (read-only)

Reasoning sits one layer above Deep Search: instead of returning ranked chunks for you to read, reason gathers the most relevant evidence and composes a single cited answer. Use it when you want an answer, not a result list.

Safe Document Updates

get_document returns the canonical document revision, content hash, change time, and ETag. update_document and restore_document_version accept expectedRevision, idempotencyKey, leaseId, and leaseFence.

When you provide expectedRevision, the MCP Server fetches the current document in the same MCP invocation, compares its revision, and forwards the exact ETag from that response as If-Match. It never invents an ETag from the number or reuses one from an earlier call. A mismatch returns a typed REVISION_MISMATCH error instead of overwriting newer content.

Changed writes return a compact acknowledgement with the document ID, revision, content hash, change time, and noop status. Exact unchanged updates return noop: true. If document coordination is enabled, first obtain a lease through the REST API and pass its ID and fence with an idempotency key.

Authentication

The MCP Server supports two authentication methods:

  • Sign in with Context Repo (primary) — When you connect through a supported client like Cursor or Claude Desktop, you'll sign in with your Context Repo account through a hosted OAuth flow. This is the recommended method and happens automatically during setup.
  • API Key (fallback) — Generate an API key from Dashboard > Settings > API Keys and pass it as the authentication token. This works with any MCP-compatible client and is useful for programmatic access.

Both methods use the hosted tool set. The stdio npm package forwards to the same endpoint and does not maintain a separate inventory.

Grok uses the dedicated https://contextrepo.com/grok-mcp compatibility endpoint so its first request receives an OAuth challenge. It exposes the same 29 hosted tools as /mcp. Follow the Grok integration guide instead of the generic client setup.

Get Started

Ready to connect your AI assistant?