@mrxkun/mcfast-mcp 3.2.0 → 3.3.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/package.json +2 -2
- package/src/index.js +14 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrxkun/mcfast-mcp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"description": "Ultra-fast code editing with fuzzy patching, auto-rollback, and 5 unified tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -45,4 +45,4 @@
|
|
|
45
45
|
"tree-sitter-rust": "^0.24.0",
|
|
46
46
|
"web-tree-sitter": "^0.26.5"
|
|
47
47
|
}
|
|
48
|
-
}
|
|
48
|
+
}
|
package/src/index.js
CHANGED
|
@@ -92,7 +92,7 @@ const TOOL_ALIASES = {
|
|
|
92
92
|
'search_filesystem': 'search',
|
|
93
93
|
'list_files_fast': 'list_files',
|
|
94
94
|
'read_file': 'read',
|
|
95
|
-
'goto_definition': '
|
|
95
|
+
'goto_definition': 'search', // redirected
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
/**
|
|
@@ -250,8 +250,8 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
250
250
|
},
|
|
251
251
|
mode: {
|
|
252
252
|
type: "string",
|
|
253
|
-
enum: ["auto", "local", "ai", "filesystem"],
|
|
254
|
-
description: "Search mode (default: auto-detect)"
|
|
253
|
+
enum: ["auto", "local", "ai", "filesystem", "definition", "references"],
|
|
254
|
+
description: "Search mode (default: auto-detect). 'definition' finds symbol definition, 'references' finds usages."
|
|
255
255
|
},
|
|
256
256
|
regex: { type: "boolean", description: "Treat query as regex (local mode only)" },
|
|
257
257
|
caseSensitive: { type: "boolean", description: "Case sensitive search" },
|
|
@@ -300,32 +300,6 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
300
300
|
},
|
|
301
301
|
required: ["instruction", "files"]
|
|
302
302
|
}
|
|
303
|
-
},
|
|
304
|
-
// NEW TOOL: get_definition
|
|
305
|
-
{
|
|
306
|
-
name: "get_definition",
|
|
307
|
-
description: "Find the definition of a symbol in a file (LSP-like).",
|
|
308
|
-
inputSchema: {
|
|
309
|
-
type: "object",
|
|
310
|
-
properties: {
|
|
311
|
-
path: { type: "string", description: "Path to the file containing the usage" },
|
|
312
|
-
symbol: { type: "string", description: "The symbol/identifier to find definition for" }
|
|
313
|
-
},
|
|
314
|
-
required: ["path", "symbol"]
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
|
-
// NEW TOOL: find_references
|
|
318
|
-
{
|
|
319
|
-
name: "find_references",
|
|
320
|
-
description: "Find all usages of a symbol across the file (and potentially others if supported).",
|
|
321
|
-
inputSchema: {
|
|
322
|
-
type: "object",
|
|
323
|
-
properties: {
|
|
324
|
-
path: { type: "string", description: "Path to the file containing the symbol" },
|
|
325
|
-
symbol: { type: "string", description: "The symbol/identifier to find references for" }
|
|
326
|
-
},
|
|
327
|
-
required: ["path", "symbol"]
|
|
328
|
-
}
|
|
329
303
|
}
|
|
330
304
|
],
|
|
331
305
|
};
|
|
@@ -478,14 +452,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
478
452
|
result = await handleReapply(args);
|
|
479
453
|
summary = 'Retry edit applied';
|
|
480
454
|
}
|
|
481
|
-
else if (name === "get_definition") {
|
|
482
|
-
result = await handleGetDefinition(args);
|
|
483
|
-
summary = 'Definition found';
|
|
484
|
-
}
|
|
485
|
-
else if (name === "find_references") {
|
|
486
|
-
result = await handleFindReferences(args);
|
|
487
|
-
summary = 'References found';
|
|
488
|
-
}
|
|
489
455
|
else {
|
|
490
456
|
throw new Error(`Tool not found: ${name}`);
|
|
491
457
|
}
|
|
@@ -872,7 +838,17 @@ async function handleSearch({ query, files, path, mode = 'auto', regex = false,
|
|
|
872
838
|
return await handleSearchCodeAI({ query, files, contextLines });
|
|
873
839
|
}
|
|
874
840
|
|
|
875
|
-
// Strategy 3:
|
|
841
|
+
// Strategy 3: LSP Definition
|
|
842
|
+
if (detectedMode === 'definition') {
|
|
843
|
+
return await handleGetDefinition({ path: path, symbol: query });
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
// Strategy 4: LSP References
|
|
847
|
+
if (detectedMode === 'references') {
|
|
848
|
+
return await handleFindReferences({ path: path, symbol: query });
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
// Strategy 5: Filesystem search (fast grep-based)
|
|
876
852
|
return await handleSearchFilesystem({ query, path, isRegex: regex, caseSensitive });
|
|
877
853
|
}
|
|
878
854
|
|