Skip to content

Commit a7b9312

Browse files
authored
Merge pull request #332 from apollographql/DXM-239
Docs: add section on overriding config options with environment variables
2 parents e4ca92c + 35f7598 commit a7b9312

File tree

1 file changed

+43
-23
lines changed

1 file changed

+43
-23
lines changed

docs/source/config-file.mdx

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,16 @@ redirectFrom:
55
- /apollo-mcp-server/command-reference
66
---
77

8-
### Example config file
8+
You can configure Apollo MCP Server using a configuration file. You can also [override configuration options using environment variables](#override-configuration-options-using-environment-variables).
99

10-
The following example file sets your endpoint to `localhost:4001`, configures transport over Streamable HTTP, provides a GraphOS key and graph reference,
11-
enables introspection, and provides two local MCP operations for the server to expose.
12-
13-
```yaml config.yaml
14-
endpoint: http://localhost:4001/
15-
transport:
16-
type: streamable_http
17-
graphos:
18-
apollo_key: <YOUR_APOLLO_KEY>
19-
apollo_graph_ref: <YOUR_APOLLO_GRAPH_REF>
20-
introspection:
21-
introspect:
22-
enabled: true
23-
operations:
24-
source: local
25-
paths:
26-
- relative/path/to/your/operations/userDetails.graphql
27-
- relative/path/to/your/operations/listing.graphql
28-
```
10+
See the [example config file](#example-config-file) for an example.
2911

3012
## Configuration options
3113

3214
All fields are optional.
3315

16+
### Top-level options
17+
3418
| Option | Type | Default | Description |
3519
| :--------------- | :-------------------- | :----------------------- | :--------------------------------------------------------------- |
3620
| `custom_scalars` | `FilePath` | | Path to a [custom scalar map](/apollo-mcp-server/custom-scalars) |
@@ -58,7 +42,7 @@ These fields are under the top-level `graphos` key and define your GraphOS graph
5842

5943
### Health checks
6044

61-
These fields are under the top-level `health_check` key.
45+
These fields are under the top-level `health_check` key. Learn more about [health checks](/apollo-mcp-server/health-checks).
6246

6347
| Option | Type | Default | Description |
6448
| :---------------------------- | :--------- | :---------- | :--------------------------------------------------------------------------------- |
@@ -108,7 +92,7 @@ These fields are under the top-level `logging` key.
10892
### Operation source
10993

11094
These fields are under the top-level `operations` key. The available fields depend on the value of the nested `source` key.
111-
The default value for `source` is `"infer"`.
95+
The default value for `source` is `"infer"`. Learn more about [defining tools as operations](/apollo-mcp-server/define-tools).
11296

11397
| Source | Option | Type | Default | Description |
11498
| :----------------- | :------- | :--------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------ |
@@ -179,7 +163,7 @@ The available fields depend on the value of the nested `type` key:
179163

180164
### Auth
181165

182-
These fields are under the top-level `transport` key, nested under the `auth` key.
166+
These fields are under the top-level `transport` key, nested under the `auth` key. Learn more about [authorization and authentication](/apollo-mcp-server/auth).
183167

184168
| Option | Type | Default | Description |
185169
| :----------------------- | :------------- | :------ | :------------------------------------------------------------------------------------------------- |
@@ -220,3 +204,39 @@ transport:
220204
- mcp
221205
- profile
222206
```
207+
208+
## Example config file
209+
210+
The following example file sets your endpoint to `localhost:4001`, configures transport over Streamable HTTP, enables introspection, and provides two local MCP operations for the server to expose.
211+
212+
```yaml config.yaml
213+
endpoint: http://localhost:4001/
214+
transport:
215+
type: streamable_http
216+
introspection:
217+
introspect:
218+
enabled: true
219+
operations:
220+
source: local
221+
paths:
222+
- relative/path/to/your/operations/userDetails.graphql
223+
- relative/path/to/your/operations/listing.graphql
224+
```
225+
226+
## Override configuration options using environment variables
227+
228+
You can override configuration options using environment variables. The environment variable name is the same as the option name, but with `APOLLO_MCP_` prefixed. You can use `__` to mark nested options.
229+
230+
For example, to override the `introspection.execute.enabled` option, you can set the `APOLLO_MCP_INTROSPECTION__EXECUTE__ENABLED` environment variable.
231+
232+
```sh
233+
APOLLO_MCP_INTROSPECTION__EXECUTE__ENABLED="true"
234+
```
235+
236+
For list values, you can set the environment variable to a comma-separated list.
237+
238+
For example, to override the `transport.auth.servers` option, you can set the `APOLLO_MCP_TRANSPORT__AUTH__SERVERS` environment variable to a comma-separated list.
239+
240+
```sh
241+
APOLLO_MCP_TRANSPORT__AUTH__SERVERS='[server_url_1,server_url_2]'
242+
```

0 commit comments

Comments
 (0)