Skip to content

Commit 38bee5b

Browse files
authored
Merge pull request #228 from apollographql/docs/mcp-auth
Docs: MCP auth
2 parents 5ef59d7 + 3758551 commit 38bee5b

File tree

2 files changed

+115
-12
lines changed

2 files changed

+115
-12
lines changed

docs/source/command-reference.mdx

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ operations:
124124
- relative/path/to/your/operations/listing.graphql
125125
```
126126
127-
### Config options
127+
## Configuration options
128128
129129
All fields are optional.
130130
@@ -142,7 +142,7 @@ All fields are optional.
142142
| `schema` | `SchemaSource` | | Schema configuration |
143143
| `transport` | `Transport` | | The type of server transport to use |
144144

145-
#### GraphOS configuration
145+
### GraphOS
146146

147147
These fields are under the top-level `graphos` key and define your GraphOS graph credentials and endpoints.
148148

@@ -153,7 +153,7 @@ These fields are under the top-level `graphos` key and define your GraphOS graph
153153
| `apollo_registry_url` | `URL` | | The URL to use for Apollo's registry |
154154
| `apollo_uplink_endpoints` | `URL` | | List of uplink URL overrides. You can also provide this with the `APOLLO_UPLINK_ENDPOINTS` environment variable |
155155

156-
#### Health check configuration
156+
### Health checks
157157

158158
These fields are under the top-level `health_check` key.
159159

@@ -173,7 +173,7 @@ Health checks are only available when using the `streamable_http` transport. The
173173

174174
</Note>
175175

176-
#### Introspection configuration
176+
### Introspection
177177

178178
These fields are under the top-level `introspection` key. Learn more about the MCP [introspection tools](/apollo-mcp-server/guides#introspection-tools).
179179

@@ -188,15 +188,15 @@ These fields are under the top-level `introspection` key. Learn more about the M
188188
| `validate` | `object` | | Validation tool configuration |
189189
| `validate.enabled` | `bool` | `false` | Enable validation tool |
190190

191-
#### Logging configuration
191+
### Logging
192192

193193
These fields are under the top-level `logging` key.
194194

195195
| Option | Type | Default | Description |
196196
| :------ | :-------------------------------------------------- | :------- | :------------------------------ |
197197
| `level` | `oneOf ["trace", "debug", "info", "warn", "error"]` | `"info"` | The minimum log level to record |
198198

199-
#### Operation source configuration
199+
### Operation source
200200

201201
These fields are under the top-level `operations` key. The available fields depend on the value of the nested `source` key.
202202
The default value for `source` is `"infer"`.
@@ -213,7 +213,7 @@ The default value for `source` is `"infer"`.
213213
| Uplink | `source` | `"uplink"` | | Load operations from an uplink manifest. Note: This source requires an Apollo key and graph reference |
214214
| Infer | `source` | `"infer"` | \* | Infer where to load operations based on other configuration options. |
215215

216-
#### Overrides configuration
216+
### Overrides
217217

218218
These fields are under the top-level `overrides` key.
219219

@@ -224,7 +224,7 @@ These fields are under the top-level `overrides` key.
224224
| `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 |
225225
| `mutation_mode` | `oneOf ["none", "explicit", "all"]` | `"none"` | Defines the mutation access level for the MCP server |
226226

227-
#### Schema source configuration
227+
### Schema source
228228

229229
These fields are under the top-level `schema` key. The available fields depend on the value of the nested `source` key.
230230
The default value for `source` is `"uplink"`.
@@ -235,7 +235,7 @@ The default value for `source` is `"uplink"`.
235235
| Local | `path` | `FilePath` | | Path to the GraphQL schema |
236236
| Uplink | `source` | `"uplink"` | \* | Fetch the schema from uplink. Note: This requires an Apollo key and graph reference |
237237

238-
#### Transport configuration
238+
### Transport
239239

240240
These fields are under the top-level `transport` key. The available fields depend on the value of the nested `type` key.
241241
The default value for `type` is `"stdio"`.
@@ -250,8 +250,55 @@ The default value for `type` is `"stdio"`.
250250
| StreamableHTTP | `address` | `IpAddr` | `127.0.0.1` | The IP address to bind to |
251251
| StreamableHTTP | `port` | `u16` | `5000` | The port to bind to |
252252

253-
### Mapping rover dev options
254253

255-
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.
254+
### Auth
256255

