Skip to main content

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​

  1. Declare the server with the McpServer kind and the command that starts it:

    apiVersion: afe.dev/v1alpha1
    kind: McpServer
    metadata:
    name: websearch
    spec:
    transport: stdio
    command:
    - npx
    - -y
    - tavily-mcp
  2. Cite its tools in an agent as mcp:<server>.<tool> or mcp:<server>.*.

  3. Run the flow. The afe-mcp plugin 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 search once 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.