Skip to content

Commit 9555dcd

Browse files
committed
Merge branch 'main' of github.com:mongodb-js/mongodb-mcp-server into gagik/cjs-target
2 parents cce6ddb + 42837a4 commit 9555dcd

File tree

115 files changed

+9991
-2099
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+9991
-2099
lines changed

.github/workflows/accuracy-tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Accuracy Tests
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
types:
10+
- labeled
11+
12+
jobs:
13+
run-accuracy-tests:
14+
name: Run Accuracy Tests
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
pull-requests: write
19+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'accuracy-tests')
20+
env:
21+
MDB_OPEN_AI_API_KEY: ${{ secrets.ACCURACY_OPEN_AI_API_KEY }}
22+
MDB_GEMINI_API_KEY: ${{ secrets.ACCURACY_GEMINI_API_KEY }}
23+
MDB_AZURE_OPEN_AI_API_KEY: ${{ secrets.ACCURACY_AZURE_OPEN_AI_API_KEY }}
24+
MDB_AZURE_OPEN_AI_API_URL: ${{ vars.ACCURACY_AZURE_OPEN_AI_API_URL }}
25+
MDB_ACCURACY_MDB_URL: ${{ secrets.ACCURACY_MDB_CONNECTION_STRING }}
26+
MDB_ACCURACY_MDB_DB: ${{ vars.ACCURACY_MDB_DB }}
27+
MDB_ACCURACY_MDB_COLLECTION: ${{ vars.ACCURACY_MDB_COLLECTION }}
28+
MDB_ACCURACY_BASELINE_COMMIT: ${{ github.event.pull_request.base.sha || '' }}
29+
steps:
30+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
31+
- uses: actions/checkout@v4
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version-file: package.json
35+
cache: "npm"
36+
- name: Install dependencies
37+
run: npm ci
38+
- name: Run accuracy tests
39+
run: npm run test:accuracy
40+
- name: Upload accuracy test summary
41+
if: always()
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: accuracy-test-summary
45+
path: .accuracy/test-summary.html
46+
- name: Comment summary on PR
47+
if: github.event_name == 'pull_request' && github.event.label.name == 'accuracy-tests'
48+
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2
49+
with:
50+
# Hides the previous comment and add a comment at the end
51+
hide_and_recreate: true
52+
hide_classify: "OUTDATED"
53+
path: .accuracy/test-brief.md

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ jobs:
5555
rm -rf node_modules
5656
npm pkg set scripts.prepare="exit 0"
5757
npm install --omit=dev
58-
- run: npx -y @modelcontextprotocol/inspector --cli --method tools/list -- node dist/esm/index.js --connectionString "mongodb://localhost"
58+
- run: npx -y @modelcontextprotocol/inspector --cli --method tools/list -- node dist/esm/index.js"

.github/workflows/code_health_fork.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,3 @@ jobs:
3434
with:
3535
name: test-results
3636
path: coverage/lcov.info
37-
38-
merge-dependabot-pr:
39-
name: Merge Dependabot PR
40-
if: github.event.pull_request.user.login == 'dependabot[bot]'
41-
runs-on: ubuntu-latest
42-
permissions:
43-
pull-requests: write
44-
contents: write
45-
steps:
46-
- name: Enable auto-merge for Dependabot PRs
47-
run: gh pr merge --auto --squash "$PR_URL"
48-
env:
49-
PR_URL: ${{github.event.pull_request.html_url}}
50-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/dependabot_pr.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Dependabot PR
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
branches:
7+
- main
8+
9+
permissions: {}
10+
11+
jobs:
12+
merge-dependabot-pr:
13+
name: Merge Dependabot PR
14+
if: github.event.pull_request.user.login == 'dependabot[bot]'
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: mongodb-js/devtools-shared/actions/setup-bot-token@main
18+
id: app-token
19+
with:
20+
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
21+
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}
22+
- name: Enable auto-merge for Dependabot PRs
23+
run: gh pr merge --auto --squash "$PR_URL"
24+
env:
25+
PR_URL: ${{github.event.pull_request.html_url}}
26+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

