Skip to content

Deployment: Dockerfile and Smithery config #300

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

Merged
merged 4 commits into from
May 8, 2025
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
27 changes: 27 additions & 0 deletions packages/mcp/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
8 changes: 8 additions & 0 deletions packages/mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ The Sourcebot MCP server enables precise regular expression code search across r
}
```
</details>
<br/>

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
```

<br/>

4. Tell your LLM to `use sourcebot` when prompting.
Expand Down
24 changes: 24 additions & 0 deletions packages/mcp/smithery.yaml
Original file line number Diff line number Diff line change
@@ -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