Skip to content

feat!: use config file for MCP server #2665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 30, 2025
Merged

feat!: use config file for MCP server #2665

merged 5 commits into from
Jul 30, 2025

Conversation

nicholascioli
Copy link
Contributor

This commit updates rover dev to pass a config file to the running MCP server when configured to serve it.

BREAKING: This commit removes all of the previous --mcp-* cli arguments in favor of the config file.

@nicholascioli nicholascioli requested a review from a team as a code owner July 14, 2025 21:09
@nicholascioli nicholascioli self-assigned this Jul 14, 2025
@apollo-librarian
Copy link
Contributor

apollo-librarian bot commented Jul 14, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: ab10b5ae4f3ff32ed0adf003
Build Logs: View logs

@nicholascioli nicholascioli requested a review from pubmodmatt July 14, 2025 21:09
@pubmodmatt
Copy link
Contributor

Tests are failing here with:

error: the following required arguments were not provided:
  --mcp-config <CONFIG>

@nicholascioli
Copy link
Contributor Author

Whoops, I've made the config optional now. I'll need to update the MCP server to default initialize the config if no file is passed.

@nicholascioli
Copy link
Contributor Author

The MCP server has also been updated in the 0.6.0 release branch

@DaleSeo
Copy link
Contributor

DaleSeo commented Jul 16, 2025

How can I test this locally? I mean, how can I make my local rover use my local mcp? By default, it looks like my local rover uses mcp v0.5.2.

merging supergraph schema files
supergraph config loaded successfully
starting a session with the 'thespacedevs' subgraph
==> Watching /Users/dale.seo/work/apollo-mcp-server/graphql/TheSpaceDevs/api.graphql for changes
composing supergraph with Federation 2.10.0
==> Attempting to start router at http://localhost:4000.
==> Health check exposed at http://127.0.0.1:8088/health
WARN: Connector debugging is enabled, this may expose sensitive information.
==> Your supergraph is running! head to http://localhost:4000 to query your supergraph
ERROR: 2025-07-16T18:17:23.611283Z  INFO Apollo MCP Server v0.5.2 // (c) Apollo Graph, Inc. // Licensed under MIT
ERROR: Error: No valid schema was supplied
MCP Server process exited with status code: 1

MCP Server binary exited, stopping `rover dev` processes...

Comment on lines 12 to 13
#[arg(long = "mcp")]
pub enabled: bool,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should users specify both --mcp and --mcp-config?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily. The config is optional. We could make it so that if a config is specified, then it is defacto enabled, but let me know what you prefer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifying both options seems unnecessary for users, so I would recommend supporting just one to keep the interface simple.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that the config file is optional since it includes defaults for all options. If we make it so that you always need to have a config to run the MCP server, that might make the quickstart more complicated than it needs to be. I can update this PR to look at if either one is specified before starting the MCP server, if that works

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn't consider that. How likely are users to be okay with the default options? Is there any chance we will introduce required options in the future? I still lean towards using a single option to maintain consistency with Router, which doesn't require --router --router-config, but let me check with other folks. I'll post a poll in the MCP channel.

@nicholascioli
Copy link
Contributor Author

As for testing locally, that won't happen until we release. I'll kick off an RC release and then you should be able to test it.

@pubmodmatt
Copy link
Contributor

pubmodmatt commented Jul 16, 2025

As for testing locally, that won't happen until we release. I'll kick off an RC release and then you should be able to test it.

You can test this locally. One way is to just copy a recent build of apollo-mcp-server over ~/.rover/bin/apollo-mcp-server-v0.5.2 or whatever the latest version in there is. Rover will see that it already has what it thinks is the latest version, and use it from there instead of downloading it again.

Copy link
Contributor

@swcollard swcollard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change worked for me. I think I ran into some issues while testing on the mcp side, but as far as rover goes this enables the mcp server and applies the configuration as expected.

nicholascioli and others added 5 commits July 30, 2025 11:36
This commit updates rover dev to pass a config file to the running MCP
server when configured to serve it.

BREAKING: This commit removes all of the previous `--mcp-*` cli
arguments in favor of the config file.
Co-authored-by: Dale Seo <dale.seo@apollographql.com>
@nicholascioli nicholascioli merged commit a1cbc2d into main Jul 30, 2025
44 of 46 checks passed
@nicholascioli nicholascioli deleted the nc/mcp-config branch July 30, 2025 17:20
@DaleSeo DaleSeo added this to the v0.35.0 milestone Jul 30, 2025
@DaleSeo DaleSeo added the BREAKING ❗ a PR that represents a breaking change label Jul 30, 2025
@DaleSeo DaleSeo mentioned this pull request Jul 30, 2025
DaleSeo added a commit that referenced this pull request Jul 30, 2025
# [0.35.0] - 2025-07-30

## ❗ BREAKING ❗

- **use config file for MCP server - @nicholascioli PR #2665**

## 🚀 Features

- **Update MCP options for rover dev - @DaleSeo PR #2661**
- **Add schema name step to Connectors init workflow - @alyssahursh PR
#2647**
- **Allow running rover dev without --supergraph-config if you have a
rover.yaml in the current directory - @dylan-apollo PR #2650**
- **Updating output for init & renaming generated "supergraph.yaml" ->
"rover.yaml" - @tayrrible PR #2651**
- **Adds support for .env file for use with rover dev - @DMallare PR
#2646**
- **Add graph_ref to and remove federation_version from subgraph.yaml -
@alyssahursh PR #2649**
- **Hackathon improvements to supergraph.yaml - @dylan-apollo PR #2648**
- **Adding link to studio for graph & showing each step in creation
process via spinners - @tayrrible PR #2657**
- **Generates .env file with rover init - @DMallare PR #2652**
- **Remove use case guard clause in schema name prompt - @alyssahursh PR
#2655**
- **Set APOLLO_GRAPH_REF from rover.yaml's graph_ref - @dylan-apollo PR
#2653**
- **Adding apollo.config.yaml file for connectors projects - @tayrrible
PR #2658**
- **add a note about the need for APOLLO_KEY and APOLLO_GRAPH_REF when
using router features or connect - @the-gigi-apollo PR #2677**
- **Update Studio Client after loading .env in rover dev - @dylan-apollo
PR #2654**
- **Exposing org selector for all runs of init and changing prompt order
- @tayrrible PR #2656**


## 🛠 Maintenance

- **upgrade schemars and apollo-federation-types - @DaleSeo PR #2676**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING ❗ a PR that represents a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants