Using apollo-mcp-server without GraphOS / Apollo account

Hi! In your docs it says that one can use the apollo-mcp-server with any API server, however when attempting to boot it without the graphos config it says:
```
Error: Missing environment variable: APOLLO_GRAPH_REF
```

Adding empty strings as those values in the config yields:

uplink error, the request will not be retried: code=AUTHENTICATION_FAILED message= did not parse to a valid key format

Thoughts?

@chriss It should work with any GraphQL APIs. Could you let me know which version of apollo-mcp-server you’re using? Also, please share your config file, run the server with debug logging enabled, and provide the terminal output.

1 Like

Hi Dale! Returning to this, I was able to figure it out!

Would be great if the ‘quickstart’ doc didn’t link to the tutorial with all of its steps and complexity, but rather something more bare bones, with a full config easily readable.

For example, a config something like the below would be enough for most devs to get started within a locally-running GraphQL server:

```
endpoint: http://localhost:5001
transport:
type: streamable_http
operations:
source: local
paths:
- ./mcp/operations
schema:
source: local
path: ./schema.graphql
introspection:
execute:
enabled: true
introspect:
enabled: true
search:
enabled: true

Then then docs would be a little less confusing.

Thank you though for this great tool!

1 Like

Ok y’all, this tool is very, very powerful! Up and running in our schema and am amazed. So much potential here. Great work (ty).

1 Like

Really glad to hear you got it working @chriss! Appreciate the feedback. I’ll pass it along to the team so we can make the quickstart experience clearer.

Hi chriss - could you share how you resolved this issue?
Using 0.6.1 I get the error “Missing environment variable: APOLLO_GRAPH_REF” using a basic config setup.
If I set these env vars to dummy values, it will fail the validation: “ERROR uplink error, the request will not be retried: code=UNKNOWN_REF message=No valid graph configuration for …”

The new features in 0.6 look interesting, but without using federation this seems to be broken.

Thanks,
Brian

Sure thing! A config as simple as this will do it, assuming you’ve booted your graphql server on port 5001, and started the MCP server. Note the bit about schema: source: local, which then points at the concrete artifact of your schema; once this is set the error will go away. We’ve also tested this on remotely deployed graphql servers and likewise, works great.

endpoint: http://localhost:5001
transport:
type: streamable_http
operations:
source: local
paths:
./mcp/operations/analytics
schema:
source: local
path: ./schema.graphql
overrides:
mutation_mode: “all” # enable mutations?
introspection:
execute:
enabled: true
introspect:
enabled: true
search:
enabled: true
headers:
“x-access-token”: “fill-in”
“x-user-id”: “fill-in”

(Code formatting doesn’t work so good on this forum, apologies)

1 Like

Hi @bwkiwi , as @chriss mentioned, Apollo MCP Server tries to fetch the schema from Uplink by default, which requires an Apollo key and a graph reference. This default behavior is documented here:

You can configure the MCP server to use your local schema file as follows:

schema:
  source: local
  path: /schema.graphql

Once you make this change, you should be able to start the server without needing Apollo-specific environment variables.

Hi Chriss, no matter what I do I keep getting this same error. could you please tell me how did you run the mcp server, via rover or docker?

hi @Carlos_Andres - we run it via the docker container! We don’t have an apollo account and everything works great.

1 Like