- AI Gateway
- 1.2.0
- Gateway Artifacts
MCP proxy¶
An MCP Proxy routes Model Context Protocol traffic to MCP servers. MCP is a protocol that enables AI assistants to interact with external tools and data sources. With MCP Proxies, you can:
- Expose MCP servers through a centralized gateway
- Apply authentication and access control to MCP traffic
- Manage multiple MCP servers from a single control plane
This page takes you through deploying a proxy and routing your first MCP traffic through it.
Prerequisites¶
- A running AI Gateway, with
ADMIN_USERNAMEandADMIN_PASSWORDexported in the shell you run these commands from. See Install the gateway. - The sample MCP server below joins the gateway's Compose network as
ai-gateway_gateway-network, so start the gateway withdocker compose -p ai-gateway up. If you started it under a different project name, use that project's network name in thedocker runcommand.
The curl commands on this page pipe their YAML payload in through a shell heredoc (--data-binary @- <<'EOF'), which PowerShell doesn't support. On Windows, either run them from Git Bash or WSL, or save the YAML between the EOF markers to a file and post that file explicitly — note the .exe, since curl is an alias for Invoke-WebRequest in Windows PowerShell:
curl.exe -X POST http://localhost:9090/api/management/v1/mcp-proxies `
-H "Content-Type: application/yaml" `
-u "${env:ADMIN_USERNAME}:${env:ADMIN_PASSWORD}" `
--data-binary "@mcp-proxy.yaml"
Deploy an MCP proxy configuration¶
Start the sample MCP server
docker run -p 3001:3001 --name everything --network ai-gateway_gateway-network rakhitharr/mcp-everything:v3
Run the following command to deploy the MCP proxy.
curl -X POST http://localhost:9090/api/management/v1/mcp-proxies \
-H "Content-Type: application/yaml" \
-u "$ADMIN_USERNAME:$ADMIN_PASSWORD" \
--data-binary @- <<'EOF'
apiVersion: gateway.api-platform.wso2.com/v1
kind: Mcp
metadata:
name: everything-mcp-v1.0
annotations:
"gateway.api-platform.wso2.com/project-id": "default"
spec:
displayName: Everything
version: v1.0
context: /everything
specVersion: "2025-06-18"
upstream:
url: http://everything:3001
tools: []
resources: []
prompts: []
EOF
View the MCP proxy in AI Workspace¶
The gateway syncs the artifacts you deploy on it up to AI Workspace, the control plane for AI traffic across your organization. The everything-mcp-v1.0 proxy you deployed above appears there without being re-declared, in the default project named in its project-id annotation. See Manage Gateway-deployed AI artifacts in AI Workspace.
Policies¶
The policies that authenticate callers, authorize individual tools, restrict and rename the tool list, and rate limit MCP calls are covered in MCP governance.
Next steps¶
- Stop the sample MCP backend when you're done with it:
docker stop everythinganddocker rm everything. - Govern this proxy alongside every other AI artifact you run: AI Workspace overview
Related guides¶
- Build an AI agent that uses aggregated MCP tools from multiple APIs — connects an agent to three independently governed MCP servers through the gateway.
- Convert a REST API into an MCP tool for Claude Desktop — exposes a REST API as a governed MCP server and enforces OAuth2 at the gateway.
- Find and connect to an enterprise MCP server from the MCP Hub — discovers MCP servers in the MCP Hub and connects a client to one.