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 AccessPolicy to control which kagent agent deployments can invoke MCP server tools.
Before you begin
Deploy an agent and MCP server to Solo Enterprise for kagent.
Restrict MCP tool access
By default, any deployed agent can invoke all tools on an MCP server. To restrict an agent to access only specific tools at runtime, create an AccessPolicy resource. When applied, Solo Enterprise for agentregistry fans the policy out to kagent as a Kubernetes AccessPolicy CRD, which agentgateway enforces at the waypoint proxy level.
Note
AccessPolicy enforcement applies only to local MCPServer resources. RemoteMCPServer targets are not supported on the Solo Enterprise for kagent runtime. Access to remote MCP servers cannot be restricted through this policy mechanism.
Create an AccessPolicy that allows your agent to access specific MCP server tools. The following example allows the
myagentdeployment to access theexample_echotool of themymcpMCP server. Themymcpserver comes with two tools,example_echoandexample_sum. Becauseexample_sumis not listed, access to it is denied.arctl apply -f - <<EOF apiVersion: ar.dev/v1alpha1 kind: AccessPolicy metadata: name: myagent-mymcp-echo spec: description: Allow myagent to invoke example_echo on mymcp. principals: - kind: Deployment name: myagent rules: - actions: - runtime:invoke resources: - kind: server name: mymcp subresources: - tool/example_echo EOFExample output:
✓ AccessPolicy/myagent-mymcp-echo createdField Description spec.principals[].kindSet to Deploymentto identify the calling agent deployment.spec.principals[].nameThe name of the agent deployment whose outbound access this policy grants. spec.rules[].actionsThe operations to authorize. Set to runtime:invoketo allow tool calls.spec.rules[].resources[].kindThe target type. Use serverfor catalog MCP servers.spec.rules[].resources[].nameThe name of the target MCP server. Use "*"to match all servers.spec.rules[].resources[].subresourcesOptional. A list of specific tool names the agent may call, prefixed with tool/. Omit to allow all tools on the target server.Verify that the policy was propagated to kagent as a Kubernetes AccessPolicy CRD. Solo Enterprise for agentregistry names each propagated CRD using the pattern
ar-<policyName>-r<ruleIndex>-res<resourceIndex>.kubectl -n kagent get accesspolicy ar-myagent-mymcp-echo-r0-res0 -o yamlNote
The CRD may take a few seconds to appear. Fan-out runs asynchronously after the policy is committed.
Open the Instances view in the UI and select the
myagentagent.In the Agent Details card, click Open Chat.
Chat with the agent and ask it what it can do for you. Then, hit Enter and wait for the agent to reply. Verify that the agent lists the
example_echotool from the MCP server. Theexample_sumMCP tool is not shown, because you allowed access to onlyexample_echo.
Other configurations
Review other common configuration examples.
Allow all tools on a server
Allow the myagent agent to invoke all tools on the mymcp MCP server, but restrict access to other MCP servers.
arctl apply -f- <<EOF
apiVersion: ar.dev/v1alpha1
kind: AccessPolicy
metadata:
name: myagent-mymcp-all
spec:
description: Allow myagent to invoke all tools on mymcp.
principals:
- kind: Deployment
name: myagent
rules:
- actions:
- runtime:invoke
resources:
- kind: server
name: mymcp
EOFAllow all tools on all servers
Allow the myagent agent to invoke all tools on all MCP servers.
arctl apply -f- <<EOF
apiVersion: ar.dev/v1alpha1
kind: AccessPolicy
metadata:
name: myagent-all-servers
spec:
description: Allow myagent to invoke all tools on all MCP servers.
principals:
- kind: Deployment
name: myagent
rules:
- actions:
- runtime:invoke
resources:
- kind: server
name: "*"
EOF