After securing your MCP proxy, the next step is controlling what each consumer can do. Role-based access control (RBAC) in Tyk MCP lets you give different agents different views of the same proxy, without creating separate proxy definitions. A policy bound to a key determines which tools that agent can invoke. This guide creates two roles on the Mock MCP Server:Documentation Index
Fetch the complete documentation index at: https://tyk.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
- Reader: can only call
get_users,get_posts,get_products, andget_analytics - Admin: can call all 15 tools
How it works
Tyk policies control consumer access at two levels relevant to this guide: Primitive access: restricts which specific tools a consumer can invoke. When a key’s policy includes an allowed list for tools, Tyk enforces it on bothtools/call (blocking disallowed tool invocations) and tools/list (filtering the response so the agent only sees tools it can use). The upstream server is never reached for blocked calls.
Proxy access: determines which MCP proxies the key can reach at all.
Both keys in this guide point at the same proxy URL. The difference in behavior comes entirely from the policies applied to each key.
For the complete policy reference, see MCP policies.
Before you begin
- The Mock MCP Server running on
http://localhost:7878. Set up in the quickstart. - An MCP proxy named Mock MCP Server with authentication enabled. See How to secure an MCP proxy.
- Node.js 18 or later (to run MCP Inspector)
- A Dashboard user account with policy management permissions
Instructions
Step 1: Create the Reader policy
- In the Tyk Dashboard sidebar, click Policies, then click Add Policy.
-
On the Access Rights tab, find Mock MCP Server in the API list and click it to add it.

-
Scroll to Primitive based access within the Mock MCP Server panel and add each permitted tool:
- Click Add, enter
get_users, set Type to Tool, and set the status to Allowed. Click Add. - Repeat for
get_posts,get_products, andget_analytics.
Once you add any tool with Allowed status, Tyk treats the list as an explicit allowlist: any tool not in the list is blocked for keys on this policy.
- Click Add, enter
-
Click the Configurations tab and set:
- Policy Name:
Reader - Policy State: Active
- Policy Name:
-
Click Create Policy.

Step 2: Create the Admin policy
The Admin policy grants unrestricted tool access. Omitting the Primitive based access entries means all tools are accessible.- Click Add Policy.
- On the Access Rights tab, add Mock MCP Server.
-
Click the Configurations tab and set:
- Policy Name:
Admin - Policy State: Active
- Policy Name:
- Click Create Policy.
Step 3: Issue role-specific keys
- In the Dashboard sidebar, click Keys, then Add Key.
-
Under Access rights, click Apply Policy and select Reader.

-
Click the Configurations tab and set an Alias such as
reader-agent.
- Click Create Key and copy the key.
-
Repeat steps 1–4 to issue a second key, selecting Admin as the policy and
admin-agentas the alias.
Step 4: Verify in MCP Inspector
-
Start MCP Inspector:
- Open the URL printed in your terminal.
Test the Reader key
-
Set Transport Type to
Streamable HTTP. -
Set URL to your MCP endpoint (find it under MCP Proxy URL in the proxy designer, then append
/mcp). -
Add a header:
Authorization=Bearer {reader-api-key}and click Connect. -
Click the Tools tab. You will see exactly four tools:
get_users,get_posts,get_products, andget_analytics. Tyk has filtered thetools/listresponse based on the Reader policy’s allowed list. -
Select
get_usersand click Run. It succeeds.
Test the Admin key
-
Click Disconnect. Replace the key in the
Authorizationheader with your Admin key and click Connect. - Click the Tools tab. All 15 Mock MCP Server tools appear. The Admin policy applies no tool restrictions.