@4da/mcp-server 4.6.5 → 4.6.6
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/dist/index.js +18 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -61,6 +61,18 @@ import { createDatabase, FourDADatabase } from "./db.js";
|
|
|
61
61
|
// =============================================================================
|
|
62
62
|
// Server Setup
|
|
63
63
|
// =============================================================================
|
|
64
|
+
/**
|
|
65
|
+
* Project root for scanning/scoping. FOURDA_PROJECT_DIR overrides cwd for
|
|
66
|
+
* hosts where cwd is meaningless (Claude Desktop launches extension servers
|
|
67
|
+
* from an app directory) — the .mcpb bundle wires its directory picker to it.
|
|
68
|
+
* A value still containing "${" is an unsubstituted host template; ignore it.
|
|
69
|
+
*/
|
|
70
|
+
function resolveProjectDir() {
|
|
71
|
+
const dir = process.env.FOURDA_PROJECT_DIR?.trim();
|
|
72
|
+
if (dir && !dir.includes("${"))
|
|
73
|
+
return dir;
|
|
74
|
+
return process.cwd();
|
|
75
|
+
}
|
|
64
76
|
const server = new Server({
|
|
65
77
|
name: "4da-server",
|
|
66
78
|
version: SERVER_VERSION,
|
|
@@ -85,9 +97,12 @@ function getDatabase() {
|
|
|
85
97
|
// Initialize live intelligence layer
|
|
86
98
|
liveIntel = new LiveIntelligence(db.getRawDb());
|
|
87
99
|
setLiveIntelligence(liveIntel);
|
|
88
|
-
// Standalone mode: auto-populate from project scan
|
|
100
|
+
// Standalone mode: auto-populate from project scan.
|
|
101
|
+
// FOURDA_PROJECT_DIR overrides cwd for hosts where cwd is meaningless
|
|
102
|
+
// (Claude Desktop launches extension servers from an app directory, not
|
|
103
|
+
// the user's code) — the .mcpb bundle wires its directory picker to this.
|
|
89
104
|
if (db.isStandalone) {
|
|
90
|
-
const cwd =
|
|
105
|
+
const cwd = resolveProjectDir();
|
|
91
106
|
const scan = scanCurrentProject(cwd);
|
|
92
107
|
db.populateFromScan(scan);
|
|
93
108
|
const detected = [
|
|
@@ -132,7 +147,7 @@ function getDatabase() {
|
|
|
132
147
|
// database (the ACE engine indexes every local project) must not bleed
|
|
133
148
|
// into this project's vulnerability scan.
|
|
134
149
|
const norm = (p) => p.replace(/\\/g, "/").toLowerCase().replace(/\/+$/, "");
|
|
135
|
-
const rootNorm = norm(
|
|
150
|
+
const rootNorm = norm(resolveProjectDir());
|
|
136
151
|
const groups = new Map();
|
|
137
152
|
for (const row of rows) {
|
|
138
153
|
const projectPath = row.project_path || process.cwd();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4da/mcp-server",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.6",
|
|
4
4
|
"mcpName": "io.github.4DA-Systems/4da-mcp-server",
|
|
5
5
|
"description": "Dependency intelligence for AI coding agents. Live CVE scanning, dependency health, upgrade planning, ecosystem news, decision memory — zero config, privacy-first. 9 tools standalone, 14 total with desktop app.",
|
|
6
6
|
"type": "module",
|