Apollo MCP Demo
Apollo MCP Demo
Dieser Ordner richtet die gleiche Kernarchitektur ein, die Apollo für MCP demonstriert:
eine normale GraphQL-API,
einen Apollo MCP-Server davor,
eine kleine Positivliste von GraphQL-Operationen, die zu MCP-Tools werden.
Diese Version verwendet den eigenständigen Apollo MCP-Server-Container anstelle des rover init --mcp-Assistenten, da er einfacher lokal ohne GraphOS-Anmeldedaten ausgeführt werden kann.
Was gestartet wird
api: ein kleiner Apollo-Server unterhttp://localhost:4001/mcp: Apollo MCP-Server unterhttp://localhost:8000/mcp
Related MCP server: mcp4gql
Architekturdiagramm
flowchart LR
subgraph LocalMachine["Local machine"]
Client["MCP client\nInspector / Codex / Cursor"]
subgraph Docker["docker compose"]
MCP["Apollo MCP Server\n:8000/mcp"]
API["Apollo GraphQL API\n:4001"]
end
Ops["graphql/operations/*.graphql\nApproved operations"]
Schema["graphql/api.graphql\nSchema snapshot"]
end
Client -->|"MCP over Streamable HTTP"| MCP
Ops -->|"tool definitions"| MCP
Schema -->|"schema metadata"| MCP
MCP -->|"GraphQL queries/mutations"| API
API -->|"GraphQL JSON response"| MCP
MCP -->|"MCP tool results"| ClientAusführung
cd C:\Users\muham\Documents\apollo-mcp
npm install
docker compose up --buildUntersuchen Sie in einem zweiten Terminal den MCP-Server:
npx @modelcontextprotocol/inspectorÖffnen Sie dann die ausgegebene Inspector-URL und wählen Sie:
Transporttyp:
Streamable HTTPURL:
http://127.0.0.1:8000/mcp
Klicken Sie auf Connect und dann auf List Tools.
Sie sollten MCP-Tools sehen, die von folgenden abgeleitet sind:
GetBooksGetBookByIdGetBooksByGenre
Optionale Client-Konfiguration
Für MCP-Clients, die mcp-remote verwenden, sieht die lokale Konfigurationsstruktur so aus:
{
"mcpServers": {
"apollo-demo": {
"command": "npx",
"args": [
"mcp-remote",
"http://127.0.0.1:8000/mcp"
]
}
}
}Was tatsächlich passiert
Die GraphQL-API ist weiterhin der eigentliche Datendienst. Sie kennt das Schema, löst Felder auf und gibt JSON für GraphQL-Abfragen zurück.
Der Apollo MCP-Server ersetzt diese API nicht. Er schaltet sich davor und übersetzt genehmigte GraphQL-Operationen in MCP-Tools, die ein KI-Client entdecken und aufrufen kann.
Die wichtigen Dateien sind:
mcp-config.yaml: teilt dem Apollo MCP-Server mit, wo sich der GraphQL-Endpunkt befindet, wo die Schemadatei liegt, wo die erlaubten Operationen gespeichert sind und wie MCP über HTTP bereitgestellt werden soll.
graphql/api.graphql: Schema-Snapshot, der vom Apollo MCP-Server verwendet wird, damit er Tools korrekt beschreiben kann.
graphql/operations/GetBooks.graphql: eine genehmigte Abfrage, die zu einem MCP-Tool wird.
src/server.mjs: die eigentliche Implementierung der GraphQL-API.
docker-compose.yml: führt beide Dienste zusammen in einem lokalen Netzwerk aus.
Der Anforderungsfluss ist:
Ihr MCP-Client verbindet sich mit
http://localhost:8000/mcp.Der Apollo MCP-Server kündigt Tools basierend auf den
.graphql-Operationsdateien an.Der Client ruft eines dieser Tools mit Argumenten auf.
Der Apollo MCP-Server konvertiert diesen Tool-Aufruf zurück in die zugrunde liegende GraphQL-Operation.
Der Apollo MCP-Server sendet diese GraphQL-Anfrage an
http://api:4001/.Die GraphQL-API führt die Abfrage aus und gibt Daten zurück.
Der Apollo MCP-Server gibt das Ergebnis im MCP-Format an den MCP-Client zurück.
Anforderungsflussdiagramm
sequenceDiagram
autonumber
participant C as MCP Client
participant M as Apollo MCP Server
participant O as Operation Files
participant G as GraphQL API
C->>M: Connect to http://localhost:8000/mcp
M->>O: Load approved .graphql operations
O-->>M: GetBooks / GetBookById / GetBooksByGenre
M-->>C: Advertise MCP tools
C->>M: Invoke tool with arguments
M->>M: Convert tool call to GraphQL operation
M->>G: Send GraphQL request to http://api:4001/
G-->>M: Return GraphQL JSON data
M-->>C: Return MCP-formatted tool resultWarum es hier keinen Router gibt
Der Apollo Router ist nützlich, wenn:
Sie einen föderierten Supergraph bereitstellen,
Sie die von Apollo verwaltete GraphOS-Laufzeitumgebung wünschen,
oder Sie GraphQL und MCP in der Apollo-Laufzeitumgebung gebündelt haben möchten.
Für eine einfache lokale Demo mit einer bestehenden GraphQL-API unterstützen die Bereitstellungsdokumente von Apollo die direkte Verwendung des eigenständigen Apollo MCP-Server-Containers für diesen Endpunkt. Genau das verwendet dieses Projekt.
Quellen
Apollo MCP-Server Quickstart: https://www.apollographql.com/docs/apollo-mcp-server/quickstart
Apollo MCP-Server Konfigurationsreferenz: https://www.apollographql.com/docs/apollo-mcp-server/command-reference
Apollo MCP-Server Bereitstellungsdokumente: https://www.apollographql.com/docs/apollo-mcp-server/deploy
Apollo MCP-Server Debugging-Dokumente: https://www.apollographql.com/docs/apollo-mcp-server/debugging
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceA MCP server that exposes GraphQL schema information to LLMs like Claude. This server allows an LLM to explore and understand large GraphQL schemas through a set of specialized tools, without needing to load the whole schema into the context7047MIT
- AlicenseAqualityDmaintenanceGraphQL MCP Server that acts as a bridge allowing MCP clients (like Cursor or Claude Desktop) to interact with target GraphQL APIs through standard tools for schema introspection and operation execution.2153MIT
- AlicenseAqualityAmaintenanceA generic MCP (Model Context Protocol) server that bridges any GraphQL API to Claude Code. It introspects your GraphQL schema and exposes each query and mutation as an individual tool, letting Claude interact with your API directly.2521MIT
- AlicenseNot gradedqualityDmaintenanceA generic MCP server that converts .graphql query files into tools for Claude, enabling interaction with any GraphQL API without coding.MIT
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for AI access to Swagger by SmartBear.
MCP server for AI access to SmartBear tools, including BugSnag, Reflect, Swagger, PactFlow, QTM4J.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mabdullah679/apollo-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server