Skip to content

Commit e55ab7a

Browse files
committed
merge main into gagik/use-device-id
2 parents 24c1810 + 9e76f95 commit e55ab7a

35 files changed

+1085
-271
lines changed

.github/workflows/lint.yml renamed to .github/workflows/check.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
---
2-
name: Lint
2+
name: Checks
33
on:
44
push:
55
branches:
66
- main
77
pull_request:
8+
pull_request_target:
9+
branches:
10+
- main
811

912
permissions: {}
1013

@@ -35,3 +38,21 @@ jobs:
3538
- name: Install dependencies
3639
run: npm ci
3740
- run: npm run generate
41+
42+
check-dep:
43+
name: Check dependencies
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
47+
- uses: actions/checkout@v4
48+
- uses: actions/setup-node@v4
49+
with:
50+
node-version-file: package.json
51+
cache: "npm"
52+
- name: Install dependencies, build and remove dev dependencies
53+
run: |
54+
npm ci
55+
rm -rf node_modules
56+
npm pkg set scripts.prepare="exit 0"
57+
npm install --omit=dev
58+
- run: npx -y @modelcontextprotocol/inspector --cli --method tools/list -- node dist/index.js --connectionString "mongodb://localhost"

.github/workflows/code_health.yaml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,6 @@ jobs:
6262
name: atlas-test-results
6363
path: coverage/lcov.info
6464

65-
dep-check:
66-
name: Check dependencies
67-
if: github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository
68-
runs-on: ubuntu-latest
69-
steps:
70-
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
71-
- uses: actions/checkout@v4
72-
- uses: actions/setup-node@v4
73-
with:
74-
node-version-file: package.json
75-
cache: "npm"
76-
- name: Install dependencies & build
77-
run: npm ci
78-
- name: Remove dev dependencies
79-
run: |
80-
rm -rf node_modules
81-
npm pkg set scripts.prepare="exit 0"
82-
npm install --omit=dev
83-
- run: npx -y @modelcontextprotocol/inspector --cli --method tools/list -- node dist/index.js --connectionString "mongodb://localhost"
84-
8565
coverage:
8666
name: Report Coverage
8767
if: always() && github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository

.github/workflows/code_health_fork.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ jobs:
4242
permissions:
4343
pull-requests: write
4444
contents: write
45-
needs:
46-
- run-tests
4745
steps:
4846
- name: Enable auto-merge for Dependabot PRs
4947
run: gh pr merge --auto --squash "$PR_URL"

.vscode/extensions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
5+
// List of extensions which should be recommended for users of this workspace.
6+
"recommendations": ["firsttris.vscode-jest-runner", "orta.vscode-jest"],
7+
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
8+
"unwantedRecommendations": []
9+
}

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"jestrunner.jestCommand": "npm test --",
3+
"jestrunner.debugOptions": {
4+
"runtimeExecutable": "node",
5+
"runtimeArgs": [
6+
"--experimental-vm-modules",
7+
"node_modules/jest/bin/jest.js",
8+
"--coverage"
9+
]
10+
}
11+
}

