You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set the transport to SSE in the inspector and the URL to `http://localhost:5000/sse`, then press "Connect" in MCP Inspector.
57
+
58
+
## MCP Client
59
+
60
+
You can use the MCP Server with your favorite MCP client.
61
+
62
+
### Client Configuration
22
63
23
64
For Claude Desktop, the configuration file is in the following location on MacOS:
24
65
@@ -28,7 +69,9 @@ For Claude Desktop, the configuration file is in the following location on MacOS
28
69
29
70
For Cursor, you can find the file by opening the MCP tab in Settings.
30
71
31
-
Add the following to this file, using the absolute path to this Git repo:
72
+
#### Stdio Transport
73
+
74
+
To use the stdio transport, add the following to the MCP configuration file for you client, using the absolute path to this Git repo:
32
75
33
76
```json
34
77
{
@@ -50,15 +93,38 @@ Add the following to this file, using the absolute path to this Git repo:
50
93
}
51
94
```
52
95
96
+
#### HTTP+SEE Transport
97
+
98
+
To use the HTTP+SSE transport, first start the MCP server as described above for MCP Inspector.
99
+
100
+
Set the following in the MCP configuration file for your client:
101
+
102
+
```json
103
+
{
104
+
"mcpServers": {
105
+
"weather": {
106
+
"command": "npx",
107
+
"args": [
108
+
"mcp-remote",
109
+
"http://127.0.0.1:5000/sse"
110
+
]
111
+
}
112
+
}
113
+
}
114
+
```
115
+
116
+
### Usage
117
+
53
118
Restart your AI agent. You should now see the tools successfully registered. For example, in Claude Desktop, you should see a small hammer icon with the number of tools next to it.
54
119
55
120
You can now issue prompts related to weather forecasts and alerts, which will call out to the tools and invoke the GraphQL operations.
56
121
57
122
**Note** that due to current limitations of Apollo Connectors, the schema is using a hard-coded weather forecast link, so the forecast will be for a fixed location.
58
123
124
+
59
125
# Running Your Own Graph
60
126
61
-
You can easily run the server with your own GraphQL schema and operations in the AI agent configuration file:
127
+
You can easily run the server with your own GraphQL schema and operations. For example with the stdio transport:
62
128
63
129
```json
64
130
{
@@ -84,4 +150,17 @@ The operation files are just `.graphql` files, with each file containing a singl
84
150
85
151
Run your schema in Apollo Router at the endpoint given in your configuration file.
86
152
87
-
In Claude Desktop, click the hammer icon to see the description generated for your tools.
153
+
Use MCP Inspector, or in Claude Desktop, click the hammer icon to see the description generated for your tools.
154
+
155
+
# Introspection
156
+
157
+
You can optionally enable support for allowing the AI model to introspect the schema and formulate its own queries. It is recommended that this only be done with a Contract variant schema, so you can control what parts of your schema are exposed to the model.
158
+
159
+
To enable this mode, add `--introspect` to the MCP server command line.
160
+
161
+
Two new tools will be exposed by the server:
162
+
163
+
*`schema` - returns the GraphQL schema
164
+
*`execute` - executes an operation on the GraphQL endpoint
165
+
166
+
The MCP client can then use these tools to provide schema information to the model, and allow the model to execute GraphQL operations based on that schema.
0 commit comments