Agent Wranglers

AI agents and models Required

Accept only tokens issued for your MCP server

An MCP server you run accepts only access tokens issued for it. It never passes a client's token on to other APIs.

How to do it

Check the token's audience and issuer on every request, as the MCP authorization specification requires. Get separate tokens for the APIs behind the server. Ask each user for consent per client before you connect them to another service.

How to check

Send the server a valid token that was issued for a different API. It answers 401.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers security testing playbook: https://agentwranglers.se/playbook/adversarial-testing/ai-agents-and-models/mcp-token-audience.