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
Model Context Protocol server for working with GraphQL servers.
6
-
It's a simple implementation using an introspection query to read the schema and one tool to query your server.
7
-
8
-
For clients that do not support resources it also has an introspection tool call it will recommend to use first.
5
+
A Model Context Protocol server that enables LLMs to interact with GraphQL APIs. This implementation provides schema introspection and query execution capabilities, allowing models to discover and use GraphQL APIs dynamically.
Run `mcp-graphql` with the correct endpoint, it will automatically try to introspect your queries. You can optionally add a JSON string containing headers if needed.
10
+
11
+
Run `mcp-graphql` with the correct endpoint, it will automatically try to introspect your queries.
1.**introspect-schema**: This tool retrieves the GraphQL schema. Use this first if you don't have access to the schema as a resource.
44
+
This uses either the local schema file or an introspection query.
45
+
46
+
2.**query-graphql**: Execute GraphQL queries against the endpoint. By default, mutations are disabled unless `--enable-mutations` is specified.
47
+
48
+
## Resources
49
+
50
+
-**graphql-schema**: The server exposes the GraphQL schema as a resource that clients can access. This is either the local schema file or based on an introspection query.
51
+
52
+
## Installation
53
+
20
54
### Installing via Smithery
21
55
22
56
To install GraphQL MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mcp-graphql):
@@ -38,30 +73,10 @@ It can be manually installed to Claude:
38
73
}
39
74
```
40
75
41
-
### Enabling mutations
76
+
##Security Considerations
42
77
43
-
Mutations are disabled by default as to not allow an LLM to mutate your database or service. You can enable them by using `--enable-mutations` as a flag.
78
+
Mutations are disabled by default as a security measure to prevent an LLM from modifying your database or service data. Consider carefully before enabling mutations in production environments.
44
79
45
80
## Customize for your own server
46
-
This is a very generic implementation where it allows for complete introspection and for your users to do whatever (including mutations). If you need a more specific implementation I'd suggest to just create your own MCP and lock down tool calling for clients to only input specific query fields and/or variables. You can use this as a reference.
47
-
48
-
## Development
49
-
50
-
To install dependencies:
51
-
52
-
```bash
53
-
bun install
54
-
```
55
-
56
-
To run for development:
57
-
58
-
```bash
59
-
bun dev
60
-
```
61
-
62
-
To build:
63
-
64
-
```bash
65
-
bun run build
66
-
```
67
81
82
+
This is a very generic implementation where it allows for complete introspection and for your users to do whatever (including mutations). If you need a more specific implementation I'd suggest to just create your own MCP and lock down tool calling for clients to only input specific query fields and/or variables. You can use this as a reference.
0 commit comments