Skip to content

MCP

When connected to a team, the relay exposes your local MCP tools through a Streamable HTTP endpoint. Any AI agent that supports MCP can connect — Claude.ai, ChatGPT, Claude Code, Cursor, Codex, Gemini, OpenCode, and more.

After connecting to a team (via the dashboard or oak team cloud-init), you need two values:

  • MCP Server URL: https://<your-worker>.workers.dev/mcp
  • Agent Token: Displayed on the Teams page (masked with reveal/copy buttons)

Also stored in .oak/config.yaml and .oak/ci/cloud-relay/wrangler.toml.

Many MCP-compatible clients read project MCP configuration files (JSON or TOML):

{
"mcpServers": {
"oak-team": {
"url": "https://<team-worker>.workers.dev/mcp",
"headers": {
"Authorization": "Bearer <agent_token>"
}
}
}
}

Use project-scoped config to keep the Team daemon binding local to this repository.

ClientConfig File Location
Claude Code.mcp.json
Cursor.cursor/mcp.json
Codex.codex/config.toml
Gemini CLI.gemini/settings.json
OpenCodeopencode.json
VS Code Copilot.vscode/mcp.json
  1. Open Claude.ai and go to Settings
  2. Navigate to the MCP Servers section
  3. Click Add MCP Server
  4. Enter:
    • Name: A descriptive label (e.g., “My Project — OAK”)
    • URL: https://<your-worker>.workers.dev/mcp
    • Authentication: Bearer token — paste your agent_token
  5. Save the configuration

Claude.ai connects to your relay and discovers available tools. Verify by asking Claude to list available tools or run a code search.

  1. Open ChatGPT and go to Settings > Connected Tools
  2. Click Add Tool and select MCP
  3. Enter the MCP server URL: https://<your-worker>.workers.dev/mcp
  4. Authenticate using your agent token when prompted

Refer to OpenAI’s documentation for the current MCP configuration interface.

Any AI agent that supports MCP Streamable HTTP can connect:

SettingValue
URLhttps://<your-worker>.workers.dev/mcp
TransportStreamable HTTP (POST)
Auth headerAuthorization: Bearer <agent_token>
Content-Typeapplication/json

The agent token authenticates cloud AI agents to the relay’s MCP endpoint.

  • Generated automatically during team deployment (oak team cloud-init)
  • Stored in .oak/config.yaml and the Worker’s secrets (encrypted at rest on Cloudflare)
  • Requires Authorization: Bearer <token>
  • All cloud agents share the same agent token

To rotate the token and revoke all agent access, see Token Rotation.

Verify the relay is working before configuring a cloud agent:

Terminal window
# List available tools
curl -X POST https://<your-worker>.workers.dev/mcp \
-H "Authorization: Bearer <agent_token>" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'

A successful response returns a JSON-RPC result with the tool list. If the local daemon is not connected, you’ll receive an error indicating the instance is offline.

Terminal window
curl -X POST https://<your-worker>.workers.dev/mcp \
-H "Authorization: Bearer <agent_token>" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"oak_search","arguments":{"query":"authentication"}},"id":2}'

For interactive testing, use the MCP Inspector — a visual tool for browsing and calling MCP server tools. Point it at your relay endpoint and provide the agent token.

You can register the same relay with multiple cloud agents simultaneously. All agents share the same agent token and have access to the same set of tools. The Worker handles concurrent requests transparently.


The Team daemon exposes the following tools via the Model Context Protocol (MCP). These are automatically registered when you run oak init and are available to any MCP-compatible agent — both local (via oak team mcp) and cloud (via the relay).

ToolPurpose
oak_searchSemantic search across code, memories, plans, and sessions
oak_rememberStore observations for future sessions
oak_contextGet task-relevant context
oak_resolve_memoryMark observations as resolved
oak_sessionsList recent coding sessions
oak_memoriesBrowse stored memories
oak_statsGet project intelligence statistics
oak_activityView tool execution history
oak_archive_memoriesArchive observations from search index
oak_fetchFetch full content for specific chunk IDs
oak_nodesList connected team relay nodes

