What you will learn
- Say what an MCP proxy is and what an admin sets up on it
- Write the scope string for a proxy handle and an action
- Say where scopes are stored and which gateway policies enforce them
- Explain what happens to a tool that no scope covers
Before you start
- An AI request through the gateway Not started In progress Done
- JWT, JWKS, issuer, audience and scope Not started In progress Done
An agent that uses tools needs a way to find and call them. MCP (Model Context Protocol)A standard way for an AI application to discover and call tools that live on a server. Agents use it to reach outside systems.See it in the glossary is the standard way. A tool server can offer many MCP toolOne action that an MCP server offers, such as searching files. An MCP proxy lists the tools of its server and can tie each tool to scopes.See it in the glossary, and you may want one agent to use some of them and not others. Agent Manager solves that with an MCP proxyAgent Manager's managed front door for an upstream MCP server. Agents call the proxy through the gateway, which checks identity and which tools they may use.Analogy:Hotel reception for a conference centre. Guests get keys only for the rooms their badge allows.See it in the glossary and scopes.
The admin’s side
Read the tool list
The admin gives AMS the address of an MCP server. AMS checks the address against its guard for unsafe targets, then speaks MCP to the server and asks what it offers: tools, and also prompts and resources. The reply lists the tools the admin can later tie to scopes.
Create the proxy
The proxy handle is a kebab-case name. Each environment the proxy serves gets an endpoint with its own security choice, either an API key or agent identity. AMS saves the proxy and then deploys it to the gateway mapped to each environment.
Define a scope that maps to tools
A scope is a named permission, such as
read, that unlocks certain tools. Like wristbands at a festival, each colour opens different doors. In a token the scope reads<proxy handle>:<action>, for exampledocs-search:read.The scope is stored in AMS's own database
The scope lives in the table
mcp_proxy_scopesin AMS’s database. It is not stored in the identity provider. The gateway rules and the scope lists that agents later receive are both read back from this table.The proxy is registered as a resource server
In the background, AMS tells the ThunderID of each environment where the proxy uses agent identity that the proxy exists as a Resource serverIn OAuth, what a token is meant for and the owner of a set of scopes. Agent Manager's API is urn:wso2:amp. An MCP proxy using agent identity is one too.See it in the glossary and which scopes it offers. Its identifier is the proxy’s public URL. Roles that grant these scopes to agents are created separately.
AMS writes the gateway rules
For each environment that uses agent identity, AMS builds the deployment and adds the policy
mcp-auth, and alsomcp-authzonce at least one tool is covered by a scope.mcp-authnames the key manager for ThunderID tokens and advertises the scopes a client should ask for.mcp-authzgets one rule per tool, listing the scopes that cover that tool.
How the gateway gets the rules
The gateway controller dialled out to AMS earlier and holds a WebSocket open. It receives an mcpproxy.deployed event on that line, fetches the proxy from AMS’s internal API, and stores it. Then the router and the policy engine, which keep xDS connections open to the controller, receive the new routes and policy chains. The router listens for proxy traffic on port 22893 and serves the MCP route at /mcp.
The call
The agent attaches Authorization: Bearer <token> to each MCP request. It calls the proxy’s public gateway address, ending in /mcp, and not the address inside the cluster, because that public address doubles as the OAuth resource identifier. The gateway fetches the identity provider’s public keys, checks the token, and then looks at the tool being called.
Your turn
Under Try it, play flow F10 and stop at the step where AMS turns scopes into gateway rules. Write down which policies appear and what each one gets. Then open Who can call what and search for mcp-proxies: these are the routes that manage MCP proxies, and each needs an amp: permission. The per tool scopes of a proxy, such as docs-search:read, are a different catalog, and that lens does not simulate them. Finish with the matcher.
Recap
- An MCP proxy is the managed front door of an MCP server, deployed to the gateway.
- A scope is
<proxy handle>:<action>and lists the tools it allows. It is stored inmcp_proxy_scopesin AMS’s own database. - AMS registers the proxy as a resource server in the ThunderID of each environment that uses agent identity, and writes the gateway policies
mcp-authandmcp-authz. - The agent sends its token to the proxy’s public gateway address.
- A tool that no scope covers gets no rule, so nothing restricts it beyond the token check.
Wrap up
Recap
Tick each one when you could explain it to a colleague.
Finished?
Chapter complete. Every lesson in this chapter is done.
Progress cannot be saved in this browser, so it will be forgotten when you leave this page.
Quick check
Spotted something wrong or unclear in this lesson? Report an inaccuracy (opens GitHub in a new tab)