
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
An MCP (Model Context Protocol) server that enables interaction with GraphQL APIs.
MCP GraphQL is a tool that implements the Model Context Protocol (MCP) to provide a standardized interface for interacting with GraphQL APIs. It automatically exposes each GraphQL query as a separate MCP tool, allowing MCP-compatible clients to seamlessly communicate with GraphQL services.
When using uv
no specific installation is needed. We will
use uvx
to directly run mcp-graphql.
Alternatively you can install mcp-graphql
via pip:
pip install mcp-graphql
git clone https://github.com/your-username/mcp_graphql.git
cd mcp_graphql
pip install .
Using uvx:
uvx mcp-graphql --api-url="https://api.example.com/graphql" --auth-token="your-token"
Using pip installation:
mcp-graphql --api-url="https://api.example.com/graphql" --auth-token="your-token"
or
python -m mcp_graphql --api-url="https://api.example.com/graphql" --auth-token="your-token"
--api-url
: GraphQL API URL (required)--auth-token
: Authentication token (optional)--auth-type
: Authentication type, default is "Bearer" (optional)--auth-headers
: Custom authentication headers in JSON format (optional)Example with custom headers:
mcp-graphql --api-url="https://api.example.com/graphql" --auth-headers='{"Authorization": "Bearer token", "X-API-Key": "key"}'
import asyncio
from mcp_graphql import serve
auth_headers = {"Authorization": "Bearer your-token"}
api_url = "https://api.example.com/graphql"
asyncio.run(serve(api_url, auth_headers))
Add to your Claude settings:
"mcpServers": {
"graphql": {
"command": "uvx",
"args": ["mcp-graphql", "--api-url", "https://api.example.com/graphql"]
}
}
"mcpServers": {
"graphql": {
"command": "docker",
"args": ["run", "-i", "--rm", "mcp/graphql", "--api-url", "https://api.example.com/graphql"]
}
}
"mcpServers": {
"graphql": {
"command": "python",
"args": ["-m", "mcp_graphql", "--api-url", "https://api.example.com/graphql"]
}
}
MCP GraphQL automatically:
When a tool is called, the server:
# Create virtual environment using uv
uv venv
# Install dependencies
uv sync
ruff check .
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome. Please feel free to submit a Pull Request or open an Issue.
FAQs
Add your description here
We found that mcp-graphql demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.