When Team Sync is active, several tools support federated queries across all connected nodes (developers and machines on the same project):

ParameterTypeAvailable OnDescription
include_networkbooleanoak_search, oak_context, oak_sessions, oak_memories, oak_statsFan out the query to all connected nodes and merge results
node_idstringoak_resolve_memory, oak_activity, oak_archive_memoriesTarget a specific remote node (use oak_nodes to discover nodes)

Search the codebase, project memories, and past implementation plans using semantic similarity.

ParameterTypeRequiredDefaultDescription
querystringYesNatural language search query (e.g., “authentication middleware”)
search_typestringNo"all"What to search: "all", "code", "memory", "plans", or "sessions"
include_resolvedbooleanNofalseInclude resolved/superseded memories in results
limitintegerNo10Maximum results to return (1–50)
include_networkbooleanNofalseAlso search across connected team nodes. Not available for "code" searches.

Returns ranked results with relevance scores. Each result includes:

  • Code results: file path, line range, function name, code snippet, similarity score
  • Memory results: observation text, memory type, context, similarity score
  • Plan results: plan content, associated session, similarity score
{
"query": "database connection handling",
"search_type": "code",
"limit": 5
}
{
"query": "why did we choose SQLite",
"search_type": "memory"
}

Store an observation, decision, or learning for future sessions. Use this when you discover something important about the codebase that would help in future work.

ParameterTypeRequiredDefaultDescription
observationstringYesThe observation or learning to store
memory_typestringNo"discovery"Type of observation (see table below)
contextstringNoRelated file path or additional context
TypeWhen to useExample
gotchaNon-obvious behaviors or warnings”The API requires basic auth, not bearer token.”
bug_fixSolutions to specific errors”Fixed race condition in transaction handler.”
decisionArchitectural or design choices”We use polling instead of websockets for stability.”
discoveryFacts learned about the codebase”The user table is sharded by region.”
trade_offCompromises made and why”Chose eventual consistency for performance.”

Returns confirmation with the observation ID.

{
"observation": "The auth module requires Redis to be running",
"memory_type": "gotcha",
"context": "src/auth/handler.py"
}
{
"observation": "We chose SQLite over Postgres for simplicity and local-first design",
"memory_type": "decision"
}

Get relevant context for your current task. Call this when starting work on something to retrieve related code, past decisions, and applicable project guidelines.

ParameterTypeRequiredDefaultDescription
taskstringYesDescription of what you’re working on
current_filesarray of stringsNoFiles currently being viewed/edited
max_tokensintegerNo2000Maximum tokens of context to return
include_networkbooleanNofalseAlso fetch memories from connected team nodes. Code context stays local-only.

Returns a curated set of context optimized for the task, including:

  • Relevant code snippets
  • Related memories (gotchas, decisions, discoveries)
  • Applicable project guidelines
{
"task": "Implement user authentication with JWT",
"current_files": ["src/auth/handler.py", "src/middleware/auth.py"],
"max_tokens": 3000
}
{
"task": "Fix the failing database migration test"
}

Mark a memory observation as resolved or superseded. Use this after completing work that addresses a gotcha, fixing a bug that was tracked as an observation, or when a newer observation replaces an older one.

ParameterTypeRequiredDefaultDescription
idstringYesThe observation ID to resolve
statusstringNo"resolved"New status: "resolved" or "superseded"
reasonstringNoOptional reason for resolution
node_idstringNoTarget a specific remote node (use oak_nodes to discover nodes)

Returns confirmation of the status update.

{
"id": "obs_abc123",
"status": "resolved",
"reason": "Fixed in commit abc123"
}
{
"id": "obs_def456",
"status": "superseded"
}

List recent coding sessions with their status and summaries. Use this to understand what work has been done recently and find session IDs for deeper investigation with oak_activity.

ParameterTypeRequiredDefaultDescription
limitintegerNo10Maximum sessions to return (1–20)
include_summarybooleanNotrueInclude session summaries in output
include_networkbooleanNofalseAlso fetch sessions from connected team nodes

