Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use a Node.js base image that supports bun installation
FROM node:18-alpine as builder

# Install bun
RUN npm install -g bun

# Set the working directory
WORKDIR /app

# Copy package and lock files
COPY package.json bun.lockb ./

# Install dependencies using bun
RUN bun install

# Copy the rest of the application
COPY . .

# Build the application
RUN bun run build

# Create a release image
FROM node:18-alpine

# Install bun
RUN npm install -g bun
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The runner image doesn't need bun


# Set the working directory
WORKDIR /app

# Copy built files from builder
COPY --from=builder /app/dist /app/dist

# Set the command to run the server
ENTRYPOINT ["node", "/app/dist/index.js"]
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# mcp-graphql

[![smithery badge](https://smithery.ai/badge/mcp-graphql)](https://smithery.ai/server/mcp-graphql)
Model Context Protocol server for working with GraphQL servers. It's a simple implementation using an introspection query to read the schema and one tool to query your server.

<a href="https://glama.ai/mcp/servers/4zwa4l8utf"><img width="380" height="200" src="https://glama.ai/mcp/servers/4zwa4l8utf/badge" alt="mcp-graphql MCP server" /></a>
Expand All @@ -12,6 +13,15 @@ Run `mcp-graphql` with the correct endpoint, it will automatically try to intros
mcp-graphql --endpoint http://localhost:3000/graphql --headers '{"X-Custom-Header":"foobar"}'
```

### Installing via Smithery

To install GraphQL MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mcp-graphql):

```bash
npx -y @smithery/cli install mcp-graphql --client claude
```

### Installing Manually
It can be manually installed to Claude:
```json
{
Expand Down Expand Up @@ -47,3 +57,4 @@ To build:
```bash
bun run build
```

20 changes: 20 additions & 0 deletions smithery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml

startCommand:
type: stdio
configSchema:
# JSON Schema defining the configuration options for the MCP.
type: object
required:
- endpoint
properties:
endpoint:
type: string
description: The GraphQL server endpoint URL.
headers:
type: string
description: Optional JSON string of headers to send with the GraphQL requests.
commandFunction:
# A function that produces the CLI command to start the MCP on stdio.
|-
(config) => ({ command: 'node', args: ['/app/dist/index.js', '--endpoint', config.endpoint].concat(config.headers ? ['--headers', config.headers] : []), env: {} })