-
Notifications
You must be signed in to change notification settings - Fork 43
feat: add smithery config #263
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
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
fd0a38e
feat: add smithery config
nirinchev f07d9e8
indent yaml
nirinchev ba5c16c
more yaml fixes
nirinchev ec2643b
move things around, add entrypoint.sh
nirinchev 463405c
another attempt
nirinchev 3b07c85
more dockerfile tweaks
nirinchev f1e8c27
fix dockerfile
nirinchev e91e6a3
Merge branch 'main' into ni/smithery
nirinchev dacb1c2
remove connection string
nirinchev 8afc2ea
tweak dockerfile
nirinchev 8a54f66
update dockerfile
nirinchev 08a72b1
remove config
nirinchev 165440d
Merge branch 'main' into ni/smithery
nirinchev da40b72
tweak docker ignore
nirinchev b60d066
Add config parameters
nirinchev 873fc16
try using cli args
nirinchev 7c938d7
add example config
nirinchev 0d9d297
Remove workdir from runner
nirinchev d022bc3
Handle missing config
nirinchev 002a526
add a default
nirinchev db10416
Merge branch 'main' into ni/smithery
nirinchev 96bf17a
Update .smithery/Dockerfile
nirinchev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
dist | ||
node_modules | ||
.vscode | ||
.github | ||
.git | ||
# Environment variables | ||
.env | ||
|
||
tests | ||
coverage | ||
scripts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile | ||
# ----- Build Stage ----- | ||
FROM node:lts-alpine AS builder | ||
WORKDIR /app | ||
|
||
# Copy package and configuration | ||
COPY ../package.json ../package-lock.json ../tsconfig.json ../tsconfig.build.json ./ | ||
|
||
# Copy source code | ||
COPY ../src ./src | ||
|
||
# Install dependencies and build | ||
RUN npm ci && npm run build | ||
|
||
# ----- Production Stage ----- | ||
FROM node:lts-alpine | ||
|
||
# Copy built artifacts | ||
COPY --from=builder /app/dist ./dist | ||
|
||
# Copy package.json for production install | ||
COPY ../package.json ../package-lock.json ./ | ||
|
||
# Install only production dependencies | ||
RUN npm ci --production --ignore-scripts | ||
|
||
# Expose no ports (stdio only) | ||
|
||
# Default command | ||
CMD ["node", "dist/index.js"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Smithery.ai configuration | ||
build: | ||
dockerfile: Dockerfile | ||
dockerBuildPath: ../ | ||
startCommand: | ||
type: stdio | ||
configSchema: | ||
type: object | ||
properties: | ||
atlasClientId: | ||
type: string | ||
title: Atlas Client Id | ||
description: Atlas API client ID for authentication. Required for running Atlas tools. | ||
atlasClientSecret: | ||
type: string | ||
title: Atlas Client Secret | ||
description: Atlas API client secret for authentication. Required for running Atlas tools. | ||
connectionString: | ||
type: string | ||
title: MongoDB Connection string | ||
description: MongoDB connection string for direct database connections. Optional, if not set, you'll need to call the `connect` tool before interacting with MongoDB data. | ||
readOnly: | ||
type: boolean | ||
title: Read-only | ||
description: When set to true, only allows read and metadata operation types, disabling create/update/delete operations. | ||
default: false | ||
exampleConfig: | ||
atlasClientId: YOUR_ATLAS_CLIENT_ID | ||
atlasClientSecret: YOUR_ATLAS_CLIENT_SECRET | ||
connectionString: mongodb+srv://USERNAME:PASSWORD@YOUR_CLUSTER.mongodb.net | ||
readOnly: true | ||
|
||
commandFunction: | ||
# A function that produces the CLI command to start the MCP on stdio. | ||
|- | ||
(config) => { | ||
const args = ['dist/index.js']; | ||
if (config) { | ||
if (config.atlasClientId) { | ||
args.push('--apiClientId'); | ||
args.push(config.atlasClientId); | ||
} | ||
|
||
if (config.atlasClientSecret) { | ||
args.push('--apiClientSecret'); | ||
args.push(config.atlasClientSecret); | ||
} | ||
|
||
if (config.readOnly) { | ||
args.push('--readOnly'); | ||
} | ||
|
||
if (config.connectionString) { | ||
args.push('--connectionString'); | ||
args.push(config.connectionString); | ||
} | ||
} | ||
|
||
return { | ||
command: "node", | ||
args | ||
}; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referencing
../
in COPY may fall outside the Docker build context and fail. Use paths relative to the context (e.g.,COPY package.json package-lock.json tsconfig.json tsconfig.build.json ./
).Copilot uses AI. Check for mistakes.