mcp-mongo-server 1.3.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -339
- package/build/index.js +1825 -63
- package/package.json +74 -50
- package/build/mongo.js +0 -33
- package/build/schemas/call.js +0 -591
- package/build/schemas/completion.js +0 -112
- package/build/schemas/ping.js +0 -20
- package/build/schemas/prompts.js +0 -71
- package/build/schemas/resource.js +0 -213
- package/build/schemas/templates.js +0 -39
- package/build/schemas/tools.js +0 -281
- package/build/server.js +0 -65
package/package.json
CHANGED
|
@@ -1,52 +1,76 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
2
|
+
"name": "mcp-mongo-server",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "A Model Context Protocol server for MongoDB connections",
|
|
5
|
+
"private": false,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"mongodb": "./build/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"build"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"clean": "rm -rf build",
|
|
15
|
+
"build": "tsup",
|
|
16
|
+
"prepare": "bun run build",
|
|
17
|
+
"watch": "tsup --watch",
|
|
18
|
+
"format": "biome format --write .",
|
|
19
|
+
"format:check": "biome format .",
|
|
20
|
+
"lint": "biome lint .",
|
|
21
|
+
"lint:fix": "biome lint --write .",
|
|
22
|
+
"check": "biome check --write .",
|
|
23
|
+
"inspector": "mcp-inspector --config inspector-config.json --server mongodb"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
27
|
+
"mongodb": "^7.5.0",
|
|
28
|
+
"zod": "^4.4.3"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@biomejs/biome": "^2.5.5",
|
|
32
|
+
"@modelcontextprotocol/inspector": "^1.0.0",
|
|
33
|
+
"@types/node": "^26.1.1",
|
|
34
|
+
"tsup": "^8.5.1",
|
|
35
|
+
"typescript": "^5.9.3"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"claude",
|
|
42
|
+
"claude-desktop",
|
|
43
|
+
"mcp",
|
|
44
|
+
"mongo",
|
|
45
|
+
"mongodb",
|
|
46
|
+
"model-context-protocol",
|
|
47
|
+
"llm",
|
|
48
|
+
"mcp-server",
|
|
49
|
+
"mcp-protocol",
|
|
50
|
+
"mcp-connector",
|
|
51
|
+
"mcp-connector-mongodb"
|
|
52
|
+
],
|
|
53
|
+
"author": "Muhammed Kilic <kiliczsh>",
|
|
54
|
+
"license": "MIT",
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "https://github.com/kiliczsh/mcp-mongo-server"
|
|
58
|
+
},
|
|
59
|
+
"homepage": "https://github.com/kiliczsh/mcp-mongo-server",
|
|
60
|
+
"overrides": {
|
|
61
|
+
"qs": "^6.15.2",
|
|
62
|
+
"hono": "^4.12.18",
|
|
63
|
+
"@hono/node-server": "^1.19.10",
|
|
64
|
+
"express-rate-limit": "^8.2.2",
|
|
65
|
+
"fast-uri": "^3.1.2",
|
|
66
|
+
"ws": "^8.21.1",
|
|
67
|
+
"shell-quote": "^1.10.0",
|
|
68
|
+
"minimatch": "^3.1.3",
|
|
69
|
+
"brace-expansion": "^1.1.13",
|
|
70
|
+
"rollup": "^4.59.0",
|
|
71
|
+
"picomatch": "^4.0.4",
|
|
72
|
+
"body-parser": "^2.3.0",
|
|
73
|
+
"ip-address": "^10.2.0",
|
|
74
|
+
"esbuild": "^0.28.1"
|
|
75
|
+
}
|
|
52
76
|
}
|
package/build/mongo.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { MongoClient, ReadPreference } from "mongodb";
|
|
2
|
-
/**
|
|
3
|
-
* Initialize MongoDB connection
|
|
4
|
-
* @param url MongoDB connection string
|
|
5
|
-
* @param readOnly Whether to connect in read-only mode
|
|
6
|
-
* @returns Object containing client, db, connection status, and read-only mode
|
|
7
|
-
*/
|
|
8
|
-
export async function connectToMongoDB(url, readOnly) {
|
|
9
|
-
try {
|
|
10
|
-
const options = readOnly
|
|
11
|
-
? { readPreference: ReadPreference.SECONDARY }
|
|
12
|
-
: {};
|
|
13
|
-
const client = new MongoClient(url, options);
|
|
14
|
-
await client.connect();
|
|
15
|
-
const db = client.db();
|
|
16
|
-
console.warn(`Connected to MongoDB database: ${db.databaseName}`);
|
|
17
|
-
return {
|
|
18
|
-
client,
|
|
19
|
-
db,
|
|
20
|
-
isConnected: true,
|
|
21
|
-
isReadOnlyMode: readOnly,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
catch (error) {
|
|
25
|
-
console.error("Failed to connect to MongoDB:", error);
|
|
26
|
-
return {
|
|
27
|
-
client: null,
|
|
28
|
-
db: null,
|
|
29
|
-
isConnected: false,
|
|
30
|
-
isReadOnlyMode: readOnly,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}
|