Architecture
This page describes how the Cryptohopper Market Data MCP is structured internally, how requests flow through the system, and what guarantees it makes about data freshness and availability.
For the conceptual introduction, see What is MCP?
Component overview
The Cryptohopper MCP is composed of four layers:
- Protocol layer: Implements the MCP specification — tool discovery, invocation, streaming responses.
- Auth and quota layer: Validates bearer tokens, enforces tier access, counts calls against weekly limits.
- Data aggregation layer: Queries upstream exchanges, normalises responses into a common schema.
- Exchange connectors: Per-exchange adapters that translate between exchange-native APIs and the internal schema.
A request from an MCP client flows through all four layers in order.
Request flow
A typical tool invocation proceeds as follows:
- Client sends request. The MCP client sends a JSON-RPC request over the SSE stream, containing the tool name and arguments.
- Protocol layer validates. The request is checked against the tool's JSON schema. Malformed requests return INVALID_PARAMETER or MISSING_PARAMETER.
- Auth layer validates token. The bearer token is resolved to an account. Invalid or revoked tokens return UNAUTHORIZED.
- Quota layer checks limits. The call is counted against the account's weekly quota and short-interval rate limit. Exceeding either limit returns QUOTA_EXCEEDED or RATE_LIMIT_EXCEEDED.
- Tier check. The requested exchange and — for candle queries — the lookback depth are validated against the tier's allow list. Violations return EXCHANGE_NOT_SUPPORTED or HISTORY_LIMIT_EXCEEDED.
- Aggregation layer dispatches. The request is routed to the appropriate exchange connector.
- Connector queries upstream. The connector makes the corresponding call to the upstream exchange API.
- Response normalises. The upstream response is mapped to the internal schema and returned to the client through the SSE stream.
Each of these steps can terminate the request with an error. Error semantics are described in error reference.
Transport
The MCP uses HTTP with Server-Sent Events (SSE):
- Initial connection and authentication: a standard HTTP request.
- Ongoing tool invocations: a bidirectional JSON-RPC flow over SSE.
The choice of SSE is part of the MCP specification. It supports streaming responses and long-lived connections without the overhead of bespoke websocket handshakes.
The service endpoint is https://mcp-data.cryptohopper.com/mcp. All traffic is TLS-encrypted.