Returns a list of recent sessions with:

  • Session ID (UUID)
  • Status (active, completed, stale)
  • Agent type (claude, cursor, gemini, etc.)
  • Start time and last activity
  • Summary (if include_summary is true)
{
"limit": 5,
"include_summary": true
}
{
"limit": 20,
"include_summary": false
}

Browse stored memories and observations. Use this to review what the system has learned about the codebase, including gotchas, bug fixes, decisions, discoveries, and trade-offs.

ParameterTypeRequiredDefaultDescription
memory_typestringNoFilter by type: "gotcha", "bug_fix", "decision", "discovery", "trade_off"
limitintegerNo20Maximum memories to return (1–100)
statusstringNo"active"Filter by status: "active", "resolved", "superseded"
include_resolvedbooleanNofalseInclude all statuses regardless of status filter
include_networkbooleanNofalseAlso fetch memories from connected team nodes

Returns a list of memories with:

  • Observation ID
  • Memory type
  • Observation text
  • Context (file path, if any)
  • Status
  • Created timestamp
{
"memory_type": "gotcha",
"limit": 15
}
{
"memory_type": "decision",
"status": "active",
"limit": 30
}

Get project intelligence statistics including indexed code chunks, unique files, memory count, and observation status breakdown. Use this for a quick health check of the team intelligence system.

ParameterTypeRequiredDefaultDescription
include_networkbooleanNofalseAlso fetch stats from connected team nodes

Returns project statistics including:

  • Total indexed code chunks
  • Unique files indexed
  • Total memory observations
  • Observation breakdown by status (active, resolved, superseded)
{}

View tool execution history for a specific session. Shows what tools were used, which files were affected, success/failure status, and output summaries. Use oak_sessions first to find session IDs.

ParameterTypeRequiredDefaultDescription
session_idstringYesThe session ID to get activities for
tool_namestringNoFilter activities by tool name
limitintegerNo50Maximum activities to return (1–200)
node_idstringNoTarget a specific remote node (use oak_nodes to discover nodes)

Returns a list of tool executions with:

  • Tool name (Read, Edit, Write, Bash, etc.)
  • File path (if applicable)
  • Success/failure status
  • Timestamp
  • Output summary
{
"session_id": "8430042a-1b01-4c86-8026-6ede46cd93d9",
"limit": 100
}
{
"session_id": "8430042a-1b01-4c86-8026-6ede46cd93d9",
"tool_name": "Bash",
"limit": 20
}

Archive observations from the ChromaDB search index. Archived observations remain in SQLite for historical queries but stop appearing in vector search results. Use this for bulk cleanup of stale resolved or superseded observations.

ParameterTypeRequiredDefaultDescription
idsarray of stringsNoSpecific observation IDs to archive
status_filterstringNoArchive by status: "resolved", "superseded", or "both"
older_than_daysintegerNoOnly archive observations older than this many days (minimum 1)
dry_runbooleanNofalseIf true, return count without actually archiving
node_idstringNoTarget a specific remote node (use oak_nodes to discover nodes)

Returns the number of observations archived (or that would be archived in dry-run mode).

{
"status_filter": "both",
"older_than_days": 30,
"dry_run": true
}
{
"ids": ["obs_abc123", "obs_def456"]
}

Fetch the full content for specific code chunk IDs returned by oak_search. Use this to retrieve the complete code snippet when search results only include a preview.

ParameterTypeRequiredDefaultDescription
idsarray of stringsYesChunk IDs to fetch (from search results)

Returns the full content for each requested chunk, including file path, line range, and complete code text.

{
"ids": ["chunk_abc123", "chunk_def456"]
}

List connected team relay nodes. Shows machine IDs, online status, OAK version, and capabilities for each node. Use this to discover available nodes before targeting them with node_id in other tools.

This tool takes no parameters.

Returns a list of connected nodes with:

  • Machine ID
  • Online status
  • OAK version
  • Capabilities (federated_tools_v1)
{}