diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d083331 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile +# Use the official lightweight Node.js image +FROM node:20-alpine AS base + +# Set working directory +WORKDIR /app + +# Copy pnpm-lock.yaml and .npmrc (if exists) +COPY pnpm-lock.yaml ./ + +# Install pnpm +RUN npm install -g pnpm + +# Copy package.json and tsconfig.json +COPY examples/simple-server/package.json examples/simple-server/tsconfig.json ./ + +# Install dependencies +RUN pnpm install --frozen-lockfile + +# Copy the source files +COPY examples/simple-server/index.ts ./ + +# Use tsx to run the server +CMD ["pnpm", "run", "start"] diff --git a/README.md b/README.md index 73eb561..0fbc7d0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Remote-MCP: Remote Model Context Protocol +[![smithery badge](https://smithery.ai/badge/@remote-mcp/server)](https://smithery.ai/server/@remote-mcp/protocol) + A **type-safe, bidirectional and simple** solution for **remote MCP communication**, allowing remote access and centralized management of model contexts. ![preview](https://github.com/user-attachments/assets/a16804b9-8378-493c-8ca8-f61839458cde) @@ -114,6 +116,14 @@ You can see some examples in the `examples` directory. - [Cloudflare Workers](examples/cloudflare-workers) - [Standalone Node.js](examples/simple-server) +### Installing via Smithery + +To install Remote MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/protocol): + +```bash +npx -y @smithery/cli install @remote-mcp/protocol --client claude +``` + ### Code Your Own Remote MCP Server After `npm install @remote-mcp/server`, you can your own remote MCP server like the following: diff --git a/smithery.yaml b/smithery.yaml new file mode 100644 index 0000000..ca65b95 --- /dev/null +++ b/smithery.yaml @@ -0,0 +1,23 @@ +# Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml + +build: + dockerBuildPath: examples/simple-server +startCommand: + type: stdio + configSchema: + # JSON Schema defining the configuration options for the MCP. + type: object + required: + - remoteMcpUrl + - authorizationToken + properties: + remoteMcpUrl: + type: string + description: The URL of the remote MCP server. + authorizationToken: + type: string + description: The authorization token for accessing the remote MCP server. + commandFunction: + # A function that produces the CLI command to start the MCP on stdio. + |- + (config) => ({ command: 'pnpm', args: ['run', 'start'], env: { REMOTE_MCP_URL: config.remoteMcpUrl, HTTP_HEADER__Authorization: `Bearer ${config.authorizationToken}` } })