What is MCP?
The Model Context Protocol (MCP) is a standardized JSON-RPC 2.0 protocol that enables AI agents to communicate with external data sources and tools. PromptRepo implements an MCP server that exposes your prompt library directly to AI assistants like Claude Code and Claude Desktop.Think of MCP as a real-time API for AI agents — instead of copy-pasting prompts manually, your AI assistant can query, search, and resolve prompts on-demand during conversations.
Why Use PromptRepo’s MCP Server?
Zero-Friction Access
AI agents can fetch prompts without leaving their environment — no browser tab switching or copy-paste required.
Dynamic Resolution
Variables like
{{language}} or {{framework}} are resolved at runtime, making prompts reusable across contexts.Full-Text Search
Agents can search your entire prompt library using natural language queries.
Version Control
Always get the latest version of a prompt — updates propagate instantly to all connected agents.
How It Works
Agent sends JSON-RPC request
The AI assistant calls the MCP endpoint at
POST /api/mcp with a tool name and parameters.Authentication via API key
PromptRepo verifies the API key from the
Authorization or x-api-key header.Tool execution
The dispatcher routes the request to the appropriate handler (list, get, resolve, or search).
Available Tools
PromptRepo’s MCP server exposes four core tools:list_prompts
list_prompts
Returns paginated prompt metadata (title, description, variables) without full content. Useful for browsing your library.Parameters:
limit(optional): Max results (1-100, default 20)offset(optional): Pagination offset (default 0)
- Authenticated: Your prompts + public prompts
- Anonymous: Public prompts only
get_prompt
get_prompt
Fetches a single prompt by ID, including full content and extracted variable names.Parameters:
prompt_id(required): UUID of the prompt
- Authenticated: Your own prompts (public/private) + others’ public prompts
- Anonymous: Public prompts only
resolve_prompt
resolve_prompt
Fetches a prompt and substitutes
{{variable}} placeholders with provided values. Unmatched variables remain as-is.Parameters:prompt_id(required): UUID of the promptvariables(optional): Map of variable names to replacement values
resolved_content: Template after substitutionunresolved_variables: Variables without provided values
search_prompts
search_prompts
Full-text search over accessible prompts using PostgreSQL’s tsvector indexing.Parameters:
query(required): Search string (min 1 character)limit(optional): Max results (1-50, default 10)
- Authenticated: Search your prompts + public prompts
- Anonymous: Search public prompts only
Authentication Model
PromptRepo uses API key authentication for MCP requests:- Authenticated users: Generate an API key from
/profile. Access your private prompts + all public prompts. - Anonymous users: No API key required. Access public prompts only (read-only).
Next Steps
Authentication Setup
Generate and manage API keys for secure access
Configuration
Connect Claude Desktop, Claude Code, and other MCP clients
Technical Specification
- Protocol: JSON-RPC 2.0 over HTTP
- Endpoint:
POST /api/mcp - Content-Type:
application/json - CORS: Enabled for cross-origin requests
- Auth headers:
Authorization: Bearer <key>orx-api-key: <key> - Response format: Always HTTP 200 (errors in JSON-RPC envelope)
The MCP endpoint is excluded from session-based authentication middleware, so you must use API key headers — browser cookies are not supported.