API Gateway
An API gateway is a server that sits between client applications and backend services, acting as a single entry point for all API requests. It handles cross-cutting concerns — authentication, rate limiting, request routing, data transformation — so that backend services can focus on business logic. FieldMCP's MCP gateway is an API gateway purpose-built for agricultural data access.
FieldMCP's Gateway Architecture
The FieldMCP gateway runs in the cloud. It exposes a single MCP endpoint (POST /mcp) that accepts tool invocations from AI clients. Behind this endpoint, the gateway:
- Authenticates — Validates OAuth 2.1 bearer tokens (ES256 JWTs) on every request
- Rate limits — Enforces per-minute and monthly request limits based on subscription tier. See rate limiting.
- Routes — Maps MCP tool names to the appropriate agricultural data provider API
- Transforms — Normalizes provider-specific responses into FieldMCP's standard format
- Caches — Uses Durable Objects for per-developer state management, reducing database roundtrips from 11-13 calls to 1
Why a Gateway (Not Direct API Access)
Agricultural APIs like John Deere require provider-specific authentication flows, custom headers (Accept: application/vnd.deere.axiom.v3+json), pagination handling, and data format translation. The gateway absorbs this complexity so your application sends a simple MCP tool call and receives clean, normalized data.
As FieldMCP adds support for additional providers (Climate FieldView, CNHi), the gateway routes to them transparently. Your integration code stays the same.
Key Endpoints
POST /mcp— MCP tool invocations (requires Bearer JWT)GET /authorize— OAuth 2.1 authorization initiationGET /oauth/callback— OAuth callback handlerGET /.well-known/jwks.json— Public signing keysGET /health— Health check