mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 12:25:22 +00:00
[packages/mcp] deployment: Dockerfile and Smithery config (#300)
This commit is contained in:
parent
19ee70ea68
commit
6cd6d69817
3 changed files with 59 additions and 0 deletions
27
packages/mcp/Dockerfile
Normal file
27
packages/mcp/Dockerfile
Normal file
|
|
@ -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"]
|
||||||
|
|
@ -146,6 +146,14 @@ The Sourcebot MCP server enables precise regular expression code search across r
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
</details>
|
</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/>
|
<br/>
|
||||||
|
|
||||||
4. Tell your LLM to `use sourcebot` when prompting.
|
4. Tell your LLM to `use sourcebot` when prompting.
|
||||||
|
|
|
||||||
24
packages/mcp/smithery.yaml
Normal file
24
packages/mcp/smithery.yaml
Normal file
|
|
@ -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
|
||||||
Loading…
Reference in a new issue