MCP tools
Goal: declare a Model Context Protocol server and cite its tools in an agent.
Prerequisites
- The command that starts the MCP server (for example
npx -y tavily-mcp), installable on the worker.
Steps
-
Declare the server with the
McpServerkind and the command that starts it:apiVersion: afe.dev/v1alpha1kind: McpServermetadata:name: websearchspec:transport: stdiocommand:- npx- -y- tavily-mcp -
Cite its tools in an agent as
mcp:<server>.<tool>ormcp:<server>.*. -
Run the flow. The
afe-mcpplugin connects once per process and exposes the server's tools.
Notes
A server that does not answer fails only the operation that needs it, never the engine.
Troubleshooting
unknown MCP server 'websearch'
No McpServer manifest named websearch is in the configuration. Check the name in the agent's
tools list against the McpServer you declared.
MCP server 'websearch' has no tool 'search' (known: fetch, extract)
The tool name after the dot does not match a tool the server reports. The error lists the tools
the server actually has. Cite one of those, or use mcp:websearch.* for all of them.
unknown tool 'websearch'
The reference is neither a built-in name nor an mcp: tool. Use the full form,
mcp:<server>.<tool> or mcp:<server>.*.
See also
- McpServer
- Built-in tools
- The S4 scenario:
a research flow that calls
searchonce per sub-question. Run it from the repository root (uv run afe run ...), because the test MCP server's command is a path relative to the root.