<!--
Sitemap:
- [Installation](/installation)
- [Upgrading](/upgrading): Version-specific steps for upgrading an existing Bento install.
- [Concepts](/concepts)
- [Build your first pipeline](/tutorials/pipeline-args)
- [Target a specific issue or PR from a URL](/tutorials/url-targeting)
- [Keep state across runs](/tutorials/pipeline-state)
- [Fire a pipeline on a schedule or on demand](/tutorials/schedule-and-fire)
- [Configuration](/configuration)
- [Knowledge Base](/knowledge-base/)
- [Method & delivery](/knowledge-base/modes)
- [Config](/knowledge-base/config)
- [MCP](/knowledge-base/mcp)
- [Pipeline configuration reference](/pipelines/config)
- [Filters](/pipelines/filters)
- [Triggers](/triggers/)
- [GitHub Trigger](/triggers/github)
- [Linear Trigger](/triggers/linear)
- [Webhook](/triggers/webhook)
- [Schedule Trigger](/triggers/schedule)
- [Manual Trigger](/triggers/manual)
- [Traces](/pipelines/traces)
- [Slack](/integrations/slack)
- [Public Access](/public-access)
- [Context Engineering](/context-engineering)
- [Best Practices](/best-practices)
- [Troubleshooting](/troubleshooting)
- [Architecture](/architecture/vision)
- [Workspaces](/workspaces)
- [Authentication](/authentication)
- [Identity](/identity)
- [Security](/security)
- [References](/references)
- [Changelog](/changelog): Bento release history.
- [CLI Reference](/cli/)
- [Setup](/cli/setup)
- [Lifecycle](/cli/lifecycle)
- [Sandbox Image](/cli/image)
- [Observability](/cli/observability)
- [Diagnostics](/cli/diagnostics)
- [Triggers](/cli/triggers)
- [Workbench](/cli/workbench)
- [Auth](/cli/auth)
- [Knowledge](/cli/knowledge)
- [Bento](/index)
- [Runtime Wrapper](/architecture/runtime-wrapper)
- [Skill Evolve](/architecture/skill-evolve)
-->

# MCP

The daemon exposes the knowledge base over MCP as a search tool (`ask_knowledge`) and as per-file resources.

## Tool: `ask_knowledge`

Agents call `ask_knowledge` mid-task to retrieve context on demand:

```json
{ "tool": "ask_knowledge", "query": "PR review standards" }
```

Returns `<context source="...">` sections ordered by relevance score. The tool only registers when `qmd` is present and the index is ready — if it's missing from the tool list, check `bento daemon logs` for `knowledge: index ready`.

## Resources

Each markdown file in `wiki/`, `blueprints/`, and `recipes/` is registered as an MCP resource at startup:

```
wiki://git-workflow
blueprint://feature-evaluation-rubric
recipe://add-agent
```

Any MCP client can browse and read these resources directly, without calling `ask_knowledge`.

## Automatic injection

During the `retrieve` phase of a pipeline run with a retrieving [method](/knowledge-base/modes) (`bm25`/`vector`), the daemon queries the index and injects matching chunks into the agent prompt.

Tune retrieval depth via [`knowledge.retrieval.topK`](/knowledge-base/config).
