diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..68c758e --- /dev/null +++ b/Dockerfile @@ -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 + +# 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"] diff --git a/README.md b/README.md index 3e29eb4..d0ed0a0 100644 --- a/README.md +++ b/README.md @@ -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. mcp-graphql MCP server @@ -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 { @@ -47,3 +57,4 @@ To build: ```bash bun run build ``` + diff --git a/smithery.yaml b/smithery.yaml new file mode 100644 index 0000000..d480d52 --- /dev/null +++ b/smithery.yaml @@ -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: {} }) \ No newline at end of file