# graphql-mcp
A library for automatically generating [FastMCP](https://pypi.org/project/fastmcp/) tools from a GraphQL schema.
This allows you to expose your GraphQL API as a set of tools that can be used by other systems, such as AI agents or other services that understand the MCP (Multi-Model-Protocol).
## Features
- **Automatic Tool Generation**: Converts GraphQL queries and mutations into callable Python functions.
- **Type-Safe**: Maps GraphQL scalar types, enums, and input objects to corresponding Python types.
- **`FastMCP` Integration**: Seamlessly adds the generated functions as tools to a `FastMCP` server instance.
- **Modern GraphQL Libraries**: Works with modern, code-first GraphQL libraries like `strawberry-graphql`.
- **Asynchronous Support**: While the tool generation is synchronous, the created tools execute GraphQL queries in a way that can be integrated into asynchronous applications.
- **Remote GraphQL Server Support**: Connect to any remote GraphQL endpoint and automatically generate MCP tools from its schema.
- **Bearer Token Authentication**: Built-in support for bearer token authentication with automatic token refresh capability.
- **Flexible Authentication**: Combine bearer tokens with additional headers for complex authentication scenarios.
- **Bearer Token Forwarding**: Forward MCP client bearer tokens to remote GraphQL servers for seamless authentication.
- **SSL/TLS Configuration**: Configurable SSL certificate verification for development and production environments.
- **Mutation Control**: Optionally disable mutations to create read-only tool interfaces for enhanced security.
- **Advanced Enum Handling**: Intelligent conversion between GraphQL enum names and values with nested structure support.
- **Nested Query Tools**: Automatic generation of MCP tools for nested GraphQL field chains with argument support.
- **Schema Introspection**: Automatic schema analysis for type-aware transformations and validation.
- **Variable Cleaning**: Smart handling of undefined variables and automatic query optimization.
- **Debug Mode**: Comprehensive logging and debugging capabilities for request/response analysis.
## Installation
You can install `graphql-mcp` using pip. To follow the usage example, you'll also need `strawberry-graphql`:
```bash
pip install graphql-mcp "strawberry-graphql[cli]"
```
## Usage with Strawberry
Here's a simple example of how to use `graphql-mcp` to create tools from a `strawberry-graphql` schema.
```python
# example.py
import asyncio
import strawberry
from fastmcp import FastMCP
from graphql_mcp.server import add_tools_from_schema
# 1. Define your GraphQL schema using Strawberry
@strawberry.type
class Query:
@strawberry.field
def hello(self, name: str = "World") -> str:
"""Returns a greeting."""
return f"Hello, {name}!"
@strawberry.type
class Mutation:
@strawberry.mutation
def send_message(self, message: str) -> str:
"""Prints a message and returns a confirmation."""
print(f"Received message: {message}")
return f"Message '{message}' sent successfully."
# The strawberry.Schema object is compatible with graphql-core's GraphQLSchema
schema = strawberry.Schema(query=Query, mutation=Mutation)
# 2. Create a FastMCP server instance
server = FastMCP(name="MyGraphQLServer")
# 3. Add tools from the schema
# The `strawberry.Schema` object can be passed directly.
add_tools_from_schema(schema, server)
# 4. Use the generated tools
async def main():
# You can inspect the tools
print("Available tools:", server.get_tool_names())
# You can also inspect a specific tool's signature
print("Tool 'hello' signature:", server.get_tool_signature("hello"))
# Call a query tool
result = await server.acall_tool("hello", name="Bob")
print("Query result:", result)
# Call a mutation tool
result = await server.acall_tool("send_message", message="This is a test")
print("Mutation result:", result)
if __name__ == "__main__":
asyncio.run(main())
```
When you run this script, you will see the following output:
```
Available tools: ['send_message', 'hello']
Tool 'hello' signature: (name: str = 'World') -> str
Query result: Hello, Bob!
Received message: This is a test
Mutation result: Message 'This is a test' sent successfully.
```
## Alternative Usage: `GraphQLMCP`
For convenience, you can also use the `GraphQLMCP` class, which inherits from `FastMCP` and provides class methods to create a server directly from a schema.
### From a `GraphQLSchema` object
You can use `GraphQLMCP.from_schema()` and pass any `graphql-core`-compatible `GraphQLSchema` object. This includes schemas created with `strawberry-graphql`.
### From a Remote GraphQL Server
You can connect to a remote GraphQL endpoint and automatically generate MCP tools from its schema:
```python
# example_remote_server.py
import asyncio
from graphql_mcp.server import GraphQLMCP
from fastmcp.client import Client
# Connect to a remote GraphQL server
server = GraphQLMCP.from_remote_url(
url="https://countries.trevorblades.com/", # Public GraphQL API
name="Countries API"
)
# With bearer token authentication
authenticated_server = GraphQLMCP.from_remote_url(
url="https://api.example.com/graphql",
bearer_token="YOUR_BEARER_TOKEN", # Bearer token authentication
timeout=60, # Custom timeout in seconds
name="Private API"
)
# With bearer token and additional headers
multi_auth_server = GraphQLMCP.from_remote_url(
url="https://api.example.com/graphql",
bearer_token="YOUR_BEARER_TOKEN",
headers={
"X-API-Key": "YOUR_API_KEY",
"X-Request-ID": "request-123"
},
timeout=60,
name="Multi-Auth API"
)
# With bearer token forwarding from MCP client
forwarding_server = GraphQLMCP.from_remote_url(
url="https://api.example.com/graphql",
forward_bearer_token=True, # Forward MCP client token to remote server
timeout=60,
name="Token Forwarding API"
)
# With SSL verification disabled (for development)
dev_server = GraphQLMCP.from_remote_url(
url="https://localhost:8000/graphql",
verify_ssl=False, # Disable SSL verification
debug=True, # Enable debug logging
name="Development API"
)
# With advanced configuration
advanced_server = GraphQLMCP.from_remote_url(
url="https://api.example.com/graphql",
bearer_token="YOUR_BEARER_TOKEN",
undefined_strategy="remove", # or "null" - how to handle undefined variables
debug=True, # Enable verbose logging
timeout=30,
name="Advanced API"
)
# Read-only server (queries only, no mutations)
readonly_server = GraphQLMCP.from_remote_url(
url="https://api.example.com/graphql",
bearer_token="YOUR_BEARER_TOKEN",
allow_mutations=False, # Disable mutations for security
name="Read-Only API"
)
# Use the server - all queries/mutations from the remote schema are now MCP tools
async def main():
async with Client(server) as client:
# List available tools
tools = await client.list_tools()
print(f"Available tools: {[tool.name for tool in tools]}")
# Call a tool (executes against the remote server)
# The actual tool names depend on the remote schema
# result = await client.call_tool("countries", {"filter": {"currency": {"eq": "USD"}}})
if __name__ == "__main__":
asyncio.run(main())
```
```python
# example_from_schema.py
import asyncio
import strawberry
from graphql_mcp.server import GraphQLMCP
# 1. Define your schema (e.g., with Strawberry)
@strawberry.type
class Query:
@strawberry.field
def hello(self, name: str = "World") -> str:
return f"Hello, {name}!"
schema = strawberry.Schema(query=Query)
# 2. Create the server from the schema
server = GraphQLMCP.from_schema(schema, name="MyGraphQLServer")
# 3. Create a read-only server (queries only)
readonly_server = GraphQLMCP.from_schema(
schema,
allow_mutations=False, # Disable mutations
name="ReadOnlyGraphQLServer"
)
# 4. Use the server
async def main():
print("Available tools:", server.get_tool_names())
result = await server.acall_tool("hello", name="From Schema")
print("Query result:", result)
if __name__ == "__main__":
asyncio.run(main())
```
### From a `graphql-api` object
If you are using the `graphql-api` library, you can use the `GraphQLMCP.from_api()` method.
```python
# example_from_api.py
import asyncio
from graphql_api import GraphQLAPI, field
from graphql_mcp.server import GraphQLMCP, HAS_GRAPHQL_API
# The .from_graphql_api() method is only available if `graphql-api` is installed.
if HAS_GRAPHQL_API:
# 1. Define your API using `graphql-api`
class MyAPI:
@field
def hello(self, name: str = "World") -> str:
return f"Hello, {name}!"
api = GraphQLAPI(roottype=MyAPI)
# 2. Create the server from the API object
server = GraphQLMCP.from_graphql_api(api)
# 3. Use the server
async def main():
print("Available tools:", server.get_tool_names())
result = await server.acall_tool("hello", name="From API")
print("Query result:", result)
if __name__ == "__main__":
asyncio.run(main())
```
## Advanced Features
### Bearer Token Forwarding
When using `forward_bearer_token=True`, the server will automatically forward the MCP client's bearer token to the remote GraphQL server. This enables seamless authentication chains where the MCP client's credentials are passed through to the backend GraphQL API.
```python
# The MCP client's bearer token will be forwarded to the remote GraphQL server
server = GraphQLMCP.from_remote_url(
url="https://api.example.com/graphql",
forward_bearer_token=True,
name="Forwarding Server"
)
```
**Security Note**: Only enable bearer token forwarding when you trust the remote GraphQL server with your MCP client's credentials.
### Undefined Variable Handling
GraphQL-MCP provides sophisticated handling of undefined variables through the `undefined_strategy` parameter:
- `"remove"` (default): Removes undefined variables from the query and variable declarations
- `"null"`: Converts undefined values to null
```python
server = GraphQLMCP.from_remote_url(
url="https://api.example.com/graphql",
undefined_strategy="remove", # Clean undefined variables
name="Clean Variables Server"
)
```
### Debug Mode
Enable comprehensive logging to troubleshoot GraphQL requests and responses:
```python
server = GraphQLMCP.from_remote_url(
url="https://api.example.com/graphql",
debug=True, # Enable verbose logging
name="Debug Server"
)
```
### SSL Configuration
For development or internal APIs, you can disable SSL certificate verification:
```python
server = GraphQLMCP.from_remote_url(
url="https://localhost:8000/graphql",
verify_ssl=False, # Only for development!
name="Local Development Server"
)
```
### Nested Query Tools
GraphQL-MCP automatically generates MCP tools for nested GraphQL field chains. For example, if your schema has:
```graphql
type Query {
user(id: ID!): User
}
type User {
profile: Profile
}
type Profile {
settings(category: String): Settings
}
```
The following MCP tools will be generated:
- `user` - Gets a user by ID
- `user_profile` - Gets a user's profile
- `user_profile_settings` - Gets profile settings with optional category filter
### Enum Handling
GraphQL-MCP intelligently handles GraphQL enums:
- **Input**: Accepts both enum values and names as input
- **Output**: Returns enum values for MCP compatibility
- **Schema**: Shows only enum values in MCP tool schemas (Pydantic-compatible)
- **Nested**: Handles enums in complex nested structures and arrays
## How It Works
`graphql-mcp` introspects your GraphQL schema's queries and mutations. For each field, it does the following:
1. **Creates a Python Function**: A wrapper function is generated that has a signature matching the GraphQL field's arguments.
2. **Handles Type Conversion**: It maps GraphQL types like `String`, `Int`, `ID`, and custom `Enum` types to their Python equivalents. Input objects are treated as dictionaries.
3. **Constructs a GraphQL Query**: When the generated function is called, it dynamically constructs the appropriate GraphQL query or mutation string.
4. **Executes the Query**: It uses `graphql-sync` to execute the query against the schema, passing in the provided arguments as variables.
5. **Returns the Result**: The data from the GraphQL response is returned.
The tool names are converted from `camelCase` (GraphQL convention) to `snake_case` (Python convention). For example, a mutation `sendMessage` becomes a tool named `send_message`.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "graphql_mcp",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.11",
"maintainer_email": null,
"keywords": "GraphQL, GraphQL-API, GraphQLAPI, Server, MCP, Multi-Model-Protocol",
"author": null,
"author_email": "Robert Parker <rob@parob.com>",
"download_url": "https://files.pythonhosted.org/packages/30/6f/a3526f348ac32c0ff3bac781cb787872a2379f3840dd5ec700780b2f60e4/graphql_mcp-1.3.24.tar.gz",
"platform": null,
"description": "# graphql-mcp\n\nA library for automatically generating [FastMCP](https://pypi.org/project/fastmcp/) tools from a GraphQL schema.\n\nThis allows you to expose your GraphQL API as a set of tools that can be used by other systems, such as AI agents or other services that understand the MCP (Multi-Model-Protocol).\n\n## Features\n\n- **Automatic Tool Generation**: Converts GraphQL queries and mutations into callable Python functions.\n- **Type-Safe**: Maps GraphQL scalar types, enums, and input objects to corresponding Python types.\n- **`FastMCP` Integration**: Seamlessly adds the generated functions as tools to a `FastMCP` server instance.\n- **Modern GraphQL Libraries**: Works with modern, code-first GraphQL libraries like `strawberry-graphql`.\n- **Asynchronous Support**: While the tool generation is synchronous, the created tools execute GraphQL queries in a way that can be integrated into asynchronous applications.\n- **Remote GraphQL Server Support**: Connect to any remote GraphQL endpoint and automatically generate MCP tools from its schema.\n- **Bearer Token Authentication**: Built-in support for bearer token authentication with automatic token refresh capability.\n- **Flexible Authentication**: Combine bearer tokens with additional headers for complex authentication scenarios.\n- **Bearer Token Forwarding**: Forward MCP client bearer tokens to remote GraphQL servers for seamless authentication.\n- **SSL/TLS Configuration**: Configurable SSL certificate verification for development and production environments.\n- **Mutation Control**: Optionally disable mutations to create read-only tool interfaces for enhanced security.\n- **Advanced Enum Handling**: Intelligent conversion between GraphQL enum names and values with nested structure support.\n- **Nested Query Tools**: Automatic generation of MCP tools for nested GraphQL field chains with argument support.\n- **Schema Introspection**: Automatic schema analysis for type-aware transformations and validation.\n- **Variable Cleaning**: Smart handling of undefined variables and automatic query optimization.\n- **Debug Mode**: Comprehensive logging and debugging capabilities for request/response analysis.\n\n## Installation\n\nYou can install `graphql-mcp` using pip. To follow the usage example, you'll also need `strawberry-graphql`:\n\n```bash\npip install graphql-mcp \"strawberry-graphql[cli]\"\n```\n\n## Usage with Strawberry\n\nHere's a simple example of how to use `graphql-mcp` to create tools from a `strawberry-graphql` schema.\n\n```python\n# example.py\nimport asyncio\nimport strawberry\nfrom fastmcp import FastMCP\nfrom graphql_mcp.server import add_tools_from_schema\n\n# 1. Define your GraphQL schema using Strawberry\n@strawberry.type\nclass Query:\n @strawberry.field\n def hello(self, name: str = \"World\") -> str:\n \"\"\"Returns a greeting.\"\"\"\n return f\"Hello, {name}!\"\n\n@strawberry.type\nclass Mutation:\n @strawberry.mutation\n def send_message(self, message: str) -> str:\n \"\"\"Prints a message and returns a confirmation.\"\"\"\n print(f\"Received message: {message}\")\n return f\"Message '{message}' sent successfully.\"\n\n# The strawberry.Schema object is compatible with graphql-core's GraphQLSchema\nschema = strawberry.Schema(query=Query, mutation=Mutation)\n\n# 2. Create a FastMCP server instance\nserver = FastMCP(name=\"MyGraphQLServer\")\n\n# 3. Add tools from the schema\n# The `strawberry.Schema` object can be passed directly.\nadd_tools_from_schema(schema, server)\n\n# 4. Use the generated tools\nasync def main():\n # You can inspect the tools\n print(\"Available tools:\", server.get_tool_names())\n\n # You can also inspect a specific tool's signature\n print(\"Tool 'hello' signature:\", server.get_tool_signature(\"hello\"))\n\n # Call a query tool\n result = await server.acall_tool(\"hello\", name=\"Bob\")\n print(\"Query result:\", result)\n\n # Call a mutation tool\n result = await server.acall_tool(\"send_message\", message=\"This is a test\")\n print(\"Mutation result:\", result)\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\nWhen you run this script, you will see the following output:\n\n```\nAvailable tools: ['send_message', 'hello']\nTool 'hello' signature: (name: str = 'World') -> str\nQuery result: Hello, Bob!\nReceived message: This is a test\nMutation result: Message 'This is a test' sent successfully.\n```\n\n## Alternative Usage: `GraphQLMCP`\n\nFor convenience, you can also use the `GraphQLMCP` class, which inherits from `FastMCP` and provides class methods to create a server directly from a schema.\n\n### From a `GraphQLSchema` object\n\nYou can use `GraphQLMCP.from_schema()` and pass any `graphql-core`-compatible `GraphQLSchema` object. This includes schemas created with `strawberry-graphql`.\n\n### From a Remote GraphQL Server\n\nYou can connect to a remote GraphQL endpoint and automatically generate MCP tools from its schema:\n\n```python\n# example_remote_server.py\nimport asyncio\nfrom graphql_mcp.server import GraphQLMCP\nfrom fastmcp.client import Client\n\n# Connect to a remote GraphQL server\nserver = GraphQLMCP.from_remote_url(\n url=\"https://countries.trevorblades.com/\", # Public GraphQL API\n name=\"Countries API\"\n)\n\n# With bearer token authentication\nauthenticated_server = GraphQLMCP.from_remote_url(\n url=\"https://api.example.com/graphql\",\n bearer_token=\"YOUR_BEARER_TOKEN\", # Bearer token authentication\n timeout=60, # Custom timeout in seconds\n name=\"Private API\"\n)\n\n# With bearer token and additional headers\nmulti_auth_server = GraphQLMCP.from_remote_url(\n url=\"https://api.example.com/graphql\",\n bearer_token=\"YOUR_BEARER_TOKEN\",\n headers={\n \"X-API-Key\": \"YOUR_API_KEY\",\n \"X-Request-ID\": \"request-123\"\n },\n timeout=60,\n name=\"Multi-Auth API\"\n)\n\n# With bearer token forwarding from MCP client\nforwarding_server = GraphQLMCP.from_remote_url(\n url=\"https://api.example.com/graphql\",\n forward_bearer_token=True, # Forward MCP client token to remote server\n timeout=60,\n name=\"Token Forwarding API\"\n)\n\n# With SSL verification disabled (for development)\ndev_server = GraphQLMCP.from_remote_url(\n url=\"https://localhost:8000/graphql\",\n verify_ssl=False, # Disable SSL verification\n debug=True, # Enable debug logging\n name=\"Development API\"\n)\n\n# With advanced configuration\nadvanced_server = GraphQLMCP.from_remote_url(\n url=\"https://api.example.com/graphql\",\n bearer_token=\"YOUR_BEARER_TOKEN\",\n undefined_strategy=\"remove\", # or \"null\" - how to handle undefined variables\n debug=True, # Enable verbose logging\n timeout=30,\n name=\"Advanced API\"\n)\n\n# Read-only server (queries only, no mutations)\nreadonly_server = GraphQLMCP.from_remote_url(\n url=\"https://api.example.com/graphql\",\n bearer_token=\"YOUR_BEARER_TOKEN\",\n allow_mutations=False, # Disable mutations for security\n name=\"Read-Only API\"\n)\n\n# Use the server - all queries/mutations from the remote schema are now MCP tools\nasync def main():\n async with Client(server) as client:\n # List available tools\n tools = await client.list_tools()\n print(f\"Available tools: {[tool.name for tool in tools]}\")\n\n # Call a tool (executes against the remote server)\n # The actual tool names depend on the remote schema\n # result = await client.call_tool(\"countries\", {\"filter\": {\"currency\": {\"eq\": \"USD\"}}})\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\n```python\n# example_from_schema.py\nimport asyncio\nimport strawberry\nfrom graphql_mcp.server import GraphQLMCP\n\n# 1. Define your schema (e.g., with Strawberry)\n@strawberry.type\nclass Query:\n @strawberry.field\n def hello(self, name: str = \"World\") -> str:\n return f\"Hello, {name}!\"\n\nschema = strawberry.Schema(query=Query)\n\n# 2. Create the server from the schema\nserver = GraphQLMCP.from_schema(schema, name=\"MyGraphQLServer\")\n\n# 3. Create a read-only server (queries only)\nreadonly_server = GraphQLMCP.from_schema(\n schema,\n allow_mutations=False, # Disable mutations\n name=\"ReadOnlyGraphQLServer\"\n)\n\n# 4. Use the server\nasync def main():\n print(\"Available tools:\", server.get_tool_names())\n result = await server.acall_tool(\"hello\", name=\"From Schema\")\n print(\"Query result:\", result)\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\n### From a `graphql-api` object\n\nIf you are using the `graphql-api` library, you can use the `GraphQLMCP.from_api()` method.\n\n```python\n# example_from_api.py\nimport asyncio\nfrom graphql_api import GraphQLAPI, field\nfrom graphql_mcp.server import GraphQLMCP, HAS_GRAPHQL_API\n\n# The .from_graphql_api() method is only available if `graphql-api` is installed.\nif HAS_GRAPHQL_API:\n # 1. Define your API using `graphql-api`\n class MyAPI:\n @field\n def hello(self, name: str = \"World\") -> str:\n return f\"Hello, {name}!\"\n\n api = GraphQLAPI(roottype=MyAPI)\n\n # 2. Create the server from the API object\n server = GraphQLMCP.from_graphql_api(api)\n\n # 3. Use the server\n async def main():\n print(\"Available tools:\", server.get_tool_names())\n result = await server.acall_tool(\"hello\", name=\"From API\")\n print(\"Query result:\", result)\n\n if __name__ == \"__main__\":\n asyncio.run(main())\n```\n\n## Advanced Features\n\n### Bearer Token Forwarding\n\nWhen using `forward_bearer_token=True`, the server will automatically forward the MCP client's bearer token to the remote GraphQL server. This enables seamless authentication chains where the MCP client's credentials are passed through to the backend GraphQL API.\n\n```python\n# The MCP client's bearer token will be forwarded to the remote GraphQL server\nserver = GraphQLMCP.from_remote_url(\n url=\"https://api.example.com/graphql\",\n forward_bearer_token=True,\n name=\"Forwarding Server\"\n)\n```\n\n**Security Note**: Only enable bearer token forwarding when you trust the remote GraphQL server with your MCP client's credentials.\n\n### Undefined Variable Handling\n\nGraphQL-MCP provides sophisticated handling of undefined variables through the `undefined_strategy` parameter:\n\n- `\"remove\"` (default): Removes undefined variables from the query and variable declarations\n- `\"null\"`: Converts undefined values to null\n\n```python\nserver = GraphQLMCP.from_remote_url(\n url=\"https://api.example.com/graphql\",\n undefined_strategy=\"remove\", # Clean undefined variables\n name=\"Clean Variables Server\"\n)\n```\n\n### Debug Mode\n\nEnable comprehensive logging to troubleshoot GraphQL requests and responses:\n\n```python\nserver = GraphQLMCP.from_remote_url(\n url=\"https://api.example.com/graphql\",\n debug=True, # Enable verbose logging\n name=\"Debug Server\"\n)\n```\n\n### SSL Configuration\n\nFor development or internal APIs, you can disable SSL certificate verification:\n\n```python\nserver = GraphQLMCP.from_remote_url(\n url=\"https://localhost:8000/graphql\",\n verify_ssl=False, # Only for development!\n name=\"Local Development Server\"\n)\n```\n\n### Nested Query Tools\n\nGraphQL-MCP automatically generates MCP tools for nested GraphQL field chains. For example, if your schema has:\n\n```graphql\ntype Query {\n user(id: ID!): User\n}\n\ntype User {\n profile: Profile\n}\n\ntype Profile {\n settings(category: String): Settings\n}\n```\n\nThe following MCP tools will be generated:\n- `user` - Gets a user by ID\n- `user_profile` - Gets a user's profile\n- `user_profile_settings` - Gets profile settings with optional category filter\n\n### Enum Handling\n\nGraphQL-MCP intelligently handles GraphQL enums:\n- **Input**: Accepts both enum values and names as input\n- **Output**: Returns enum values for MCP compatibility\n- **Schema**: Shows only enum values in MCP tool schemas (Pydantic-compatible)\n- **Nested**: Handles enums in complex nested structures and arrays\n\n## How It Works\n\n`graphql-mcp` introspects your GraphQL schema's queries and mutations. For each field, it does the following:\n\n1. **Creates a Python Function**: A wrapper function is generated that has a signature matching the GraphQL field's arguments.\n2. **Handles Type Conversion**: It maps GraphQL types like `String`, `Int`, `ID`, and custom `Enum` types to their Python equivalents. Input objects are treated as dictionaries.\n3. **Constructs a GraphQL Query**: When the generated function is called, it dynamically constructs the appropriate GraphQL query or mutation string.\n4. **Executes the Query**: It uses `graphql-sync` to execute the query against the schema, passing in the provided arguments as variables.\n5. **Returns the Result**: The data from the GraphQL response is returned.\n\nThe tool names are converted from `camelCase` (GraphQL convention) to `snake_case` (Python convention). For example, a mutation `sendMessage` becomes a tool named `send_message`.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A framework for building Python GraphQL MCP servers.",
"version": "1.3.24",
"project_urls": {
"Homepage": "https://gitlab.com/parob/graphql-mcp",
"Repository": "https://gitlab.com/parob/graphql-mcp"
},
"split_keywords": [
"graphql",
" graphql-api",
" graphqlapi",
" server",
" mcp",
" multi-model-protocol"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "32d7005640e088d6121ee2d48b65e28b5810801655091708ce8d9ce953a304aa",
"md5": "3fa751f07f75b50860de3dcce5d3375f",
"sha256": "e9b5dc7c44517cbfe1bed3f2ea2a40ec4b390c3acb476e06fa6b771956fbc8e1"
},
"downloads": -1,
"filename": "graphql_mcp-1.3.24-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3fa751f07f75b50860de3dcce5d3375f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.11",
"size": 26235,
"upload_time": "2025-09-02T21:58:25",
"upload_time_iso_8601": "2025-09-02T21:58:25.397018Z",
"url": "https://files.pythonhosted.org/packages/32/d7/005640e088d6121ee2d48b65e28b5810801655091708ce8d9ce953a304aa/graphql_mcp-1.3.24-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "306fa3526f348ac32c0ff3bac781cb787872a2379f3840dd5ec700780b2f60e4",
"md5": "d53d0eae2a75ec5520ec500b2cb7f2a2",
"sha256": "9128b3825c0b4d9ae7b02eb0d7779fb0d57eb247aa5e149242f50337f2b263d6"
},
"downloads": -1,
"filename": "graphql_mcp-1.3.24.tar.gz",
"has_sig": false,
"md5_digest": "d53d0eae2a75ec5520ec500b2cb7f2a2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.11",
"size": 148508,
"upload_time": "2025-09-02T21:58:26",
"upload_time_iso_8601": "2025-09-02T21:58:26.338209Z",
"url": "https://files.pythonhosted.org/packages/30/6f/a3526f348ac32c0ff3bac781cb787872a2379f3840dd5ec700780b2f60e4/graphql_mcp-1.3.24.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-02 21:58:26",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "parob",
"gitlab_project": "graphql-mcp",
"lcname": "graphql_mcp"
}