MCP servers
Raw can use tools from Model Context Protocol servers. You define each server once in your config file. An agent then selects the individual tools it needs.
Define servers
Section titled “Define servers”Servers live in the mcp.servers section of the same config file as your models and agents. Raw supports two transports.
| Transport | Required fields | Optional fields |
|---|---|---|
stdio |
command |
args, env, timeout_ms |
streamable-http |
url |
headers, timeout_ms |
{ "default_agent": "research", "models": { "local": { "provider": "ollama", "method": "openai-chat-completions", "model_id": "YOUR_INSTALLED_MODEL" } }, "mcp": { "servers": { "search": { "transport": "stdio", "command": "my-search-server", "args": [], "env": {} }, "vision": { "transport": "streamable-http", "url": "https://example.test/mcp", "headers": {} } } }, "agents": { "research": { "model": "local", "tools": { "use": [ "builtin/read_file", "mcp/search/web_search", "mcp/vision/describe" ] } } }}A server definition does nothing until an agent selects one of its tools. Raw does not start unselected servers, and it does not add their tools to the model’s context.
Select tools
Section titled “Select tools”Select each tool by its original name with mcp/<server>/<tool> in tools.use. The wildcard * is not accepted as a selection. A selected server that is not defined under mcp.servers fails before any model request is sent.
If a selected server cannot start, does not list a selected tool, or a selected tool’s schema cannot be used, Raw skips that server or tool. It prints a warning on stderr and starts the session with the remaining tools. Servers that are not selected are never started.
Policy rules match the same identity. For example, mcp/search/* is a valid match in tools.rules. See Tools.
What the model receives
Section titled “What the model receives”- Text and JSON results come back as typed results.
- Image blocks are passed to models that accept them. A text-only model can instead call a vision server that returns a text description.
- Raw does not fetch URLs that a tool returns as resource links. It reports them as links.
- MCP tools do not receive variable references or interpolation in their
envorheaders. The values you write are used literally.
Each server has a timeout. Set timeout_ms on the server, or leave it out to use the agent’s request_timeout_ms. The timeout covers connecting, listing tools, and each tool call. A server that sends progress notifications during a call restarts the timer, so a long call that reports progress is not cut off.
Raw closes its MCP clients when a session ends. Any server process Raw started is stopped at the same time.
Display
Section titled “Display”Each selected tool gets a title and a kind from the server’s tool annotations. To override a field, add a display entry under the server, keyed by the tool’s original name:
"search": { "transport": "stdio", "command": "my-search-server", "display": { "web_search": { "title": "Search the web", "kind": "search", "summary": "{query}", "result": "markdown" } }}An unknown field or value in display fails the configuration check. See the tool contract for the display fields.
Add panels to a server tool
Section titled “Add panels to a server tool”A tool can show a live side panel. For an MCP tool, you declare the panel in the server definition. The tool field is the tool’s original name on the server.
"search": { "transport": "stdio", "command": "my-search-server", "panels": [{ "tool": "web_search", "id": "results", "title": "Results" }]}Each tool can declare up to four panels. A server can also send panel updates in its tool results without a declaration. The Tool contract describes the panel format.
Use a server from a package
Section titled “Use a server from a package”A package can export an MCP server definition. You bind it to a local name in your config, and the local name is what you select in tools.use.
"mcp": { "servers": { "web": { "from": "pkg/kit/mcp/search", "inputs": { "endpoint": "https://recipient.example/mcp" } } }}The agent then selects mcp/web/query. See Packages.
Set up a server
Section titled “Set up a server”-
Install the server software and confirm its command runs on your machine.
-
Add the server under
mcp.serversin your config file. Use the server’s own credentials inenvorheaders. Those values are stored in the config file as written. -
Select the tools you want in an agent’s
tools.use. -
Run a request that needs the tool. Check the result, because a successful config check does not prove the server works.
Related
Section titled “Related”- Tools covers the built-in tools and the tool selection rules.
- Configuration reference lists every config field.