Skip to content
Open
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
7 changes: 4 additions & 3 deletions .github/workflows/accuracy-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ jobs:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
cache: "npm"
cache: "pnpm"
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Run accuracy tests
run: npm run test:accuracy
run: pnpm run test:accuracy
- name: Upload accuracy test summary
if: always()
uses: actions/upload-artifact@v5
Expand Down
25 changes: 14 additions & 11 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ jobs:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
cache: "npm"
cache: "pnpm"
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Run style check
run: npm run check
run: pnpm run check

check-generate:
runs-on: ubuntu-latest
Expand All @@ -35,13 +36,14 @@ jobs:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
cache: "npm"
cache: "pnpm"
- name: Install dependencies
run: npm ci
- run: npm run generate
run: pnpm install --frozen-lockfile
- run: pnpm run generate

check-dep:
name: Check dependencies
Expand All @@ -51,14 +53,15 @@ jobs:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
cache: "npm"
cache: "pnpm"
- name: Install dependencies, build and remove dev dependencies
run: |
npm ci
pnpm install --frozen-lockfile
rm -rf node_modules
npm pkg set scripts.prepare="exit 0"
npm install --omit=dev
- run: npx -y @modelcontextprotocol/inspector@0.16.5 --cli --method tools/list -- node dist/esm/index.js
pnpm pkg set scripts.prepare="exit 0"
pnpm install --prod --frozen-lockfile
- run: pnpm dlx @modelcontextprotocol/inspector@0.16.5 --cli --method tools/list -- node dist/esm/index.js
7 changes: 4 additions & 3 deletions .github/workflows/cleanup-atlas-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ jobs:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
cache: "npm"
cache: "pnpm"
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Run cleanup script
env:
MDB_MCP_API_CLIENT_ID: ${{ secrets.TEST_ATLAS_CLIENT_ID }}
MDB_MCP_API_CLIENT_SECRET: ${{ secrets.TEST_ATLAS_CLIENT_SECRET }}
MDB_MCP_API_BASE_URL: ${{ vars.TEST_ATLAS_BASE_URL }}
run: npm run atlas:cleanup
run: pnpm run atlas:cleanup
14 changes: 8 additions & 6 deletions .github/workflows/code-health-fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ jobs:
name: Setup Docker Environment
with:
set-host: true
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
cache: "npm"
cache: "pnpm"
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Run tests
run: npm test
run: pnpm test
env:
SKIP_ATLAS_TESTS: "true"
SKIP_ATLAS_LOCAL_TESTS: "true"
Expand All @@ -46,11 +47,12 @@ jobs:
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
cache: "npm"
cache: "pnpm"
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Run tests
run: npm test -- tests/integration/tools/atlas-local/
run: pnpm test -- tests/integration/tools/atlas-local/
7 changes: 4 additions & 3 deletions .github/workflows/code-health-long-running.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@ jobs:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
cache: "npm"
cache: "pnpm"
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Run tests
env:
MDB_MCP_API_CLIENT_ID: ${{ secrets.TEST_ATLAS_CLIENT_ID }}
MDB_MCP_API_CLIENT_SECRET: ${{ secrets.TEST_ATLAS_CLIENT_SECRET }}
MDB_MCP_API_BASE_URL: ${{ vars.TEST_ATLAS_BASE_URL }}
run: npm test -- tests/integration/tools/atlas --project=long-running-tests
run: pnpm test -- tests/integration/tools/atlas --project=long-running-tests
- name: Upload test results
uses: actions/upload-artifact@v5
if: always()
Expand Down
31 changes: 18 additions & 13 deletions .github/workflows/code-health.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ jobs:
name: Setup Docker Environment
with:
set-host: true
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
cache: "npm"
cache: "pnpm"
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Run tests
run: npm test
run: pnpm test
env:
SKIP_ATLAS_TESTS: "true"
SKIP_ATLAS_LOCAL_TESTS: "true"
Expand All @@ -56,18 +57,19 @@ jobs:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
cache: "npm"
cache: "pnpm"
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Run tests
env:
MDB_MCP_API_CLIENT_ID: ${{ secrets.TEST_ATLAS_CLIENT_ID }}
MDB_MCP_API_CLIENT_SECRET: ${{ secrets.TEST_ATLAS_CLIENT_SECRET }}
MDB_MCP_API_BASE_URL: ${{ vars.TEST_ATLAS_BASE_URL }}
run: npm test -- tests/integration/tools/atlas/
run: pnpm test -- tests/integration/tools/atlas/
- name: Upload test results
uses: actions/upload-artifact@v5
if: always()
Expand All @@ -84,14 +86,15 @@ jobs:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
cache: "npm"
cache: "pnpm"
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Run tests
run: npm test -- tests/integration/tools/atlas-local/
run: pnpm test -- tests/integration/tools/atlas-local/
- name: Upload test results
uses: actions/upload-artifact@v5
if: always()
Expand All @@ -108,12 +111,13 @@ jobs:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
cache: "npm"
cache: "pnpm"
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Download test results
uses: actions/download-artifact@v6
with:
Expand All @@ -131,7 +135,7 @@ jobs:
path: coverage/atlas-local
- name: Merge coverage reports
run: |
npx -y lcov-result-merger@5.0.1 "coverage/*/lcov.info" "coverage/lcov.info"
pnpm dlx lcov-result-merger@5.0.1 "coverage/*/lcov.info" "coverage/lcov.info"
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2.3.6
with:
Expand All @@ -146,10 +150,11 @@ jobs:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
cache: "npm"
cache: "pnpm"
- name: Install dependencies
run: |
sudo apt-get install -y git-secrets
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,23 @@ jobs:
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
registry-url: "https://registry.npmjs.org"
cache: "npm"
cache: "pnpm"
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Bump version
id: bump-version
run: |
echo "NEW_VERSION=$(npm version ${{ inputs.version }} --no-git-tag-version)" >> $GITHUB_OUTPUT
npm run build:update-package-version
echo "NEW_VERSION=$(pnpm version ${{ inputs.version }} --no-git-tag-version)" >> $GITHUB_OUTPUT
pnpm run build:update-package-version

