Prerequisites
- Node.js >= 22
- A Context API key configured in
~/.ultracontext/config.json(set up byultracontext config) - CLI running to ingest sessions (see CLI)
Setup
Claude Code
bash
Codex
Add to~/.codex/config.toml:
TOML
The MCP server reads your API key from
~/.ultracontext/config.json automatically — the same config file used by the CLI.Tools
The MCP server exposes three tools:list_contexts
List recent agent contexts with optional filters.
get_context_messages
Retrieve all messages from a specific context.
get_recent_activity
Shortcut for “what happened last?” — fetches the latest context and returns its most recent messages.
Examples
Once set up, you can ask your agent natural language questions:- “What did Codex do last?”
- “Show me Claude Code sessions in /Users/alice/Code/myapp”
- “What happened on my Mac mini today?”
- “List all sessions from the last 24 hours”
Remote mode (HTTP)
The Context API has a built-in MCP endpoint at/mcp. Any MCP-compatible client that supports Streamable HTTP can connect directly — no separate server needed.
bash
Standalone HTTP server
For cases where you need a dedicated MCP server (e.g. running on a different port or machine), you can run the standalone HTTP transport:bash
MCP_PORT) with the MCP endpoint at /mcp and a health check at /health.
CLI
Set up automatic session ingestion.
API Reference
Full Context API documentation.