Agent Configuration
Configure both STDIO and HTTP MCP servers for AI agents.
Overview
MCP Gatekeeper allows you to configure MCP servers for multiple AI agents including:
- Windsurf: AI-powered code editor
- Claude Desktop: Anthropic's desktop application
- Amazon Q: AWS's AI coding assistant
- Gemini CLI: Google's command-line AI tool
- GitHub Copilot: Microsoft's AI pair programmer
Adding Servers to Agents
From the Web UI
- Navigate to Agents page
- Select an agent from the list
- Click Add Server button
- Select a server from the unified list:
- STDIO servers (blue badge) - Installed npm packages
- HTTP servers (purple badge) - Remote HTTP servers
- For STDIO servers:
- Enter a server name
- Configure arguments (optional)
- Add environment variables (optional)
- For HTTP servers:
- Server name is automatically set
- No additional configuration needed
- Click Add Server
Server Selection UI
The server selection dialog shows both types in a single list:
[STDIO] @modelcontextprotocol/server-github v1.0.0
[STDIO] @modelcontextprotocol/server-filesystem v2.1.0
[HTTP] github ● Active https://api.githubcopilot.com/...
Configuration Types
STDIO Server Configuration
For locally installed packages:
{
"mcpServers": {
"my-filesystem-server": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem"],
"env": {
"ALLOWED_DIRECTORIES": "/Users/username/projects",
"MCPGK_AGENT_TYPE": "windsurf"
}
}
}
}
Key Fields:
command: Executable commandargs: Command-line argumentsenv: Environment variables (including auto-injectedMCPGK_AGENT_TYPE)
HTTP Server Configuration
For remote HTTP servers:
Windsurf (uses serverUrl):
{
"mcpServers": {
"github": {
"serverUrl": "http://127.0.0.1:8000/proxy/windsurf/github"
}
}
}
Gemini CLI (uses httpUrl):
{
"mcpServers": {
"github": {
"httpUrl": "http://127.0.0.1:8000/proxy/gemini_cli/github"
}
}
}
Amazon Q, Claude, GitHub Copilot (use url):
{
"mcpServers": {
"github": {
"url": "http://127.0.0.1:8000/proxy/amazon_q/github"
}
}
}
Key Points:
- Proxy URL automatically configured with agent type in path
- Headers stored securely in database
- Agent type extracted from URL path for tracking
- URL key varies by agent:
serverUrl(Windsurf),httpUrl(Gemini CLI),url(others) - No environment variables needed for HTTP servers
Agent-Specific Configurations
Windsurf
Config Location: ~/.windsurf/settings.json
{
"mcpServers": {
"filesystem": { /* STDIO config */ },
"github-api": { /* HTTP config */ }
}
}
Amazon Q
Config Location: ~/.aws/amazonq/agents/default.json
Same format as Windsurf.
Gemini CLI
Config Location: ~/.gemini/settings.json
Important: Uses httpUrl instead of url for HTTP servers.
Claude Desktop
Config Location (macOS): ~/Library/Application Support/Claude/claude_desktop_config.json
Same format as Windsurf.
Agent Type Tracking
STDIO servers include MCPGK_AGENT_TYPE environment variable:
{
"env": {
"MCPGK_AGENT_TYPE": "windsurf"
}
}
HTTP servers include agent type in the proxy URL path:
http://127.0.0.1:8000/proxy/{agent_type}/{server_name}
This enables:
- Per-agent metrics tracking
- Agent-specific monitoring
- Usage analytics by agent type
Removing Servers
From the Web UI
- Navigate to Agents page
- Select the agent
- Find the server in the list
- Click Remove button
- Confirm removal
This updates the agent's configuration file automatically.
Configuration Files
MCP Gatekeeper automatically detects and manages these configuration files:
| Agent | Config Path |
|---|---|
| Windsurf | ~/.windsurf/settings.json |
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)%APPDATA%\Claude\claude_desktop_config.json (Windows) |
| Amazon Q | ~/.aws/amazonq/agents/default.json |
| Gemini CLI | ~/.gemini/settings.json |
| GitHub Copilot | ~/.copilot/config.json |
Best Practices
- Use Descriptive Names: Name servers clearly (e.g.,
github-work,filesystem-projects) - Test Before Adding: Verify servers work before adding to agents
- Environment Variables: Use env vars for configuration (API keys, paths)
- Keep Updated: Regularly update STDIO packages for security
- Monitor Usage: Check metrics to see which servers are used most
- Backup Configs: MCP Gatekeeper modifies agent configs - keep backups
Troubleshooting
Server Not Appearing
Problem: Added server doesn't appear in agent
Solutions:
- Restart the agent application
- Check agent config file was updated
- Verify server is installed/configured
- Check MCP Gatekeeper logs
Permission Errors
Problem: Cannot write to config file
Solutions:
- Check file permissions on config directory
- Run MCP Gatekeeper with appropriate permissions
- Manually edit config file if needed
Wrong URL Format
Problem: HTTP server not working in Gemini CLI
Solution: Gemini CLI uses httpUrl field instead of url
Next Steps
- STDIO Server Packages - Install STDIO packages
- HTTP Servers - Configure HTTP servers
- Server Activity - Monitor server usage
- Metrics Collection - Track performance