MCP & API

ucpcore-server exposes MCP over Streamable HTTP at /mcp and a REST API at /v1. Same process, same cache.

MCP tools

ToolParametersReturns
generate_context source (github | jira), ref (owner/repo#123 or PROJ-123), llm (optional, default false) Builds a UCP; caches by id (e.g. github-pallets-flask-5961)
list_contexts Cached packages: id, entity, title, freshness
get_context id Full UCP JSON
get_context_markdown id, optional token_budget Canonical Markdown rendering (SPEC §7)
submit_usage_receipt Receipt JSON per SPEC §4.12package_id, claims_cited, claims_ignored, outcome Records which claims helped; feeds warm ranking on the next generate

MCP prompts

Built-in prompts that clients may surface as slash commands:

PromptAction
ucp_context(ref, llm=false) Generate a package and use it as authoritative task context
ucp_catchup(ref) Generate and brief: decisions, conflicts, what's still open

Reference shape is detected automatically: owner/repo#123 → GitHub, PROJ-123 → Jira. In Cursor, prefer the project-local /ucp command for a first-class chat shortcut.

Cursor configuration

{ "mcpServers": { "ucp": { "url": "http://localhost:8080/mcp" } } }

With API key:

{ "mcpServers": { "ucp": { "url": "http://localhost:8080/mcp", "headers": { "Authorization": "Bearer YOUR_KEY" } } } }

REST API

MethodPathPurpose
POST/v1/generateGenerate package. Body: {"source","ref","llm"?,"since"?,"audience"?}
GET/v1/packagesList cached packages
GET/v1/packages/{id}Full UCP JSON
GET/v1/packages/{id}/markdown?token_budget=1500Rendered Markdown
POST/v1/receiptSubmit Usage Receipt (scope receipt). Body: receipt JSON referencing a cached package_id
GET/healthz, /readyzProbes (never authenticated)
GET/docsOpenAPI interactive docs
curl -s -X POST http://localhost:8080/v1/generate \ -H 'Content-Type: application/json' \ -d '{"source": "github", "ref": "pallets/flask#5961"}'

Environment variables

VariableDefaultPurpose
UCP_SERVER_HOST127.0.0.1Bind address (Docker image: 0.0.0.0)
UCP_SERVER_PORT8080Bind port
UCP_SERVER_API_KEYunsetBearer auth for all endpoints except health probes
UCP_CACHE_DIR~/.cache/ucp-serverDisk cache directory
UCP_CACHE_TTL900Cache TTL in seconds; 0 disables cache
GITHUB_TOKEN / GH_TOKENunsetHigher GitHub rate limits
JIRA_BASE_URLunsete.g. https://yourcompany.atlassian.net
JIRA_EMAILunsetJira Cloud email (Basic auth)
JIRA_API_TOKENunsetJira API token or PAT
UCP_LLM_BASE_URLhttps://api.openai.com/v1OpenAI-compatible endpoint for llm: true
UCP_LLM_API_KEYunsetLLM key (falls back to OPENAI_API_KEY)
UCP_LLM_MODELgpt-4o-miniModel name for enrichment

Stdio MCP (local files)

To serve pre-generated .ucp.json files from a directory — without the HTTP server:

pip install ucp-mcp ucp-mcp --dir .

Exposes list_contexts, get_context, and get_context_markdown over stdio. No generate_context — generation is CLI (ucp-gen) or HTTP server.

Security