For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Agent to MCP server
Use RuntimeAccessPolicy to control which AgentCore agent deployments can invoke MCP server tools.
Before you begin
Set up the AgentCore runtime, including the managed gateway and gatewayRef. Specifically, confirm that both of the following are true before you continue:
- The gateway is in
phase=ready:arctl get gateways - Your Runtime has
spec.config.gatewayRefset. Without this field, the registry does not route agent traffic through the gateway andRuntimeAccessPolicyis not enforced:If the field is missing, follow Step 3.4 of the runtime setup guide to add it.arctl get runtime agentcore -o yaml | grep gatewayRef
Note
Agent-to-MCP traffic is routed through the managed gateway only at deploy time. If you deployed agents before the gateway was ready or before gatewayRef was set, redeploy them to enable enforcement:
arctl apply -f your-agent.yamlRestrict tool access for harness agents
By default, a harness agent can invoke all tools on a catalog MCP server. To restrict which tools the agent can call at runtime, create a RuntimeAccessPolicy resource. The policy is enforced by the managed gateway that you configured on your AgentCore runtime.
Deploy a harness agent. The harness agent bundles the Solo.io docs MCP server. In the following steps, you restrict access to only the
searchtool of that MCP server.Create a RuntimeAccessPolicy that allows the harness agent to access specific MCP server tools. The following example allows the
hello-agentdeployment to access thesearchtool of thesolo-docsMCP server. Thesolo-docsserver comes with three tools,search,get_chunks, andget_full_page. Becauseget_chunksandget_full_pageare not listed, access to these tools is denied.arctl apply -f- <<EOF apiVersion: ar.dev/v1alpha1 kind: RuntimeAccessPolicy metadata: name: hello-agent-solo-docs-search spec: runtimeRef: name: agentcore rules: - from: - kind: Deployment name: hello-agent to: - kind: MCPServer name: solo-docs mcpTools: - search EOFExample output:
✓ RuntimeAccessPolicy/hello-agent-solo-docs-search createdField Description spec.runtimeRef.nameRequired. The name of the Runtime that this policy applies to. Note that you cannot change the runtime reference after you create the resource. To update the reference, you must delete and re-create the Runtime resource. spec.rules[].from[].kindSet to Deploymentto identify the calling agent deployment.spec.rules[].from[].nameThe name of the agent deployment whose outbound access this rule grants. spec.rules[].to[].kindThe target type. Use MCPServerfor catalog MCP servers.spec.rules[].to[].nameThe name of the target MCP server. Use "*"to match all servers.spec.rules[].to[].mcpToolsOptional. A list of specific tool names the agent may call. Omit to allow all tools on the target server. Open the Instances view in the UI and select your agent.
In the Agent Details card, click Open Chat.
Chat with the agent and ask it what MCP tools it has access to. Then, hit Enter and wait for the agent to reply. Verify that the agent only lists the tools that you explicitly allowed in your policy.