Skip to content

MCP Tools Reference

The Codebase Intelligence daemon exposes three tools via the Model Context Protocol (MCP). These tools are automatically registered when you run oak init and are available to any MCP-compatible agent.

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", or "plans"
limitintegerNo10Maximum results to return (1–50)

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

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"
}