You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`readiness.interval.sampling`|`duration`|`"5s"`| How often to check the rejection count |
144
+
|`readiness.interval.unready`|`duration`|`"10s"`| How long to wait before recovering from unready state (default: 2 \* sampling) |
145
+
146
+
<Note>
147
+
148
+
Health checks are only available when using the `streamable_http` transport. The health check feature is inspired by Apollo Router's health check implementation.
149
+
150
+
</Note>
132
151
133
152
#### Introspection configuration
134
153
@@ -145,7 +164,6 @@ These fields are under the top-level `introspection` key.
|`level`|`oneOf ["trace", "debug", "info", "warn", "error"]`|`"info"`| The minimum log level to record |
156
174
157
-
158
175
#### Operation source configuration
159
176
160
177
These fields are under the top-level `operations` key. The available fields depend on the value of the nested `source` key.
@@ -170,8 +187,7 @@ The default value for `source` is `"infer"`.
170
187
| Manifest |`source`|`"manifest"`|| Load operations from a persisted queries manifest file |
171
188
| Manifest |`path`|`FilePath`|| The path to the persisted query manifest |
172
189
| Uplink |`source`|`"uplink"`|| Load operations from an uplink manifest. Note: This source requires an Apollo key and graph reference |
173
-
| Infer |`source`|`"infer"`| * | Infer where to load operations based on other configuration options. |
174
-
190
+
| Infer |`source`|`"infer"`|\*| Infer where to load operations based on other configuration options. |
175
191
176
192
#### Overrides configuration
177
193
@@ -184,7 +200,6 @@ These fields are under the top-level `overrides` key.
184
200
|`enable_explorer`|`bool`|`false`| Expose a tool that returns the URL to open a GraphQL operation in Apollo Explorer. Note: This requires a GraphOS graph reference |
185
201
|`mutation_mode`|`oneOf ["none", "explicit", "all"]`|`"none"`| Defines the mutation access level for the MCP server |
186
202
187
-
188
203
#### Schema source configuration
189
204
190
205
These fields are under the top-level `schema` key. The available fields depend on the value of the nested `source` key.
@@ -194,8 +209,7 @@ The default value for `source` is `"uplink"`.
| stdio |`type`|`"stdio"`|* | Use standard IO for communication between the server and client |
221
+
| stdio |`type`|`"stdio"`|\*| Use standard IO for communication between the server and client |
208
222
| SSE |`type`|`"sse"`|| Host the MCP server on the supplied configuration, using SSE for communication. Note: Deprecated in favor of `StreamableHTTP`|
209
223
| SSE |`address`|`IpAddr`|`127.0.0.1`| The IP address to bind to |
210
224
| SSE |`port`|`u16`|`5000`| The port to bind to |
211
225
| StreamableHTTP |`type`|`"streamable_http"`|| Host the MCP server on the configuration, using streamable HTTP messages. |
212
226
| StreamableHTTP |`address`|`IpAddr`|`127.0.0.1`| The IP address to bind to |
213
227
| StreamableHTTP |`port`|`u16`|`5000`| The port to bind to |
214
228
215
-
216
229
### Mapping rover dev options
217
230
218
231
You can use the [`rover dev`](/rover/commands/dev) command of Rover CLI v0.32 or later to run an Apollo MCP Server instance for local development.
219
232
220
-
Running `rover dev --mcp` starts an MCP Server. An optional configuration file path can be provided to configure the MCP server via `rover dev --mcp <PATH/TO/CONFIG>`.
233
+
Running `rover dev --mcp` starts an MCP Server. An optional configuration file path can be provided to configure the MCP server via `rover dev --mcp <PATH/TO/CONFIG>`.
1. Click **Connect** and **List Tools**. You should see the tools for the operations you provided.
333
327
328
+
## Health checks
329
+
330
+
Apollo MCP Server provides health check endpoints for monitoring server health and readiness. This feature is useful for load balancers, container orchestrators, and monitoring systems.
331
+
332
+
### Configuration
333
+
334
+
Health checks are only available when using the `streamable_http` transport and must be explicitly enabled:
335
+
336
+
```yaml title="Example health check configuration"
337
+
transport:
338
+
type: streamable_http
339
+
address: 127.0.0.1
340
+
port: 5000
341
+
health_check:
342
+
enabled: true
343
+
path: /health
344
+
readiness:
345
+
allowed: 50
346
+
interval:
347
+
sampling: 10s
348
+
unready: 30s
349
+
```
350
+
351
+
### Endpoints
352
+
353
+
The health check provides different responses based on query parameters:
| `GET /health?live` | Liveness check | Returns `{"status": "UP"}` if server is alive |
359
+
| `GET /health?ready` | Readiness check | Returns `{"status": "UP"}` if server is ready to handle requests |
360
+
361
+
### Readiness tracking
362
+
363
+
The server tracks failed requests and automatically marks itself as unready if too many failures occur within a sampling interval:
364
+
365
+
- **Sampling interval**: How often the server checks the rejection count (default: 5 seconds)
366
+
- **Allowed rejections**: Maximum failures allowed before becoming unready (default: 100)
367
+
- **Recovery time**: How long to wait before attempting to recover (default: 2x sampling interval)
368
+
369
+
When the server becomes unready:
370
+
371
+
- The `/health?ready` endpoint returns HTTP 503 with `{"status": "DOWN"}`
372
+
- After the recovery period, the rejection counter resets and the server becomes ready again
373
+
374
+
This allows external systems to automatically route traffic away from unhealthy servers and back when they recover.
375
+
334
376
## Custom scalars configuration
335
377
336
378
You can specify a custom scalars configuration JSON file to map a custom scalar to a [JSON schema type](https://json-schema.org/understanding-json-schema/reference/type). The JSON file is an object with custom scalar names as keys and JSON schema types as values:
0 commit comments