An MCP Server to expose GraphQL operations as MCP tools.
See the documentation for details.
This is a modified version of the Apollo MCP Server that enables Authorization header pass-through. This allows the MCP client to send a Bearer token which is automatically forwarded by the MCP server to the backend GraphQL service for authentication and authorization, enabling seamless integration with protected APIs that require user authentication.
- Rust (latest stable version)
-
Clone this repository:
git clone <repository-url> cd apollo-mcp-server
-
Build the project:
cargo build --release
Run the server with your GraphQL schema and endpoint:
./target/release/apollo-mcp-server \
--schema path/to/your/schema.graphql \
--endpoint http://your-graphql-endpoint \
--http-port 5000 \
--introspection \
--operations path/to/your/operations \
--allow-mutations all \
--log debug--schema: Path to your GraphQL schema file (required, unless using Apollo registry)--endpoint: Base URL of your GraphQL endpoint (optional, defaults tohttp://127.0.0.1:4000)--http-port: Port for HTTP transport (optional, enables HTTP mode; defaults to5000if specified)--introspection: Enable GraphQL introspection (optional)--operations: Path to directory containing GraphQL operation files (optional, but either this or--introspectionmust be provided)--allow-mutations: Controls mutation permissions (all,none, or specific operations) (optional, defaults tonone)--log: Log level (debug,info,warn,error) (optional, defaults toinfo)
Note: This is a selection of the most commonly used configuration options. Run ./target/release/apollo-mcp-server --help to see all available options.
Transport Modes: Specifying either the SSE port or address (or both) will enable the SSE transport. Specifying either the HTTP port or address (or both) will enable the Streamable HTTP transport.
This project is licensed under the MIT License. See the LICENSE file for the full license text.