How srinathpasupathi/zoho-mcp-server works
Project type and purpose
• This is a middleware “MCP” (Model-Context Protocol) server that sits between downstream clients (e.g., Claude Desktop, Cursor, Windsurf, or the built-in Inspector UI) and the upstream Sentry REST API.
• It supports two transports:
a) HTTP+SSE exposed via a Cloudflare Worker (for remote hosting)
b) STDIO (for local testing and CLI integration via the mcp-remote tool)
File structure
• Top-level deployment artifacts:
• worker/ – Cloudflare Worker entrypoints (auth, app, SSE)
• src/mcp/ – Core MCP server logic, tool definitions, transport adapters (cloudflare-worker vs stdio)
• src/evals/ – Individual “tool” implementations (list-projects, create-team, etc.)
• src/lib/sentry-api/ – Sentry REST client, schemas, utilities
• src/lib/oauth.ts – OAuth handshake with Sentry
• src/web/ + index.html – Inspector UI (React + Vite) for testing tools over SSE
• Configs: wrangler.jsonc, vite.config.ts, multiple tsconfig.* for different targets, Dockerfile
README for additional insights
• Describes two modes (remote vs stdio), OAuth scopes, local-dev setup, how to launch the Inspector, how to configure Claude Desktop.
• No persistent datastore—pure proxy + tool-invocation layer.
Main components & relationships
A. Clients
1. Inspector UI (browser React app served via Vite or static from Worker)
2. Third-party MCP clients (Claude Desktop, Cursor, Windsurf) using STDIO or HTTP+SSE
3. CLI shim – mcp-remote (local Node script that proxies SSE over STDIO)
B. Transport layer
1. Cloudflare Worker endpoint (/sse) – handles inbound SSE connections, routes to MCP core
2. STDIO transport – local Node process for testing, communicates via stdin/stdout
C. Core MCP server (in src/mcp/)
1. server.ts – central dispatcher for MCP protocol messages
2. toolDefinitions.ts – registers available tools, input/output schemas
3. transports/ – adapter implementations for Cloudflare Worker vs stdio
D. Tool implementations (src/evals/)
• Each file implements one REST call: list-projects, create-team, get-issue, etc.
• Utilities in src/evals/utils.ts factor out common request/response logic
E. Sentry integration (src/lib/sentry-api/)
• client.ts + schema.ts + utils.ts – wraps HTTP calls to Sentry’s API
• oauth.ts – performs OAuth handshake, token refresh
F. External dependency
• Sentry API (REST endpoint)
Data / control flow:
1. Client → (HTTP+SSE or STDIO) → MCP transport adapter
2. Transport → MCP core dispatcher → selects tool handler
3. Tool handler (eval module) → invokes Sentry API client → receives data
4. MCP core → streams events/results back over SSE or STDIO → Client
Architectural patterns & design principles
• Transport abstraction: same core logic works over HTTP (Worker) or STDIO
• Plugin-style tools: each API operation is a separate “eval” module, auto-discovered by toolDefinitions.ts
• Event-driven SSE protocol for streaming responses
• OAuth 2.0 authorization layer separate from business logic
• CI/CD via GitHub Actions, Dockerfile for containerized deploy