From 6cd6d69817161e1d5c1168c9dbe5540894658073 Mon Sep 17 00:00:00 2001
From: "smithery-ai[bot]" <194235850+smithery-ai[bot]@users.noreply.github.com>
Date: Thu, 8 May 2025 09:54:36 -0700
Subject: [PATCH] [packages/mcp] deployment: Dockerfile and Smithery config
(#300)
---
packages/mcp/Dockerfile | 27 +++++++++++++++++++++++++++
packages/mcp/README.md | 8 ++++++++
packages/mcp/smithery.yaml | 24 ++++++++++++++++++++++++
3 files changed, 59 insertions(+)
create mode 100644 packages/mcp/Dockerfile
create mode 100644 packages/mcp/smithery.yaml
diff --git a/packages/mcp/Dockerfile b/packages/mcp/Dockerfile
new file mode 100644
index 00000000..8e72653d
--- /dev/null
+++ b/packages/mcp/Dockerfile
@@ -0,0 +1,27 @@
+# Generated by https://smithery.ai. See: https://smithery.ai/docs/build/project-config
+# syntax=docker/dockerfile:1
+
+# Builder stage
+FROM node:lts-alpine AS builder
+WORKDIR /app
+
+# Install dependencies and build
+COPY package.json tsconfig.json ./
+COPY src ./src
+RUN npm install
+RUN npm run build
+
+# Final stage
+FROM node:lts-alpine
+WORKDIR /app
+
+# Install only production dependencies
+COPY package.json ./
+RUN npm install --production
+
+# Copy built artifacts
+COPY --from=builder /app/dist ./dist
+
+# Expose no specific port since this is stdio MCP server
+# Default command
+CMD ["node", "dist/index.js"]
diff --git a/packages/mcp/README.md b/packages/mcp/README.md
index 9b3e9043..50dbb814 100644
--- a/packages/mcp/README.md
+++ b/packages/mcp/README.md
@@ -146,6 +146,14 @@ The Sourcebot MCP server enables precise regular expression code search across r
}
```
+
+
+ Alternatively, you can install using via [Smithery](https://smithery.ai/server/@sourcebot-dev/sourcebot). For example:
+
+ ```bash
+ npx -y @smithery/cli install @sourcebot-dev/sourcebot --client claude
+ ```
+
4. Tell your LLM to `use sourcebot` when prompting.
diff --git a/packages/mcp/smithery.yaml b/packages/mcp/smithery.yaml
new file mode 100644
index 00000000..06974cba
--- /dev/null
+++ b/packages/mcp/smithery.yaml
@@ -0,0 +1,24 @@
+# Smithery configuration file: https://smithery.ai/docs/build/project-config
+
+startCommand:
+ type: stdio
+ configSchema:
+ # JSON Schema defining the configuration options for the MCP.
+ type: object
+ required: []
+ properties:
+ sourcebotHost:
+ type: string
+ description: Optional URL of the Sourcebot server (e.g., http://localhost:3000).
+ commandFunction:
+ # A JS function that produces the CLI command based on the given config to start the MCP on stdio.
+ |-
+ (config) => {
+ const env = {};
+ if (config.sourcebotHost) {
+ env.SOURCEBOT_HOST = config.sourcebotHost;
+ }
+ return { command: 'node', args: ['dist/index.js'], env };
+ }
+ exampleConfig:
+ sourcebotHost: http://localhost:3000