@softerist/heuristic-mcp 2.1.10 → 2.1.11
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 +10 -1
- package/features/lifecycle.js +30 -0
- package/index.js +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -196,6 +196,14 @@ heuristic-mcp --start
|
|
|
196
196
|
|
|
197
197
|
*(This re-runs the configuration step to ensure it is enabled in your IDE)*
|
|
198
198
|
|
|
199
|
+
**Check Status:**
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
heuristic-mcp --status
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
*(Shows if the server is running and its PID)*
|
|
206
|
+
|
|
199
207
|
---
|
|
200
208
|
|
|
201
209
|
## Environment Variables
|
|
@@ -278,6 +286,7 @@ The server indexes your code in four steps:
|
|
|
278
286
|
4. **Storage**: Saves embeddings to `.smart-coding-cache/` for fast startup
|
|
279
287
|
|
|
280
288
|
When you search, your query is converted to the same vector format. We use a **hybrid ranking algorithm** that combines:
|
|
289
|
+
|
|
281
290
|
- **Semantic Similarity** (cosine similarity of vectors)
|
|
282
291
|
- **Exact Keyword Matching** (BM25-inspired boost)
|
|
283
292
|
- **Recency Boosting** (favoring files you're actively working on)
|
|
@@ -332,7 +341,7 @@ Finds all try/catch blocks and error handling patterns.
|
|
|
332
341
|
|
|
333
342
|
This project builds on research from Cursor showing that semantic search improves AI coding agent performance by 12.5% on average across question-answering tasks. The key insight is that AI assistants benefit more from relevant context than from large amounts of context.
|
|
334
343
|
|
|
335
|
-
See: https://cursor.com/blog/semsearch
|
|
344
|
+
See: <https://cursor.com/blog/semsearch>
|
|
336
345
|
|
|
337
346
|
## Acknowledgements
|
|
338
347
|
|
package/features/lifecycle.js
CHANGED
|
@@ -45,3 +45,33 @@ export async function start() {
|
|
|
45
45
|
console.error(`[Lifecycle] Failed to configure server: ${err.message}`);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
export async function status() {
|
|
50
|
+
try {
|
|
51
|
+
const platform = process.platform;
|
|
52
|
+
let command = '';
|
|
53
|
+
|
|
54
|
+
if (platform === 'win32') {
|
|
55
|
+
command = `wmic process where "CommandLine like '%heuristic-mcp/index.js%'" get ProcessId`;
|
|
56
|
+
} else {
|
|
57
|
+
// pgrep -f matches the full command line
|
|
58
|
+
command = `pgrep -f "heuristic-mcp/index.js"`;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const { stdout } = await execPromise(command);
|
|
62
|
+
const pids = stdout.trim().split(/\s+/).filter(pid => pid && !isNaN(pid));
|
|
63
|
+
|
|
64
|
+
if (pids.length > 0) {
|
|
65
|
+
console.log(`[Lifecycle] 🟢 Server is RUNNING. PID(s): ${pids.join(', ')}`);
|
|
66
|
+
} else {
|
|
67
|
+
console.log('[Lifecycle] ⚪ Server is STOPPED.');
|
|
68
|
+
}
|
|
69
|
+
} catch (error) {
|
|
70
|
+
// pgrep returns exit code 1 if no process found
|
|
71
|
+
if (error.code === 1 || error.code === '1' || error.message.includes('No Instance(s) Available')) {
|
|
72
|
+
console.log('[Lifecycle] ⚪ Server is STOPPED.');
|
|
73
|
+
} else {
|
|
74
|
+
console.error(`[Lifecycle] Failed to check status: ${error.message}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
-
import { stop, start } from "./features/lifecycle.js";
|
|
3
|
+
import { stop, start, status } from "./features/lifecycle.js";
|
|
4
4
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
5
|
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
6
6
|
import { pipeline } from "@xenova/transformers";
|
|
@@ -36,6 +36,11 @@ if (args.includes('--start')) {
|
|
|
36
36
|
process.exit(0);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
if (args.includes('--status')) {
|
|
40
|
+
await status();
|
|
41
|
+
process.exit(0);
|
|
42
|
+
}
|
|
43
|
+
|
|
39
44
|
// Check if --register flag is present
|
|
40
45
|
if (args.includes('--register')) {
|
|
41
46
|
// Extract optional filter (e.g. --register antigravity)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softerist/heuristic-mcp",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.11",
|
|
4
4
|
"description": "An enhanced MCP server providing intelligent semantic code search with find-similar-code, recency ranking, and improved chunking. Fork of smart-coding-mcp.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|