257-
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>`.
256+
These fields are under the top-level `transport` key, nested under the `auth` key.
257+
258+
| Option | Type | Default | Description |
259+
| :----------------------- | :------------- | :------ | :------------------------------------------------------------------------------------------------- |
260+
| `servers` | `List<URL>` | | List of upstream delegated OAuth servers (must support OIDC metadata discovery endpoint) |
261+
| `audiences` | `List<string>` | | List of accepted audiences from upstream signed JWTs |
262+
| `resource` | `string` | | The externally available URL pointing to this MCP server. Can be `localhost` when testing locally. |
263+
| `resource_documentation` | `string` | | Optional link to more documentation relating to this MCP server |
264+
| `scopes` | `List<string>` | | List of queryable OAuth scopes from the upstream OAuth servers |
265+
266+
Below is an example configuration using `StreamableHTTP` transport with authentication:
267+
268+
```yaml title="mcp.yaml"
269+
transport:
270+
type: streamable_http
271+
auth:
272+
# List of upstream delegated OAuth servers
273+
# Note: These need to support the OIDC metadata discovery endpoint
274+
servers:
275+
- https://auth.example.com
276+
277+
# List of accepted audiences from upstream signed JWTs
278+
# See: https://www.ory.sh/docs/hydra/guides/audiences
279+
audiences:
280+
- mcp.example.audience
281+
282+
# The externally available URL pointing to this MCP server. Can be `localhost`
283+
# when testing locally.
284+
# Note: Subpaths must be preserved here as well. So append `/mcp` if using
285+
# Streamable HTTP or `/sse` is using SSE.
286+
resource: https://hosted.mcp.server/mcp
287+
288+
# Optional link to more documentation relating to this MCP server.
289+
resource_documentation: https://info.mcp.server
290+
291+
# List of queryable OAuth scopes from the upstream OAuth servers
292+
scopes:
293+
- read
294+
- mcp
295+
- profile
296+
```
297+
298+
## Run a local graph with MCP server using `rover dev`
299+
300+
You can use the [`rover dev`](/rover/commands/dev) command of Rover CLI `v0.35` or later to run an Apollo MCP Server instance for local development alongside your local graph. Use the `--mcp` flag to start an MCP server and provide an optional configuration file.
301+
302+
```sh
303+
rover dev --mcp <PATH/TO/CONFIG>
304+
```

docs/source/guides/index.mdx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,62 @@ introspection:
186186
apollo-mcp-server <path to the preceding config>
187187
```
188188

189+
## Set up authorization
190+
191+
The Apollo MCP server supports authorizing clients (e.g. LLMs) in accordance with [the MCP specification](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization).
192+
193+
Depending on whether you are connecting internal agents (first-party) or external agents (third-party, such as Claude, ChatGPT, or other public AI assistants), the steps to configure authorization will differ.
194+
195+
For internal (first-party) agents, you need:
196+
197+
- An [OAuth 2.1-compliant](https://oauth.net/2.1/) Identity Provider (for example, your own in-house IdP or a third-party IdP such as Auth0, Okta, Keycloak, etc)
198+
- An Apollo Router [configured to use JWT authentication](/graphos/routing/security/jwt)
199+
200+
For external (third-party) agents, in addition to the preceding items, you also need:
201+
202+
- A configuration file for the MCP server that [defines the `auth` settings](/apollo-mcp-server/command-reference#auth)
203+
204+
### Example: Configure authentication with Auth0 and third-party agents
205+
206+
Here is an example of how to set up Apollo MCP Server and Apollo Router, with Auth0 as the Identity Provider for external/third-party access.
207+
208+
1. [Set up an Auth0 API](https://auth0.com/docs/get-started/auth0-overview/set-up-apis). You need your Auth0 domain for the next step.
209+
2. Configure the Apollo Router to [use JWT authentication](/graphos/routing/security/jwt):
210+
211+
This example router configuration enforces authentication on all requests and uses the JWKS endpoint provided by Auth0 to validate JWTs:
212+
213+
```yaml title="Router configuration for JWT authentication"
214+
authorization:
215+
require_authentication: true # Enforces authentication on all requests
216+
authentication:
217+
router:
218+
jwt:
219+
jwks:
220+
- url: https://<AUTH0 DOMAIN>/.well-known/jwks.json
221+
```
222+
223+
3. Configure the MCP server to use the same Auth0 instance for authentication.
224+
225+
This example MCP server configuration enforces authentication on all requests, delegating the actual login process to your previously-configured Auth0 instance:
226+
227+
```yaml title="Example MCP config for authentication"
228+
transport:
229+
type: streamable_http
230+
address: "0.0.0.0"
231+
232+
auth:
233+
servers:
234+
- https://<AUTH0 DOMAIN>
235+
audiences:
236+
- <AUTH0 DEFAULT AUDIENCE>
237+
resource: http://localhost:5000
238+
scopes:
239+
- read:users
240+
```
241+
242+
Refer to the [Authentication configuration section in the command reference](/apollo-mcp-server/command-reference#auth) for more details on the available `auth` options.
243+
244+
189245
## Deploying the MCP server
190246

191247
There are two ways to deploy and operate the MCP server.

0 commit comments

Comments
 (0)