{"slug":"operations/MCP-SERVERS-DEPLOYMENT","title":"MCP Servers Deployment Guide","section":"operations","sectionLabel":"Operations","status":"unclassified","type":"document","path":"operations/MCP-SERVERS-DEPLOYMENT.mdx","bytes":6744,"description":null,"updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\nAll MCP servers are deployed to Cloudflare Workers with full dependency management, rate limiting, caching, and observability.\n\n## Exposed MCP Servers\n\n### 1. Claude (Anthropic)\n\n- **Endpoint**: `https://mcp-claude.integratewise.workers.dev`\n- **WebSocket**: `wss://mcp-claude.integratewise.workers.dev/ws`\n- **Auth**: API Key\n- **Dependencies**:\n  - `ANTHROPIC_API_KEY` (required)\n  - `CLAUDE_MODEL` (optional, defaults to claude-3-5-sonnet-20241022)\n\n### 2. OpenAI (GPT-4, GPT-4o)\n\n- **Endpoint**: `https://mcp-openai.integratewise.workers.dev`\n- **WebSocket**: `wss://mcp-openai.integratewise.workers.dev/ws`\n- **Auth**: API Key\n- **Dependencies**:\n  - `OPENAI_API_KEY` (required)\n  - `OPENAI_ORG_ID` (optional)\n\n### 3. GitHub\n\n- **Endpoint**: `https://mcp-github.integratewise.workers.dev`\n- **WebSocket**: `wss://mcp-github.integratewise.workers.dev/ws`\n- **Auth**: Bearer Token\n- **Dependencies**:\n  - `GITHUB_TOKEN` (required)\n  - `GITHUB_API_VERSION` (optional)\n\n### 4. Slack\n\n- **Endpoint**: `https://mcp-slack.integratewise.workers.dev`\n- **WebSocket**: `wss://mcp-slack.integratewise.workers.dev/ws`\n- **Auth**: OAuth2\n- **Dependencies**:\n  - `SLACK_BOT_TOKEN` (required)\n  - `SLACK_SIGNING_SECRET` (required)\n  - `SLACK_APP_ID` (optional)\n\n### 5. PostgreSQL\n\n- **Endpoint**: `https://mcp-postgres.integratewise.workers.dev`\n- **WebSocket**: `wss://mcp-postgres.integratewise.workers.dev/ws`\n- **Auth**: Bearer Token\n- **Dependencies**:\n  - `DATABASE_URL` (required)\n  - `DATABASE_SSL` (optional, default: false)\n  - `DATABASE_POOL_SIZE` (optional, default: 20)\n\n### 6. Brave Search\n\n- **Endpoint**: `https://mcp-brave-search.integratewise.workers.dev`\n- **WebSocket**: `wss://mcp-brave-search.integratewise.workers.dev/ws`\n- **Auth**: API Key\n- **Dependencies**:\n  - `BRAVE_SEARCH_API_KEY` (required)\n\n### 7. Playwright\n\n- **Endpoint**: `https://mcp-playwright.integratewise.workers.dev`\n- **WebSocket**: `wss://mcp-playwright.integratewise.workers.dev/ws`\n- **Auth**: None\n- **Dependencies**:\n  - `PLAYWRIGHT_HEADLESS` (optional, default: true)\n  - `PLAYWRIGHT_TIMEOUT` (optional, default: 30000ms)\n\n### 8. Sentry\n\n- **Endpoint**: `https://mcp-sentry.integratewise.workers.dev`\n- **WebSocket**: `wss://mcp-sentry.integratewise.workers.dev/ws`\n- **Auth**: Bearer Token\n- **Dependencies**:\n  - `SENTRY_AUTH_TOKEN` (required)\n  - `SENTRY_ORG_SLUG` (required)\n  - `SENTRY_PROJECT_SLUG` (optional)\n\n### 9. Grafana\n\n- **Endpoint**: `https://mcp-grafana.integratewise.workers.dev`\n- **WebSocket**: `wss://mcp-grafana.integratewise.workers.dev/ws`\n- **Auth**: Bearer Token\n- **Dependencies**:\n  - `GRAFANA_URL` (required)\n  - `GRAFANA_API_TOKEN` (required)\n\n## Deployment Steps\n\n### 1. Set up Cloudflare Account\n\n```bash\nnpm install -g wrangler\nwrangler login\n```\n\n### 2. Configure Secrets\n\n```bash\n# In apps/mcp-servers/\n\n# Claude\nwrangler secret put ANTHROPIC_API_KEY\n\n# OpenAI\nwrangler secret put OPENAI_API_KEY\n\n# GitHub\nwrangler secret put GITHUB_TOKEN\n\n# Slack\nwrangler secret put SLACK_BOT_TOKEN\nwrangler secret put SLACK_SIGNING_SECRET\n\n# PostgreSQL\nwrangler secret put DATABASE_URL\n\n# Brave Search\nwrangler secret put BRAVE_SEARCH_API_KEY\n\n# Sentry\nwrangler secret put SENTRY_AUTH_TOKEN\n\n# Grafana\nwrangler secret put GRAFANA_API_TOKEN\n```\n\n### 3. Deploy to Production\n\n```bash\ncd apps/mcp-servers\nwrangler deploy --env production\n```\n\n### 4. Deploy to Staging\n\n```bash\nwrangler deploy --env staging\n```\n\n### 5. Verify Deployment\n\n```bash\n# Check health\ncurl https://mcp-claude.integratewise.workers.dev/health\n\n# Get registry\ncurl https://mcp-claude.integratewise.workers.dev/registry\n```\n\n## Local Development\n\n### 1. Install Dependencies\n\n```bash\ncd apps/mcp-servers\nnpm install\n```\n\n### 2. Set up .env.local\n\n```bash\nANTHROPIC_API_KEY=sk-ant-...\nOPENAI_API_KEY=sk-proj-...\nGITHUB_TOKEN=ghp_...\nSLACK_BOT_TOKEN=xoxb-...\nSLACK_SIGNING_SECRET=xxxx...\nDATABASE_URL=postgresql://...\nBRAVE_SEARCH_API_KEY=xxx...\nSENTRY_AUTH_TOKEN=sntrys_...\nGRAFANA_API_TOKEN=eyJrIjoixxxx\n```\n\n### 3. Run Locally\n\n```bash\nwrangler dev\n```\n\nServer will be available at `http://localhost:8787`\n\n## Integration with Platform\n\n### 1. Add MCP Pool to Platform\n\n```typescript\n\n// Get all active servers\nconst servers = getActiveMCPServers();\n\n// Initialize MCP client\nconst mcpClient = new MCPClient({\n  servers: servers.map((server) => ({\n    id: server.id,\n    endpoint: server.endpoint,\n    wsEndpoint: server.wsEndpoint,\n  })),\n});\n```\n\n### 2. Validate Environment Variables\n\n```typescript\n\n// Check if a specific server can connect\nconst validation = validateServerEnvVars(\"claude\", process.env);\nif (!validation.valid) {\n  console.error(\"Missing env vars:\", validation.missing);\n}\n\n// Get all required vars across all servers\nconst required = getAllRequiredEnvVars();\n```\n\n### 3. Use MCP Servers in Components\n\n```typescript\n'use client'\n\n\n  const { servers, isLoading, error } = useMCPServers()\n\n  if (isLoading) return <div>Loading MCP servers...</div>\n  if (error) return <div>Error: {error.message}</div>\n\n  return (\n    <div>\n      {servers.map(server => (\n        <div key={server.id}>\n          <h3>{server.name}</h3>\n          <p>Status: {server.status}</p>\n          <p>Endpoint: {server.endpoint}</p>\n        </div>\n      ))}\n    </div>\n  )\n}\n```\n\n## Monitoring\n\n### Cloudflare Analytics Engine\n\nTrack:\n\n- Request count per server\n- Error rates\n- Response times\n- Cache hit rates\n\n### Logs\n\n```bash\n# Tail logs from production\nwrangler tail --env production\n\n# Tail logs from staging\nwrangler tail --env staging\n```\n\n## Troubleshooting\n\n### 1. Authentication Failures\n\n```bash\n# Check token validity\ncurl -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  https://mcp-claude.integratewise.workers.dev/health\n```\n\n### 2. Rate Limiting\n\nCheck client IP in `CF-Connecting-IP` header. Rate limit is 1000 requests/minute per IP.\n\n### 3. Dependency Validation\n\n```typescript\n\nconst result = validateServerEnvVars(\"claude\", env);\nconsole.log(\"Missing:\", result.missing);\nconsole.log(\"Errors:\", result.errors);\n```\n\n## Production Checklist\n\n- [ ] All secrets configured in Cloudflare\n- [ ] Rate limiting enabled\n- [ ] CORS properly configured\n- [ ] Health checks passing\n- [ ] Analytics/monitoring set up\n- [ ] Error alerting configured\n- [ ] Documentation updated\n- [ ] Team trained on MCP servers\n\n## Support\n\nFor issues or questions about MCP servers, contact the IntegrateWise platform team.\n"}