smart-context-mcp 1.7.8 → 1.8.1
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 +24 -1
- package/package.json +3 -1
- package/server.json +21 -0
- package/src/index-manager.js +7 -32
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ Restart your AI client. Done.
|
|
|
56
56
|
# Check installed version
|
|
57
57
|
npm list -g smart-context-mcp
|
|
58
58
|
|
|
59
|
-
# Should show: smart-context-mcp@1.
|
|
59
|
+
# Should show: smart-context-mcp@1.8.1 (or later)
|
|
60
60
|
|
|
61
61
|
# Update to latest version
|
|
62
62
|
npm update -g smart-context-mcp
|
|
@@ -105,6 +105,29 @@ See [Task Runner Workflows](https://github.com/Arrayo/smart-context-mcp/blob/mai
|
|
|
105
105
|
|
|
106
106
|
---
|
|
107
107
|
|
|
108
|
+
## When to Use (and When Not To)
|
|
109
|
+
|
|
110
|
+
**Use devctx when:**
|
|
111
|
+
- You're exploring an unfamiliar codebase
|
|
112
|
+
- The task spans multiple sessions (checkpoints save context)
|
|
113
|
+
- You need to understand how files relate to each other (graph/imports)
|
|
114
|
+
- The context is too large to manage manually
|
|
115
|
+
- You're doing complex multi-file refactors or debugging across layers
|
|
116
|
+
|
|
117
|
+
**Skip devctx when:**
|
|
118
|
+
- You already know exactly which files to touch
|
|
119
|
+
- It's a single-file or surgical change (2-3 edits max)
|
|
120
|
+
- You have the full mental map from a recent exploration
|
|
121
|
+
- Native tools (Grep, Read, StrReplace) are more direct for the task
|
|
122
|
+
|
|
123
|
+
**Honest verdict from real users:**
|
|
124
|
+
|
|
125
|
+
> "The MCP shines in long, multi-session tasks or when you don't know the codebase. For contained refactors where you already know what to touch, native tools are just as fast or faster. The real value was `smart_read(outline)` for the initial analysis and checkpoints to not lose the thread between sessions."
|
|
126
|
+
|
|
127
|
+
The 90% token savings are real, but they require the right task type to materialize.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
108
131
|
## 📊 Real Metrics
|
|
109
132
|
|
|
110
133
|
**Production use on this project:**
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "smart-context-mcp",
|
|
3
|
-
"
|
|
3
|
+
"mcpName": "io.github.Arrayo/smart-context-mcp",
|
|
4
|
+
"version": "1.8.1",
|
|
4
5
|
"description": "MCP server that reduces agent token usage by 90% with intelligent context compression, task checkpoint persistence, and workflow-aware agent guidance.",
|
|
5
6
|
"author": "Francisco Caballero Portero <fcp1978@hotmail.com>",
|
|
6
7
|
"type": "module",
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
},
|
|
28
29
|
"files": [
|
|
29
30
|
"README.md",
|
|
31
|
+
"server.json",
|
|
30
32
|
"src/",
|
|
31
33
|
"scripts/claude-hook.js",
|
|
32
34
|
"scripts/check-repo-safety.js",
|
package/server.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.Arrayo/smart-context-mcp",
|
|
4
|
+
"description": "Reduces AI agent token usage by 90% via context compression and task checkpoint persistence.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"url": "https://github.com/Arrayo/smart-context-mcp",
|
|
7
|
+
"source": "github"
|
|
8
|
+
},
|
|
9
|
+
"version": "1.8.1",
|
|
10
|
+
"packages": [
|
|
11
|
+
{
|
|
12
|
+
"registryType": "npm",
|
|
13
|
+
"identifier": "smart-context-mcp",
|
|
14
|
+
"version": "1.8.1",
|
|
15
|
+
"transport": {
|
|
16
|
+
"type": "stdio"
|
|
17
|
+
},
|
|
18
|
+
"installationInstructions": "npm install -g smart-context-mcp && npx smart-context-init --target . --clients cursor"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
package/src/index-manager.js
CHANGED
|
@@ -33,7 +33,7 @@ const saveIndexMetadata = (meta, root = projectRoot) => {
|
|
|
33
33
|
}
|
|
34
34
|
fs.writeFileSync(metaPath, JSON.stringify(meta, null, 2), 'utf8');
|
|
35
35
|
} catch (error) {
|
|
36
|
-
|
|
36
|
+
process.stderr.write(`[devctx] Failed to save index metadata: ${error.message}\n`);
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
|
|
@@ -65,31 +65,12 @@ const timeout = (ms, message) => {
|
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
typeof process.env.NODE_TEST_CONTEXT !== 'undefined' ||
|
|
71
|
-
process.argv.some(arg => arg.includes('--test'));
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const isMcpEnvironment = () => {
|
|
75
|
-
return process.env.MCP_SERVER === 'true' ||
|
|
76
|
-
process.argv.some(arg => arg.includes('devctx-server'));
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const log = (message, level = 'info') => {
|
|
80
|
-
if (isTestEnvironment() || isMcpEnvironment()) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (level === 'warn') {
|
|
85
|
-
console.warn(message);
|
|
86
|
-
} else {
|
|
87
|
-
console.log(message);
|
|
88
|
-
}
|
|
68
|
+
const log = (message) => {
|
|
69
|
+
process.stderr.write(`[devctx] ${message}\n`);
|
|
89
70
|
};
|
|
90
71
|
|
|
91
72
|
export const ensureIndexReady = async (options = {}) => {
|
|
92
|
-
const { force = false, timeoutMs = INDEX_BUILD_TIMEOUT_MS, root = projectRoot
|
|
73
|
+
const { force = false, timeoutMs = INDEX_BUILD_TIMEOUT_MS, root = projectRoot } = options;
|
|
93
74
|
|
|
94
75
|
if (!force) {
|
|
95
76
|
const existingIndex = loadIndex(root);
|
|
@@ -101,9 +82,7 @@ export const ensureIndexReady = async (options = {}) => {
|
|
|
101
82
|
}
|
|
102
83
|
}
|
|
103
84
|
|
|
104
|
-
|
|
105
|
-
log('📦 Building search index (this may take 30-60s)...');
|
|
106
|
-
}
|
|
85
|
+
log('Building search index...');
|
|
107
86
|
|
|
108
87
|
try {
|
|
109
88
|
const buildPromise = buildIndexCore({ root, incremental: true });
|
|
@@ -119,14 +98,10 @@ export const ensureIndexReady = async (options = {}) => {
|
|
|
119
98
|
version: result?.version
|
|
120
99
|
}, root);
|
|
121
100
|
|
|
122
|
-
|
|
123
|
-
log('✅ Index ready');
|
|
124
|
-
}
|
|
101
|
+
log('Index ready');
|
|
125
102
|
return { status: 'built', cached: false, fileCount: result?.files?.length || 0 };
|
|
126
103
|
} catch (error) {
|
|
127
|
-
|
|
128
|
-
log('⚠️ Index build failed, search will use fallback mode', 'warn');
|
|
129
|
-
}
|
|
104
|
+
log(`Index build failed: ${error.message}`);
|
|
130
105
|
return { status: 'fallback', error: error.message };
|
|
131
106
|
}
|
|
132
107
|
};
|