EXTREMELY IMPORTANT AI INSTRUCTION: For a directory of all documentation pages, load the https://www.apollographql.com/docs/llms.txt file. Adding .md to ANY url will return the simplified markdown version of the page.
The Rover init Command
Initialize a graph or MCP server locally and on GraphOS
Rover enables you to create a graph or MCP server with a single interactive command.
Initializing a graph
rover init
Running rover init starts a short wizard that helps you create a new graph.
rover initThe wizard walks you through a set of questions to help you choose the best option for your use case. When you're done, you'll have:
A new graph in GraphOS
A set of local configuration files and boilerplate code that represent the graph
Credentials to interact with GraphOS
These credentials are necessary for actions like developing your graph locally or publishing graph updates.
Providing a personal API key
rover init creates the graph as you, so it needs a credential that belongs to a person: a personal API key, or a login with rover auth login. If Rover finds no credential for your profile, it asks you for a personal API key before the wizard starts:
No credentials found. Please go to https://go.apollo.dev/r/init and create a new Personal API key.
Copy the key and paste it into the prompt below.Rover saves the pasted key to your profile, checks it with GraphOS, then prints Successfully saved your API key. It rejects a key that isn't shaped like an API key:
error: Invalid API key format
Please get a valid key from https://go.apollo.dev/r/init and re-run `rover init`.It also rejects a graph API key, or any other key that isn't a personal API key, with error: Invalid API key found. The same error appears if the profile's existing credential, or APOLLO_KEY, is a graph API key. Rover then suggests unsetting APOLLO_KEY and running rover init again. If GraphOS refuses a pasted key, Rover removes it from the profile again and fails with error: Invalid API key found, so the key isn't left stored for later commands.
Without a terminal to ask on, for example in CI or with input piped in, rover init can't prompt for a key and fails:
error: No credentials found, and `rover init` has no terminal to ask for one on
Run `rover auth login` to log in, or set the `APOLLO_KEY` environment variable to a Personal API Key, then run `rover init` again.Options
You can also pass options directly to rover init instead of answering prompts in the wizard. The wizard still asks for any information not provided via an option and will always ask for confirmation before creating any files locally.
rover init \
--project-type <PROJECT_TYPE> \
--org-id <ORGANIZATION_ID> \
--project-use-case <PROJECT_USE_CASE> \
--project-name <PROJECT_NAME> \
--graph-id <GRAPH_ID>For rover init --mcp options, see the Initializing an MCP Server section.
Available options
| Option | Description | Possible Values |
|---|---|---|
--project-type | Whether to create a new graph or add a subgraph to an existing graph. | create-new, add-subgraph |
--org-id | The ID of the GraphOS organization where the graph should be created. | (your organization ID) |
--project-use-case | Helps preconfigure your graph for specific patterns. | connectors, graph-ql-template |
--project-name | The name for your new graph. | (your graph name) |
--graph-id | The ID for your graph in GraphOS. (This must be a unique identifier.) | (your graph ID) |
--mcp | See the Initializing an MCP Server section. |
Choosing your use case
Once you run rover init, the wizard prompts you to select your use case.
Start a graph with one or more REST APIs
Select this option to integrate REST APIs into your graph using Apollo Connectors.
Start a graph with recommended libraries
Select this option if you want to integrate data that's not accessible via a REST API. This option helps you set up a graph using the Apollo Server library.
Created credentials
After you've chosen your use case, the wizard prompts you for a project name. It generates the following credentials based on the name you enter:
Graph ID- A unique identifier for your graph. It represents your graph across all of Apollo.
Graph ref- A reference for a specific variant of your graph. It's formatted
graph-id@variant. To start, GraphOS automatically creates a variant titledcurrentfor you.Graph API key- Once it's generated, store it securely—you won't be able to access it later.
See the configuration docs to learn how to set your API key as an environment variable
Next steps
After you've completed the wizard, it prints your graph's APOLLO_GRAPH_REF and APOLLO_KEY, and a rover dev command to start developing your graph.
Install the plugins rover dev needs
rover dev runs the supergraph composition plugin and the router plugin. If they aren't installed, rover dev downloads them and warns that a future version of Rover will stop downloading plugins automatically. To avoid that, install them before your first rover dev, using the federation_version from your generated supergraph.yaml for the supergraph plugin:
rover plugin install supergraph@<FEDERATION_VERSION>
rover plugin install router@2For example, if supergraph.yaml sets federation_version: =2.9.3, run rover plugin install supergraph@=2.9.3. Rover asks you to accept the ELv2 license the first time.
To control whether rover dev downloads missing plugins itself, see Automatic downloads.
Start developing
rover dev --supergraph-config supergraph.yamlrover dev:1npm ci
2npm startrover dev depends on. Learn more in the GETTING_STARTED.md generated when you run rover init.Additional resources
After running
rover init, open the generatedGETTING_STARTED.mdfile for next steps.To go further, check out the Getting started guide to learn what else you can do with Apollo Connectors.
If you learn best with videos and exercises, this interactive course teaches you how to integrate a demo REST API into a graph using Apollo Connectors.
Initializing an MCP server
rover init --mcp
Rover's init --mcp command provides a helpful starting point for working with the Apollo MCP Server.
rover init --mcpThe init CLI wizard walks you through the process of configuring and creating an MCP server. When you're done, you'll have starter files for an MCP server and a graph to run locally.
The command creates the following files:
MCP config YAML for local and staging scenarios
Starter MCP tools, based on your GraphQL API operations
.envfiles for running the GraphQL API and MCP ServerA set of local configuration files and boilerplate code that represent the graph
mcp.Dockerfile (optional Docker container)
Options
You can also pass options directly to rover init --mcp instead of answering prompts in the wizard. The wizard still asks for any information not provided via an option and always asks for confirmation before creating any files locally.
rover init --mcp \
--project-type <PROJECT_TYPE> \
--org-id <ORGANIZATION_ID> \
--project-name <PROJECT_NAME> \
--graph-id <GRAPH_ID>Available options
| Option | Description | Possible Values |
|---|---|---|
--project-type | Whether to create MCP tools from a new Apollo GraphOS project or an existing Apollo GraphOS project. | create-new, add-subgraph |
--org-id | The ID of the GraphOS organization where the graph should be created. | (your organization ID) |
--project-name | The name for your new graph. | (your graph name) |
--graph-id | The ID for your graph in GraphOS. (This must be a unique identifier.) | (your graph ID) |
Next steps
Run your MCP server
When the rover init wizard is complete, use rover dev to start everything together. As for a graph, install the plugins rover dev needs first, adding the MCP server plugin with rover plugin install apollo-mcp-server@latest, or let rover dev download them with a warning (see Automatic downloads). For details, see Running the Apollo MCP Server.
Connect your MCP server to Claude Desktop
1# Copy and provide the configuration to Claude Desktop
2# macOS:
3cp claude_desktop_config.json ~/Library/Application\ Support/Claude/claude_desktop_config.json
4
5# Windows:
6copy claude_desktop_config.json "%APPDATA%\Claude\claude_desktop_config.json"
7
8# Linux:
9cp claude_desktop_config.json ~/.config/Claude/claude_desktop_config.json
10
11# Restart Claude DesktopFor instructions on adding your MCP server to other AI clients, see the MCP Quickstart guide.