Prerequisites
Before you begin, ensure you have:- Node.js 18+ installed
- An MCP-compatible client (Claude Desktop, Cursor, or VS Code)
- At least one MCP server to connect to
Quick Start
Get your MCP Gateway running in three simple steps.Install and run the gateway
Start the Portkey AI Gateway with MCP support:The gateway will start on
http://localhost:8787 with MCP endpoints available at /mcp/*.Configure your MCP servers
Create a configuration file
mcp-config.json to define your MCP servers:mcp-config.json
This configuration defines two MCP servers: one for filesystem access and one for GitHub integration. The gateway will manage authentication and routing to these servers.
Connect your MCP client
Configure your MCP client to use the gateway. For Claude Desktop, update your config file:macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows: %APPDATA%\Claude\claude_desktop_config.jsonclaude_desktop_config.json
Replace
your-gateway-token with a valid authentication token from your gateway instance.Verify the Setup
Once configured, verify that your MCP Gateway is working:-
Check gateway status: Visit the gateway console at
http://localhost:8787/public/ - Test server connection: The gateway will show connected MCP servers and their status
- Use tools in your client: Open Claude Desktop (or your MCP client) and try using the connected tools
View Logs and Monitoring
The gateway automatically logs all MCP interactions:- Active connections
- Tool call history
- Performance metrics
- Error logs
Example: Using the Gateway
Once connected, your MCP client can use tools through the gateway: In Claude Desktop:- Authenticated the request from [email protected]
- Checked that Alice has permission to use the filesystem tool
- Forwarded the request to the MCP server
- Logged the complete interaction
- Returned the response to Claude
Next Steps
Now that you have MCP Gateway running, explore advanced features:Authentication
Set up SSO and advanced auth methods
Access Control
Configure granular permissions
Production Deployment
Deploy to production environments
Monitoring
Set up monitoring and alerts
Troubleshooting
Gateway won't start
Gateway won't start
Check that:
- Port 8787 is not already in use
- Node.js 18+ is installed
- You have proper file permissions
Client can't connect to gateway
Client can't connect to gateway
Verify:
- Gateway is running and accessible
- Client configuration has correct URL
- Authentication token is valid
- Firewall rules allow connections
MCP servers not responding
MCP servers not responding
Check:
- Server commands are correct in config
- Required environment variables are set
- Servers have necessary permissions
- Gateway logs for specific error messages
Authentication failures
Authentication failures
Common issues:
- Token expired or invalid
- User doesn’t have required permissions
- Auth configuration mismatch
- Check gateway logs for specific auth errors
Need help? Join our Discord community or check the GitHub issues.