Skip to content

Commit c61e643

Browse files
committed
fix: use esm/lib.js
1 parent 6f5540e commit c61e643

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

.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/index.js --connectionString "mongodb://localhost"
58+
- run: npx -y @modelcontextprotocol/inspector --cli --method tools/list -- node dist/cjs/index.js --connectionString "mongodb://localhost"

.smithery/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ RUN npm ci --production --ignore-scripts
2727
# Expose no ports (stdio only)
2828

2929
# Default command
30-
CMD ["node", "dist/index.js"]
30+
CMD ["node", "dist/cjs/index.js"]

.smithery/smithery.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ startCommand:
4040
# A function that produces the CLI command to start the MCP on stdio.
4141
|-
4242
(config) => {
43-
const args = ['dist/index.js'];
43+
const args = ['dist/cjs/index.js'];
4444
if (config) {
4545
if (config.atlasClientId) {
4646
args.push('--apiClientId');

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"request": "launch",
1919
"name": "Launch Program",
2020
"skipFiles": ["<node_internals>/**"],
21-
"program": "${workspaceFolder}/dist/index.js",
21+
"program": "${workspaceFolder}/dist/cjs/index.js",
2222
"preLaunchTask": "tsc: build - tsconfig.build.json",
2323
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
2424
}

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This project implements a Model Context Protocol (MCP) server for MongoDB and Mo
3333
{
3434
"mcpServers": {
3535
"MongoDB": {
36-
"command": "/path/to/mongodb-mcp-server/dist/index.js"
36+
"command": "/path/to/mongodb-mcp-server/dist/cjs/index.js"
3737
}
3838
}
3939
}
@@ -104,7 +104,7 @@ npm run inspect
104104
This is equivalent to:
105105

106106
```shell
107-
npx @modelcontextprotocol/inspector -- node dist/index.js
107+
npx @modelcontextprotocol/inspector -- node dist/cjs/index.js
108108
```
109109

110110
## Pull Request Guidelines

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"exports": {
77
".": {
88
"import": {
9-
"types": "./dist/lib.d.ts",
10-
"default": "./dist/lib.js"
9+
"types": "./dist/esm/lib.d.ts",
10+
"default": "./dist/esm/lib.js"
1111
},
1212
"require": {
1313
"types": "./dist/cjs/lib.d.ts",
@@ -22,7 +22,7 @@
2222
"url": "https://github.com/mongodb-js/mongodb-mcp-server.git"
2323
},
2424
"bin": {
25-
"mongodb-mcp-server": "dist/index.js"
25+
"mongodb-mcp-server": "dist/cjs/index.js"
2626
},
2727
"publishConfig": {
2828
"access": "public"
@@ -33,9 +33,9 @@
3333
"build:update-package-info": "tsx scripts/update-package-info.ts",
3434
"build:esm": "tsc --project tsconfig.esm.json && echo '{\"type\":\"module\"}' > dist/package.json",
3535
"build:cjs": "tsc --project tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
36-
"build:chmod": "chmod +x dist/index.js",
36+
"build:chmod": "chmod +x dist/cjs/index.js",
3737
"build": "npm run build:clean && npm run build:esm && npm run build:cjs && npm run build:chmod",
38-
"inspect": "npm run build && mcp-inspector -- dist/index.js",
38+
"inspect": "npm run build && mcp-inspector -- dist/cjs/index.js",
3939
"prettier": "prettier",
4040
"check": "npm run build && npm run check:types && npm run check:lint && npm run check:format",
4141
"check:lint": "eslint .",

tsconfig.esm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"compilerOptions": {
44
"module": "esnext",
55
"moduleResolution": "bundler",
6-
"outDir": "./dist"
6+
"outDir": "./dist/esm"
77
}
88
}

0 commit comments

Comments
 (0)