README.md

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ node -v
2929
```
3030

3131
- A MongoDB connection string or Atlas API credentials, **_the Server will not start unless configured_**.
32-
- **_Atlas API credentials_** are required to use the Atlas tools. You can create a service account in MongoDB Atlas and use its credentials for authentication. See [Atlas API Access](#atlas-api-access) for more details.
32+
- **_Service Accounts Atlas API credentials_** are required to use the Atlas tools. You can create a service account in MongoDB Atlas and use its credentials for authentication. See [Atlas API Access](#atlas-api-access) for more details.
3333
- If you have a MongoDB connection string, you can use it directly to connect to your MongoDB instance.
3434

3535
## Setup
@@ -67,7 +67,7 @@ You can pass your connection string via args, make sure to use a valid username
6767

6868
#### Option 2: Atlas API credentials args
6969

70-
Use your Atlas API Service Account credentials. More details in the [Atlas API Access](#atlas-api-access) section.
70+
Use your Atlas API Service Accounts credentials. Must follow all the steps in [Atlas API Access](#atlas-api-access) section.
7171

7272
```json
7373
{
@@ -78,18 +78,33 @@ Use your Atlas API Service Account credentials. More details in the [Atlas API A
7878
"-y",
7979
"mongodb-mcp-server",
8080
"--apiClientId",
81-
"your-atlas-client-id",
81+
"your-atlas-service-accounts-client-id",
8282
"--apiClientSecret",
83-
"your-atlas-client-secret"
83+
"your-atlas-service-accounts-client-secret"
8484
]
8585
}
8686
}
8787
}
8888
```
8989

90-
#### Other options
90+
### Option 3: Standalone Service using command arguments
9191

92-
Alternatively you can use environment variables in the config file or set them and run the server via npx.
92+
Start Server using npx command:
93+
94+
```shell
95+
npx -y mongodb-mcp-server --apiClientId="your-atlas-service-accounts-client-id" --apiClientSecret="your-atlas-service-accounts-client-secret"
96+
```
97+
98+
- For a complete list of arguments see [Configuration Options](#configuration-options)
99+
- To configure your Atlas Service Accounts credentials please refer to [Atlas API Access](#atlas-api-access)
100+
101+
#### Option 4: Standalone Service using environment variables
102+
103+
```shell
104+
npx -y mongodb-mcp-server
105+
```
106+
107+
You can use environment variables in the config file or set them and run the server via npx.
93108

94109
- Connection String via environment variables in the MCP file [example](#connection-string-with-environment-variables)
95110
- Atlas API credentials via environment variables in the MCP file [example](#atlas-api-credentials-with-environment-variables)
@@ -229,7 +244,7 @@ To learn more about Service Accounts, check the [MongoDB Atlas documentation](ht
229244
- After creation, you'll be shown the Client ID and Client Secret
230245
- **Important:** Copy and save the Client Secret immediately as it won't be displayed again
231246

232-
3. **Add Access List Entry (Optional but recommended):**
247+
3. **Add Access List Entry:**
233248

234249
- Add your IP address to the API access list
235250

@@ -243,9 +258,9 @@ To learn more about Service Accounts, check the [MongoDB Atlas documentation](ht
243258
Set environment variables with the prefix `MDB_MCP_` followed by the option name in uppercase with underscores:
244259

245260
```shell
246-
# Set Atlas API credentials
247-
export MDB_MCP_API_CLIENT_ID="your-atlas-client-id"
248-
export MDB_MCP_API_CLIENT_SECRET="your-atlas-client-secret"
261+
# Set Atlas API credentials (via Service Accounts)
262+
export MDB_MCP_API_CLIENT_ID="your-atlas-service-accounts-client-id"
263+
export MDB_MCP_API_CLIENT_SECRET="your-atlas-service-accounts-client-secret"
249264

250265
# Set a custom MongoDB connection string
251266
export MDB_MCP_CONNECTION_STRING="mongodb+srv://username:[email protected]/myDatabase"
@@ -281,8 +296,8 @@ export MDB_MCP_LOG_PATH="/path/to/logs"
281296
"command": "npx",
282297
"args": ["-y", "mongodb-mcp-server"],
283298
"env": {
284-
"MDB_MCP_API_CLIENT_ID": "your-atlas-client-id",
285-
"MDB_MCP_API_CLIENT_SECRET": "your-atlas-client-secret"
299+
"MDB_MCP_API_CLIENT_ID": "your-atlas-service-accounts-client-id",
300+
"MDB_MCP_API_CLIENT_SECRET": "your-atlas-service-accounts-client-secret"
286301
}
287302
}
288303
}
@@ -294,7 +309,7 @@ export MDB_MCP_LOG_PATH="/path/to/logs"
294309
Pass configuration options as command-line arguments when starting the server:
295310

296311
```shell
297-
npx -y mongodb-mcp-server --apiClientId="your-atlas-client-id" --apiClientSecret="your-atlas-client-secret" --connectionString="mongodb+srv://username:[email protected]/myDatabase" --logPath=/path/to/logs
312+
npx -y mongodb-mcp-server --apiClientId="your-atlas-service-accounts-client-id" --apiClientSecret="your-atlas-service-accounts-client-secret" --connectionString="mongodb+srv://username:[email protected]/myDatabase" --logPath=/path/to/logs
298313
```
299314

300315
#### MCP configuration file examples
@@ -328,9 +343,9 @@ npx -y mongodb-mcp-server --apiClientId="your-atlas-client-id" --apiClientSecret
328343
"-y",
329344
"mongodb-mcp-server",
330345
"--apiClientId",
331-
"your-atlas-client-id",
346+
"your-atlas-service-accounts-client-id",
332347
"--apiClientSecret",
333-
"your-atlas-client-secret"
348+
"your-atlas-service-accounts-client-secret"
334349
]
335350
}
336351
}

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export default defineConfig([
4949
"global.d.ts",
5050
"eslint.config.js",
5151
"jest.config.cjs",
52+
"src/types/*.d.ts",
5253
]),
5354
eslintPluginPrettierRecommended,
5455
]);

0 commit comments

Comments
 (0)