For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

Add MCP servers

Page as Markdown

Give an agent access to the tools that are exposed by an MCP server.

Before you begin

  1. Follow the Get started guide to set up agentregistry and start the agentregistry daemon.
  2. Create an agent.
  3. Create an MCP server.
  4. Publish an MCP server.

Add an MCP server to the agent

MCP servers are referenced in the agent manifest in the spec.mcpServers block. Each MCP server that you reference in that block must be published in the registry catalog.

  1. List the MCP servers that are published in the registry catalog.

    arctl get mcps

    Example output:

    NAME    TAG      DESCRIPTION
    mymcp   latest   mymcp MCP server
    
  2. Add an mcpServers block to your agent definition (agent.yaml) and reference the MCP server that you want your agent to have access to.

    cat > myagent/agent.yaml <<EOF
    apiVersion: ar.dev/v1alpha1
    kind: Agent
    metadata:
      name: myagent
    spec:
      source:
        image: ghcr.io/myagent:latest
      description: myagent agent
      mcpServers:
        - kind: MCPServer
          name: mymcp
          tag: latest
    EOF
    FieldDescription
    mcpServers[].kindMust be MCPServer.
    mcpServers[].nameName of the MCP server in agentregistry.
    mcpServers[].tagTag to use. If omitted, the latest tag is resolved at deploy time.

Note

MCP servers are referenced in the agent manifest and resolved from the registry at deploy time. You cannot locally test access to the MCP server tools by using the arctl run agent command. To test access to the tools, you must publish the agent in the registry catalog and deploy the agent to your runtime.

Next