.github/workflows/docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Docker Buildx
1919
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
2020
- name: Login to Docker Hub
21-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
21+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1
2222
with:
2323
username: "${{ secrets.DOCKERHUB_USERNAME }}"
2424
password: "${{ secrets.DOCKERHUB_PASSWORD }}"

.github/workflows/jira-issue.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
name: Create JIRA ticket for new issues
3+
4+
on:
5+
issues:
6+
types: [opened, labeled]
7+
8+
permissions:
9+
issues: write
10+
contents: read
11+
12+
jobs:
13+
jira_task:
14+
name: Create Jira issue
15+
runs-on: ubuntu-latest
16+
if: github.event.action == 'opened' || github.event.label.name == 'create-jira'
17+
steps:
18+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
19+
with:
20+
config: ${{ vars.PERMISSIONS_CONFIG }}
21+
22+
- name: Create JIRA ticket
23+
uses: mongodb/apix-action/create-jira@v12
24+
id: create
25+
continue-on-error: true
26+
with:
27+
token: ${{ secrets.JIRA_API_TOKEN }}
28+
project-key: MCP
29+
summary: "HELP: GitHub Issue n. ${{ github.event.issue.number }}"
30+
issuetype: Bug
31+
description: "This ticket tracks the following GitHub issue: ${{ github.event.issue.html_url }}."
32+
extra-data: |
33+
{
34+
"fields": {
35+
"customfield_12751": [
36+
{
37+
"id": "27247"
38+
},
39+
{
40+
"id": "27326"
41+
}
42+
]
43+
}
44+
}
45+
- name: Show result
46+
run: |
47+
echo "JIRA action result: ${{ steps.create.outputs.issue-key || 'FAILED' }}"
48+
49+
- name: Add comment
50+
if: steps.create.outputs.issue-key
51+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
52+
with:
53+
issue-number: ${{ github.event.issue.number }}
54+
body: |
55+
Thanks for opening this issue. The ticket [${{ steps.create.outputs.issue-key }}](https://jira.mongodb.org/browse/${{ steps.create.outputs.issue-key }}) was created for internal tracking.
56+
57+
- name: Remove create-jira label
58+
if: github.event.action == 'labeled' && github.event.label.name == 'create-jira'
59+
uses: actions/github-script@v7
60+
with:
61+
script: |
62+
try {
63+
await github.rest.issues.removeLabel({
64+
owner: context.repo.owner,
65+
repo: context.repo.repo,
66+
issue_number: context.issue.number,
67+
name: 'create-jira'
68+
});
69+
console.log('✅ Removed create-jira label');
70+
} catch (error) {
71+
console.log('⚠️ Could not remove create-jira label:', error.message);
72+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ state.json
1111

1212
tests/tmp
1313
coverage
14+
# Generated assets by accuracy runs
15+
.accuracy

.vscode/launch.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"name": "Launch Program",
2020
"skipFiles": ["<node_internals>/**"],
2121
"program": "${workspaceFolder}/dist/esm/index.js",
22+
"runtimeExecutable": "npm",
23+
"runtimeArgs": ["start"],
2224
"preLaunchTask": "tsc: build - tsconfig.build.json",
2325
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
2426
}

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ RUN addgroup -S mcp && adduser -S mcp -G mcp
44
RUN npm install -g mongodb-mcp-server@${VERSION}
55
USER mcp
66
WORKDIR /home/mcp
7+
ENV MDB_MCP_LOGGERS=stderr,mcp
78
ENTRYPOINT ["mongodb-mcp-server"]
89
LABEL maintainer="MongoDB Inc <[email protected]>"
910
LABEL description="MongoDB MCP Server"

0 commit comments

Comments
 (0)