- name: Update server.json version and arguments
run: |
npm run generate:arguments
pnpm run generate:arguments

- name: Create release PR
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # 7.0.8
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ jobs:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
registry-url: "https://registry.npmjs.org"
cache: "npm"
cache: "pnpm"
- name: Get version
id: get-version
shell: bash
Expand Down Expand Up @@ -84,18 +85,19 @@ jobs:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: package.json
registry-url: "https://registry.npmjs.org"
cache: "npm"
cache: "pnpm"

- name: Build package
run: |
npm ci
npm run build
pnpm install --frozen-lockfile
pnpm run build
- name: Publish to NPM
run: npm publish --tag ${{ needs.check.outputs.RELEASE_CHANNEL }}
run: pnpm publish --tag ${{ needs.check.outputs.RELEASE_CHANNEL }} --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand Down
18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This project implements a Model Context Protocol (MCP) server for MongoDB and Mo
### Prerequisites

- Node.js (v20 or later)
- npm
- pnpm

### Getting Started

Expand All @@ -25,7 +25,7 @@ This project implements a Model Context Protocol (MCP) server for MongoDB and Mo
2. Install dependencies:

```
npm install
pnpm install
```

3. Add the mcp server to your IDE of choice (see the [README](README.md) for detailed client integration instructions)
Expand All @@ -52,7 +52,7 @@ This project implements a Model Context Protocol (MCP) server for MongoDB and Mo
3. Run the inspector and double check your changes:

```
npm run inspect
pnpm run inspect
```

4. Commit your changes using [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) format.
Expand All @@ -65,15 +65,15 @@ When adding new features or fixing bugs, please ensure that you also add tests t

The tests can be found in the `tests` directory.

You can run tests using the following npm scripts:
You can run tests using the following pnpm scripts:

- `npm test`: Run all tests
- `pnpm test`: Run all tests

To run a specific test file or directory:

```bash
npm test -- path/to/test/file.test.ts
npm test -- path/to/directory
pnpm test -- path/to/test/file.test.ts
pnpm test -- path/to/directory
```

#### Accuracy Tests and colima
Expand All @@ -84,7 +84,7 @@ If you use [colima](https://github.com/abiosoft/colima) to run Docker on Mac, yo

### Restart Server

- Run `npm run build` to re-build the server if you made changes to the code
- Run `pnpm run build` to re-build the server if you made changes to the code
- Press `Cmd + Shift + P` and type List MCP Servers
- Select the MCP server you want to restart
- Select the option to restart the server
Expand All @@ -102,7 +102,7 @@ To see MCP logs, check https://code.visualstudio.com/docs/copilot/chat/mcp-serve
For debugging, we use the MCP inspector tool. From the root of this repository, run:

```shell
npm run inspect
pnpm run inspect
```

This is equivalent to:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ A Model Context Protocol server for interacting with MongoDB Databases and Mongo
- At least 20.19.0
- When using v22 then at least v22.12.0
- Otherwise any version 23+
- pnpm (for development)

```shell
node -v
Expand Down
Loading
Loading