Skip to content

Deployment: Dockerfile and Smithery config #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use an official Node.js image as a base for the build stage
FROM node:16 AS builder

# Set the working directory inside the container
WORKDIR /app

# Copy package manager lock file and package.json files
COPY pnpm-lock.yaml package.json ./

# Install dependencies
RUN npm install -g pnpm && pnpm install

# Copy the rest of the project files
COPY . .

# Build the project
RUN pnpm build

# Use a smaller Node.js image for the runtime environment
FROM node:16-slim

# Set the working directory inside the container
WORKDIR /app

# Copy built files and dependencies from the builder stage
COPY --from=builder /app ./

# Install only production dependencies
RUN pnpm install --prod

# Set the command to run the server
ENTRYPOINT ["npx", "openapi-mcp-server"]

# To run the server, you will need to provide the path to the OpenAPI JSON file as an argument
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ You can say:

2. **Restart Claude Desktop** and start interacting with your API!

### Installing via Smithery

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

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

## Examples

This repository includes a complete example of a Petstore API server that you can use to test the OpenAPI MCP Server. The example server implements a basic CRUD API for managing pets, making it perfect for learning how to use this tool.
Expand Down
17 changes: 17 additions & 0 deletions smithery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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:
- openApiJsonPath
properties:
openApiJsonPath:
type: string
description: The absolute path to the OpenAPI v3.1 JSON file.
commandFunction:
# A function that produces the CLI command to start the MCP on stdio.
|-
config => ({command: 'npx', args: ['openapi-mcp-server', config.openApiJsonPath]})