@hcu-lab.me/mcp-device 1.0.1 → 1.0.3
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/LICENSE +20 -20
- package/README.md +70 -51
- package/dist/bootstrap.js +0 -0
- package/dist/command-manager.js +0 -0
- package/dist/config-field-definitions.js +0 -0
- package/dist/config-manager.js +0 -0
- package/dist/config.js +0 -0
- package/dist/custom-stdio.js +0 -0
- package/dist/data/official-app-ca.pem +12 -12
- package/dist/data/onboarding-prompts.json +70 -70
- package/dist/device/gateway-config.d.ts +1 -9
- package/dist/device/gateway-config.js +7 -27
- package/dist/device/gateway-identity.d.ts +2 -11
- package/dist/device/gateway-identity.js +11 -52
- package/dist/error-handlers.js +0 -0
- package/dist/handlers/filesystem-handlers.js +2 -2
- package/dist/index.js +0 -0
- package/dist/mcp-device.js +0 -0
- package/dist/search-manager.js +0 -0
- package/dist/server.js +656 -656
- package/dist/terminal-manager.js +0 -0
- package/dist/tools/edit.js +2 -2
- package/dist/tools/fuzzySearch.js +9 -9
- package/dist/tools/improved-process-tools.js +10 -10
- package/dist/tools/prompts.js +1 -1
- package/dist/types.js +0 -0
- package/dist/ui/config-editor/index.html +13 -13
- package/dist/ui/config-editor/src/app.js +30 -30
- package/dist/ui/config-editor/src/array-modal.js +32 -32
- package/dist/ui/config-editor/styles.css +586 -586
- package/dist/ui/file-preview/index.html +16 -16
- package/dist/ui/file-preview/src/app.js +8 -8
- package/dist/ui/file-preview/src/document-layout.js +31 -31
- package/dist/ui/file-preview/src/document-outline.js +8 -8
- package/dist/ui/file-preview/src/markdown/conflict-dialog.js +33 -33
- package/dist/ui/file-preview/src/markdown/controller.js +9 -9
- package/dist/ui/file-preview/src/markdown/editor.js +31 -31
- package/dist/ui/file-preview/styles.css +1630 -1630
- package/dist/utils/files/binary.js +4 -4
- package/dist/utils/files/excel.js +3 -3
- package/dist/utils/system-info.js +90 -90
- package/dist/utils/usageTracker.js +49 -49
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +131 -131
- package/dist/device/windows-dpapi.d.ts +0 -11
- package/dist/device/windows-dpapi.js +0 -67
package/dist/server.js
CHANGED
|
@@ -223,18 +223,18 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
223
223
|
// Configuration tools
|
|
224
224
|
{
|
|
225
225
|
name: "get_config",
|
|
226
|
-
description: `
|
|
227
|
-
Get the complete server configuration as JSON. Config includes fields for:
|
|
228
|
-
- blockedCommands (array of blocked shell commands)
|
|
229
|
-
- defaultShell (shell to use for commands)
|
|
230
|
-
- allowedDirectories (paths the server can access)
|
|
231
|
-
- fileReadLineLimit (max lines for read_file, default 1000)
|
|
232
|
-
- fileWriteLineLimit (max lines per write_file call, default 50)
|
|
233
|
-
- telemetryEnabled (boolean for telemetry opt-in/out)
|
|
234
|
-
- currentClient (information about the currently connected MCP client)
|
|
235
|
-
- clientHistory (history of all clients that have connected)
|
|
236
|
-
- version (version of MCP Device)
|
|
237
|
-
- systemInfo (operating system and environment details)
|
|
226
|
+
description: `
|
|
227
|
+
Get the complete server configuration as JSON. Config includes fields for:
|
|
228
|
+
- blockedCommands (array of blocked shell commands)
|
|
229
|
+
- defaultShell (shell to use for commands)
|
|
230
|
+
- allowedDirectories (paths the server can access)
|
|
231
|
+
- fileReadLineLimit (max lines for read_file, default 1000)
|
|
232
|
+
- fileWriteLineLimit (max lines per write_file call, default 50)
|
|
233
|
+
- telemetryEnabled (boolean for telemetry opt-in/out)
|
|
234
|
+
- currentClient (information about the currently connected MCP client)
|
|
235
|
+
- clientHistory (history of all clients that have connected)
|
|
236
|
+
- version (version of MCP Device)
|
|
237
|
+
- systemInfo (operating system and environment details)
|
|
238
238
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
239
239
|
inputSchema: zodToJsonSchema(GetConfigArgsSchema),
|
|
240
240
|
_meta: buildUiToolMeta(CONFIG_EDITOR_RESOURCE_URI, true, showMcpUiPreviews),
|
|
@@ -245,23 +245,23 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
247
|
name: "set_config_value",
|
|
248
|
-
description: `
|
|
249
|
-
Set a specific configuration value by key.
|
|
250
|
-
|
|
251
|
-
WARNING: Should be used in a separate chat from file operations and
|
|
252
|
-
command execution to prevent security issues.
|
|
253
|
-
|
|
254
|
-
Config keys include:
|
|
255
|
-
- blockedCommands (array)
|
|
256
|
-
- defaultShell (string)
|
|
257
|
-
- allowedDirectories (array of paths)
|
|
258
|
-
- fileReadLineLimit (number, max lines for read_file)
|
|
259
|
-
- fileWriteLineLimit (number, max lines per write_file call)
|
|
260
|
-
- telemetryEnabled (boolean)
|
|
261
|
-
|
|
262
|
-
IMPORTANT: Setting allowedDirectories to an empty array ([]) allows full access
|
|
263
|
-
to the entire file system, regardless of the operating system.
|
|
264
|
-
|
|
248
|
+
description: `
|
|
249
|
+
Set a specific configuration value by key.
|
|
250
|
+
|
|
251
|
+
WARNING: Should be used in a separate chat from file operations and
|
|
252
|
+
command execution to prevent security issues.
|
|
253
|
+
|
|
254
|
+
Config keys include:
|
|
255
|
+
- blockedCommands (array)
|
|
256
|
+
- defaultShell (string)
|
|
257
|
+
- allowedDirectories (array of paths)
|
|
258
|
+
- fileReadLineLimit (number, max lines for read_file)
|
|
259
|
+
- fileWriteLineLimit (number, max lines per write_file call)
|
|
260
|
+
- telemetryEnabled (boolean)
|
|
261
|
+
|
|
262
|
+
IMPORTANT: Setting allowedDirectories to an empty array ([]) allows full access
|
|
263
|
+
to the entire file system, regardless of the operating system.
|
|
264
|
+
|
|
265
265
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
266
266
|
inputSchema: zodToJsonSchema(SetConfigValueArgsSchema),
|
|
267
267
|
annotations: {
|
|
@@ -274,60 +274,60 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
274
274
|
// Filesystem tools
|
|
275
275
|
{
|
|
276
276
|
name: "read_file",
|
|
277
|
-
description: `
|
|
278
|
-
Read contents from files and URLs.
|
|
279
|
-
Read PDF files and extract content as markdown and images.
|
|
280
|
-
|
|
281
|
-
Prefer this over 'execute_command' with cat/type for viewing files.
|
|
282
|
-
|
|
283
|
-
Supports partial file reading with:
|
|
284
|
-
- 'offset' (start line, default: 0)
|
|
285
|
-
* Positive: Start from line N (0-based indexing)
|
|
286
|
-
* Negative: Read last N lines from end (tail behavior)
|
|
287
|
-
- 'length' (max lines to read, default: configurable via 'fileReadLineLimit' setting, initially 1000)
|
|
288
|
-
* Used with positive offsets for range reading
|
|
289
|
-
* Ignored when offset is negative (reads all requested tail lines)
|
|
290
|
-
|
|
291
|
-
Examples:
|
|
292
|
-
- offset: 0, length: 10 → First 10 lines
|
|
293
|
-
- offset: 100, length: 5 → Lines 100-104
|
|
294
|
-
- offset: -20 → Last 20 lines
|
|
295
|
-
- offset: -5, length: 10 → Last 5 lines (length ignored)
|
|
296
|
-
|
|
297
|
-
Performance optimizations:
|
|
298
|
-
- Large files with negative offsets use reverse reading for efficiency
|
|
299
|
-
- Large files with deep positive offsets use byte estimation
|
|
300
|
-
- Small files use fast readline streaming
|
|
301
|
-
|
|
302
|
-
When reading from the file system, only works within allowed directories.
|
|
303
|
-
Can fetch content from URLs when isUrl parameter is set to true
|
|
304
|
-
(URLs are always read in full regardless of offset/length).
|
|
305
|
-
|
|
306
|
-
FORMAT HANDLING (by extension):
|
|
307
|
-
- Text: Uses offset/length for line-based pagination
|
|
308
|
-
- Excel (.xlsx, .xls, .xlsm): Returns JSON 2D array
|
|
309
|
-
* sheet: "Sheet1" (name) or "0" (index as string, 0-based)
|
|
310
|
-
* range: ALWAYS use FROM:TO format (e.g., "A1:D100", "C1:C1", "B2:B50")
|
|
311
|
-
* offset/length work as row pagination (optional fallback)
|
|
312
|
-
- Images (PNG, JPEG, GIF, WebP): Base64 encoded viewable content
|
|
313
|
-
- PDF: Extracts text content as markdown with page structure
|
|
314
|
-
* offset/length work as page pagination (0-based)
|
|
315
|
-
* Includes embedded images when available
|
|
316
|
-
- DOCX (.docx): Two modes depending on parameters:
|
|
317
|
-
* DEFAULT (no offset/length): Returns a text-bearing outline — shows paragraphs with text,
|
|
318
|
-
tables with cell content, styles, image refs. Skips shapes/drawings/SVG noise.
|
|
319
|
-
Each element shows its body index [0], [1], etc.
|
|
320
|
-
* WITH offset/length: Returns raw pretty-printed XML with line pagination.
|
|
321
|
-
Use this to drill into specific sections or see the actual XML for editing.
|
|
322
|
-
* EDITING WORKFLOW: 1) read_file to get outline, 2) read_file with offset/length
|
|
323
|
-
to see raw XML around what you want to edit, 3) edit_block with old_string/new_string
|
|
324
|
-
using XML fragments copied from the read output.
|
|
325
|
-
* IMPORTANT: offset MUST be non-zero to get raw XML (use offset=1 to start from line 1).
|
|
326
|
-
offset=0 always returns the outline regardless of length.
|
|
327
|
-
* For BULK changes (translation, mass replacements): use start_process with Python
|
|
328
|
-
zipfile module to find/replace all <w:t> elements at once.
|
|
329
|
-
|
|
330
|
-
${PATH_GUIDANCE}
|
|
277
|
+
description: `
|
|
278
|
+
Read contents from files and URLs.
|
|
279
|
+
Read PDF files and extract content as markdown and images.
|
|
280
|
+
|
|
281
|
+
Prefer this over 'execute_command' with cat/type for viewing files.
|
|
282
|
+
|
|
283
|
+
Supports partial file reading with:
|
|
284
|
+
- 'offset' (start line, default: 0)
|
|
285
|
+
* Positive: Start from line N (0-based indexing)
|
|
286
|
+
* Negative: Read last N lines from end (tail behavior)
|
|
287
|
+
- 'length' (max lines to read, default: configurable via 'fileReadLineLimit' setting, initially 1000)
|
|
288
|
+
* Used with positive offsets for range reading
|
|
289
|
+
* Ignored when offset is negative (reads all requested tail lines)
|
|
290
|
+
|
|
291
|
+
Examples:
|
|
292
|
+
- offset: 0, length: 10 → First 10 lines
|
|
293
|
+
- offset: 100, length: 5 → Lines 100-104
|
|
294
|
+
- offset: -20 → Last 20 lines
|
|
295
|
+
- offset: -5, length: 10 → Last 5 lines (length ignored)
|
|
296
|
+
|
|
297
|
+
Performance optimizations:
|
|
298
|
+
- Large files with negative offsets use reverse reading for efficiency
|
|
299
|
+
- Large files with deep positive offsets use byte estimation
|
|
300
|
+
- Small files use fast readline streaming
|
|
301
|
+
|
|
302
|
+
When reading from the file system, only works within allowed directories.
|
|
303
|
+
Can fetch content from URLs when isUrl parameter is set to true
|
|
304
|
+
(URLs are always read in full regardless of offset/length).
|
|
305
|
+
|
|
306
|
+
FORMAT HANDLING (by extension):
|
|
307
|
+
- Text: Uses offset/length for line-based pagination
|
|
308
|
+
- Excel (.xlsx, .xls, .xlsm): Returns JSON 2D array
|
|
309
|
+
* sheet: "Sheet1" (name) or "0" (index as string, 0-based)
|
|
310
|
+
* range: ALWAYS use FROM:TO format (e.g., "A1:D100", "C1:C1", "B2:B50")
|
|
311
|
+
* offset/length work as row pagination (optional fallback)
|
|
312
|
+
- Images (PNG, JPEG, GIF, WebP): Base64 encoded viewable content
|
|
313
|
+
- PDF: Extracts text content as markdown with page structure
|
|
314
|
+
* offset/length work as page pagination (0-based)
|
|
315
|
+
* Includes embedded images when available
|
|
316
|
+
- DOCX (.docx): Two modes depending on parameters:
|
|
317
|
+
* DEFAULT (no offset/length): Returns a text-bearing outline — shows paragraphs with text,
|
|
318
|
+
tables with cell content, styles, image refs. Skips shapes/drawings/SVG noise.
|
|
319
|
+
Each element shows its body index [0], [1], etc.
|
|
320
|
+
* WITH offset/length: Returns raw pretty-printed XML with line pagination.
|
|
321
|
+
Use this to drill into specific sections or see the actual XML for editing.
|
|
322
|
+
* EDITING WORKFLOW: 1) read_file to get outline, 2) read_file with offset/length
|
|
323
|
+
to see raw XML around what you want to edit, 3) edit_block with old_string/new_string
|
|
324
|
+
using XML fragments copied from the read output.
|
|
325
|
+
* IMPORTANT: offset MUST be non-zero to get raw XML (use offset=1 to start from line 1).
|
|
326
|
+
offset=0 always returns the outline regardless of length.
|
|
327
|
+
* For BULK changes (translation, mass replacements): use start_process with Python
|
|
328
|
+
zipfile module to find/replace all <w:t> elements at once.
|
|
329
|
+
|
|
330
|
+
${PATH_GUIDANCE}
|
|
331
331
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
332
332
|
inputSchema: zodToJsonSchema(ReadFileArgsSchema),
|
|
333
333
|
_meta: buildUiToolMeta(FILE_PREVIEW_RESOURCE_URI, true, showMcpUiPreviews),
|
|
@@ -339,17 +339,17 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
339
339
|
},
|
|
340
340
|
{
|
|
341
341
|
name: "read_multiple_files",
|
|
342
|
-
description: `
|
|
343
|
-
Read the contents of multiple files simultaneously.
|
|
344
|
-
|
|
345
|
-
Each file's content is returned with its path as a reference.
|
|
346
|
-
Handles text files normally and renders images as viewable content.
|
|
347
|
-
Recognized image types: PNG, JPEG, GIF, WebP.
|
|
348
|
-
|
|
349
|
-
Failed reads for individual files won't stop the entire operation.
|
|
350
|
-
Only works within allowed directories.
|
|
351
|
-
|
|
352
|
-
${PATH_GUIDANCE}
|
|
342
|
+
description: `
|
|
343
|
+
Read the contents of multiple files simultaneously.
|
|
344
|
+
|
|
345
|
+
Each file's content is returned with its path as a reference.
|
|
346
|
+
Handles text files normally and renders images as viewable content.
|
|
347
|
+
Recognized image types: PNG, JPEG, GIF, WebP.
|
|
348
|
+
|
|
349
|
+
Failed reads for individual files won't stop the entire operation.
|
|
350
|
+
Only works within allowed directories.
|
|
351
|
+
|
|
352
|
+
${PATH_GUIDANCE}
|
|
353
353
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
354
354
|
inputSchema: zodToJsonSchema(ReadMultipleFilesArgsSchema),
|
|
355
355
|
annotations: {
|
|
@@ -359,43 +359,43 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
359
359
|
},
|
|
360
360
|
{
|
|
361
361
|
name: "write_file",
|
|
362
|
-
description: `
|
|
363
|
-
Write or append to file contents.
|
|
364
|
-
|
|
365
|
-
IMPORTANT: DO NOT use this tool to create PDF files. Use 'write_pdf' for all PDF creation tasks.
|
|
366
|
-
DO NOT use this tool to edit DOCX files. Use 'edit_block' with old_string/new_string instead.
|
|
367
|
-
To CREATE a new DOCX, use write_file with .docx extension — text content with markdown headings (#, ##, ###) is converted to styled DOCX paragraphs.
|
|
368
|
-
|
|
369
|
-
CHUNKING IS STANDARD PRACTICE: Always write files in chunks of 25-30 lines maximum.
|
|
370
|
-
This is the normal, recommended way to write files - not an emergency measure.
|
|
371
|
-
|
|
372
|
-
STANDARD PROCESS FOR ANY FILE:
|
|
373
|
-
1. FIRST → write_file(filePath, firstChunk, {mode: 'rewrite'}) [≤30 lines]
|
|
374
|
-
2. THEN → write_file(filePath, secondChunk, {mode: 'append'}) [≤30 lines]
|
|
375
|
-
3. CONTINUE → write_file(filePath, nextChunk, {mode: 'append'}) [≤30 lines]
|
|
376
|
-
|
|
377
|
-
ALWAYS CHUNK PROACTIVELY - don't wait for performance warnings!
|
|
378
|
-
|
|
379
|
-
WHEN TO CHUNK (always be proactive):
|
|
380
|
-
1. Any file expected to be longer than 25-30 lines
|
|
381
|
-
2. When writing multiple files in sequence
|
|
382
|
-
3. When creating documentation, code files, or configuration files
|
|
383
|
-
|
|
384
|
-
HANDLING CONTINUATION ("Continue" prompts):
|
|
385
|
-
If user asks to "Continue" after an incomplete operation:
|
|
386
|
-
1. Read the file to see what was successfully written
|
|
387
|
-
2. Continue writing ONLY the remaining content using {mode: 'append'}
|
|
388
|
-
3. Keep chunks to 25-30 lines each
|
|
389
|
-
|
|
390
|
-
FORMAT HANDLING (by extension):
|
|
391
|
-
- Text files: String content
|
|
392
|
-
- Excel (.xlsx, .xls, .xlsm): JSON 2D array or {"SheetName": [[...]]}
|
|
393
|
-
Example: '[["Name","Age"],["Alice",30]]'
|
|
394
|
-
|
|
395
|
-
Files over 50 lines will generate performance notes but are still written successfully.
|
|
396
|
-
Only works within allowed directories.
|
|
397
|
-
|
|
398
|
-
${PATH_GUIDANCE}
|
|
362
|
+
description: `
|
|
363
|
+
Write or append to file contents.
|
|
364
|
+
|
|
365
|
+
IMPORTANT: DO NOT use this tool to create PDF files. Use 'write_pdf' for all PDF creation tasks.
|
|
366
|
+
DO NOT use this tool to edit DOCX files. Use 'edit_block' with old_string/new_string instead.
|
|
367
|
+
To CREATE a new DOCX, use write_file with .docx extension — text content with markdown headings (#, ##, ###) is converted to styled DOCX paragraphs.
|
|
368
|
+
|
|
369
|
+
CHUNKING IS STANDARD PRACTICE: Always write files in chunks of 25-30 lines maximum.
|
|
370
|
+
This is the normal, recommended way to write files - not an emergency measure.
|
|
371
|
+
|
|
372
|
+
STANDARD PROCESS FOR ANY FILE:
|
|
373
|
+
1. FIRST → write_file(filePath, firstChunk, {mode: 'rewrite'}) [≤30 lines]
|
|
374
|
+
2. THEN → write_file(filePath, secondChunk, {mode: 'append'}) [≤30 lines]
|
|
375
|
+
3. CONTINUE → write_file(filePath, nextChunk, {mode: 'append'}) [≤30 lines]
|
|
376
|
+
|
|
377
|
+
ALWAYS CHUNK PROACTIVELY - don't wait for performance warnings!
|
|
378
|
+
|
|
379
|
+
WHEN TO CHUNK (always be proactive):
|
|
380
|
+
1. Any file expected to be longer than 25-30 lines
|
|
381
|
+
2. When writing multiple files in sequence
|
|
382
|
+
3. When creating documentation, code files, or configuration files
|
|
383
|
+
|
|
384
|
+
HANDLING CONTINUATION ("Continue" prompts):
|
|
385
|
+
If user asks to "Continue" after an incomplete operation:
|
|
386
|
+
1. Read the file to see what was successfully written
|
|
387
|
+
2. Continue writing ONLY the remaining content using {mode: 'append'}
|
|
388
|
+
3. Keep chunks to 25-30 lines each
|
|
389
|
+
|
|
390
|
+
FORMAT HANDLING (by extension):
|
|
391
|
+
- Text files: String content
|
|
392
|
+
- Excel (.xlsx, .xls, .xlsm): JSON 2D array or {"SheetName": [[...]]}
|
|
393
|
+
Example: '[["Name","Age"],["Alice",30]]'
|
|
394
|
+
|
|
395
|
+
Files over 50 lines will generate performance notes but are still written successfully.
|
|
396
|
+
Only works within allowed directories.
|
|
397
|
+
|
|
398
|
+
${PATH_GUIDANCE}
|
|
399
399
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
400
400
|
inputSchema: zodToJsonSchema(WriteFileArgsSchema),
|
|
401
401
|
_meta: buildUiToolMeta(FILE_PREVIEW_RESOURCE_URI, true, showMcpUiPreviews),
|
|
@@ -408,57 +408,57 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
408
408
|
},
|
|
409
409
|
{
|
|
410
410
|
name: "write_pdf",
|
|
411
|
-
description: `
|
|
412
|
-
Create a new PDF file or modify an existing one.
|
|
413
|
-
|
|
414
|
-
THIS IS THE ONLY TOOL FOR CREATING AND MODIFYING PDF FILES.
|
|
415
|
-
|
|
416
|
-
RULES ABOUT FILENAMES:
|
|
417
|
-
- When creating a new PDF, 'outputPath' MUST be provided and MUST use a new unique filename (e.g., "result_01.pdf", "analysis_2025_01.pdf", etc.).
|
|
418
|
-
|
|
419
|
-
MODES:
|
|
420
|
-
1. CREATE NEW PDF:
|
|
421
|
-
- Pass a markdown string as 'content'.
|
|
422
|
-
write_pdf(path="doc.pdf", content="# Title\\n\\nBody text...")
|
|
423
|
-
|
|
424
|
-
2. MODIFY EXISTING PDF:
|
|
425
|
-
- Pass array of operations as 'content'.
|
|
426
|
-
- NEVER overwrite the original file.
|
|
427
|
-
- ALWAYS provide a new filename in 'outputPath'.
|
|
428
|
-
- After modifying, show original file path and new file path to user.
|
|
429
|
-
|
|
430
|
-
write_pdf(path="doc.pdf", content=[
|
|
431
|
-
{ type: "delete", pageIndexes: [0, 2] },
|
|
432
|
-
{ type: "insert", pageIndex: 1, markdown: "# New Page" }
|
|
433
|
-
])
|
|
434
|
-
|
|
435
|
-
OPERATIONS:
|
|
436
|
-
- delete: Remove pages by 0-based index.
|
|
437
|
-
{ type: "delete", pageIndexes: [0, 1, 5] }
|
|
438
|
-
|
|
439
|
-
- insert: Add pages at a specific 0-based index.
|
|
440
|
-
{ type: "insert", pageIndex: 0, markdown: "..." }
|
|
441
|
-
{ type: "insert", pageIndex: 5, sourcePdfPath: "/path/to/source.pdf" }
|
|
442
|
-
|
|
443
|
-
PAGE BREAKS:
|
|
444
|
-
To force a page break, use this HTML element:
|
|
445
|
-
<div style="page-break-before: always;"></div>
|
|
446
|
-
|
|
447
|
-
Example:
|
|
448
|
-
"# Page 1\\n\\n<div style=\\"page-break-before: always;\\"></div>\\n\\n# Page 2"
|
|
449
|
-
|
|
450
|
-
ADVANCED STYLING:
|
|
451
|
-
HTML/CSS and inline SVG are supported for:
|
|
452
|
-
- Text styling: colors, sizes, alignment, highlights
|
|
453
|
-
- Boxes: borders, backgrounds, padding, rounded corners
|
|
454
|
-
- SVG graphics: charts, diagrams, icons, shapes
|
|
455
|
-
- Images: <img src="/absolute/path/image.jpg" width="300" /> or 
|
|
456
|
-
|
|
457
|
-
Supports standard markdown features including headers, lists, code blocks, tables, and basic formatting.
|
|
458
|
-
|
|
459
|
-
Only works within allowed directories.
|
|
460
|
-
|
|
461
|
-
${PATH_GUIDANCE}
|
|
411
|
+
description: `
|
|
412
|
+
Create a new PDF file or modify an existing one.
|
|
413
|
+
|
|
414
|
+
THIS IS THE ONLY TOOL FOR CREATING AND MODIFYING PDF FILES.
|
|
415
|
+
|
|
416
|
+
RULES ABOUT FILENAMES:
|
|
417
|
+
- When creating a new PDF, 'outputPath' MUST be provided and MUST use a new unique filename (e.g., "result_01.pdf", "analysis_2025_01.pdf", etc.).
|
|
418
|
+
|
|
419
|
+
MODES:
|
|
420
|
+
1. CREATE NEW PDF:
|
|
421
|
+
- Pass a markdown string as 'content'.
|
|
422
|
+
write_pdf(path="doc.pdf", content="# Title\\n\\nBody text...")
|
|
423
|
+
|
|
424
|
+
2. MODIFY EXISTING PDF:
|
|
425
|
+
- Pass array of operations as 'content'.
|
|
426
|
+
- NEVER overwrite the original file.
|
|
427
|
+
- ALWAYS provide a new filename in 'outputPath'.
|
|
428
|
+
- After modifying, show original file path and new file path to user.
|
|
429
|
+
|
|
430
|
+
write_pdf(path="doc.pdf", content=[
|
|
431
|
+
{ type: "delete", pageIndexes: [0, 2] },
|
|
432
|
+
{ type: "insert", pageIndex: 1, markdown: "# New Page" }
|
|
433
|
+
])
|
|
434
|
+
|
|
435
|
+
OPERATIONS:
|
|
436
|
+
- delete: Remove pages by 0-based index.
|
|
437
|
+
{ type: "delete", pageIndexes: [0, 1, 5] }
|
|
438
|
+
|
|
439
|
+
- insert: Add pages at a specific 0-based index.
|
|
440
|
+
{ type: "insert", pageIndex: 0, markdown: "..." }
|
|
441
|
+
{ type: "insert", pageIndex: 5, sourcePdfPath: "/path/to/source.pdf" }
|
|
442
|
+
|
|
443
|
+
PAGE BREAKS:
|
|
444
|
+
To force a page break, use this HTML element:
|
|
445
|
+
<div style="page-break-before: always;"></div>
|
|
446
|
+
|
|
447
|
+
Example:
|
|
448
|
+
"# Page 1\\n\\n<div style=\\"page-break-before: always;\\"></div>\\n\\n# Page 2"
|
|
449
|
+
|
|
450
|
+
ADVANCED STYLING:
|
|
451
|
+
HTML/CSS and inline SVG are supported for:
|
|
452
|
+
- Text styling: colors, sizes, alignment, highlights
|
|
453
|
+
- Boxes: borders, backgrounds, padding, rounded corners
|
|
454
|
+
- SVG graphics: charts, diagrams, icons, shapes
|
|
455
|
+
- Images: <img src="/absolute/path/image.jpg" width="300" /> or 
|
|
456
|
+
|
|
457
|
+
Supports standard markdown features including headers, lists, code blocks, tables, and basic formatting.
|
|
458
|
+
|
|
459
|
+
Only works within allowed directories.
|
|
460
|
+
|
|
461
|
+
${PATH_GUIDANCE}
|
|
462
462
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
463
463
|
inputSchema: zodToJsonSchema(WritePdfArgsSchema),
|
|
464
464
|
annotations: {
|
|
@@ -470,13 +470,13 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
470
470
|
},
|
|
471
471
|
{
|
|
472
472
|
name: "create_directory",
|
|
473
|
-
description: `
|
|
474
|
-
Create a new directory or ensure a directory exists.
|
|
475
|
-
|
|
476
|
-
Can create multiple nested directories in one operation.
|
|
477
|
-
Only works within allowed directories.
|
|
478
|
-
|
|
479
|
-
${PATH_GUIDANCE}
|
|
473
|
+
description: `
|
|
474
|
+
Create a new directory or ensure a directory exists.
|
|
475
|
+
|
|
476
|
+
Can create multiple nested directories in one operation.
|
|
477
|
+
Only works within allowed directories.
|
|
478
|
+
|
|
479
|
+
${PATH_GUIDANCE}
|
|
480
480
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
481
481
|
inputSchema: zodToJsonSchema(CreateDirectoryArgsSchema),
|
|
482
482
|
annotations: {
|
|
@@ -487,36 +487,36 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
487
487
|
},
|
|
488
488
|
{
|
|
489
489
|
name: "list_directory",
|
|
490
|
-
description: `
|
|
491
|
-
Get a detailed listing of all files and directories in a specified path.
|
|
492
|
-
|
|
493
|
-
Use this instead of 'execute_command' with ls/dir commands.
|
|
494
|
-
Results distinguish between files and directories with [FILE] and [DIR] prefixes.
|
|
495
|
-
|
|
496
|
-
Supports recursive listing with the 'depth' parameter (default: 2):
|
|
497
|
-
- depth=1: Only direct contents of the directory
|
|
498
|
-
- depth=2: Contents plus one level of subdirectories
|
|
499
|
-
- depth=3+: Multiple levels deep
|
|
500
|
-
|
|
501
|
-
CONTEXT OVERFLOW PROTECTION:
|
|
502
|
-
- Top-level directory shows ALL items
|
|
503
|
-
- Nested directories are limited to 100 items maximum per directory
|
|
504
|
-
- When a nested directory has more than 100 items, you'll see a warning like:
|
|
505
|
-
[WARNING] node_modules: 500 items hidden (showing first 100 of 600 total)
|
|
506
|
-
- This prevents overwhelming the context with large directories like node_modules
|
|
507
|
-
|
|
508
|
-
Results show full relative paths from the root directory being listed.
|
|
509
|
-
Example output with depth=2:
|
|
510
|
-
[DIR] src
|
|
511
|
-
[FILE] src/index.ts
|
|
512
|
-
[DIR] src/tools
|
|
513
|
-
[FILE] src/tools/filesystem.ts
|
|
514
|
-
|
|
515
|
-
If a directory cannot be accessed, it will show [DENIED] instead.
|
|
516
|
-
If a path does not exist, it will show [NOT_FOUND] instead.
|
|
517
|
-
Only works within allowed directories.
|
|
518
|
-
|
|
519
|
-
${PATH_GUIDANCE}
|
|
490
|
+
description: `
|
|
491
|
+
Get a detailed listing of all files and directories in a specified path.
|
|
492
|
+
|
|
493
|
+
Use this instead of 'execute_command' with ls/dir commands.
|
|
494
|
+
Results distinguish between files and directories with [FILE] and [DIR] prefixes.
|
|
495
|
+
|
|
496
|
+
Supports recursive listing with the 'depth' parameter (default: 2):
|
|
497
|
+
- depth=1: Only direct contents of the directory
|
|
498
|
+
- depth=2: Contents plus one level of subdirectories
|
|
499
|
+
- depth=3+: Multiple levels deep
|
|
500
|
+
|
|
501
|
+
CONTEXT OVERFLOW PROTECTION:
|
|
502
|
+
- Top-level directory shows ALL items
|
|
503
|
+
- Nested directories are limited to 100 items maximum per directory
|
|
504
|
+
- When a nested directory has more than 100 items, you'll see a warning like:
|
|
505
|
+
[WARNING] node_modules: 500 items hidden (showing first 100 of 600 total)
|
|
506
|
+
- This prevents overwhelming the context with large directories like node_modules
|
|
507
|
+
|
|
508
|
+
Results show full relative paths from the root directory being listed.
|
|
509
|
+
Example output with depth=2:
|
|
510
|
+
[DIR] src
|
|
511
|
+
[FILE] src/index.ts
|
|
512
|
+
[DIR] src/tools
|
|
513
|
+
[FILE] src/tools/filesystem.ts
|
|
514
|
+
|
|
515
|
+
If a directory cannot be accessed, it will show [DENIED] instead.
|
|
516
|
+
If a path does not exist, it will show [NOT_FOUND] instead.
|
|
517
|
+
Only works within allowed directories.
|
|
518
|
+
|
|
519
|
+
${PATH_GUIDANCE}
|
|
520
520
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
521
521
|
inputSchema: zodToJsonSchema(ListDirectoryArgsSchema),
|
|
522
522
|
_meta: buildUiToolMeta(FILE_PREVIEW_RESOURCE_URI, true, showMcpUiPreviews),
|
|
@@ -527,13 +527,13 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
527
527
|
},
|
|
528
528
|
{
|
|
529
529
|
name: "move_file",
|
|
530
|
-
description: `
|
|
531
|
-
Move or rename files and directories.
|
|
532
|
-
|
|
533
|
-
Can move files between directories and rename them in a single operation.
|
|
534
|
-
Both source and destination must be within allowed directories.
|
|
535
|
-
|
|
536
|
-
${PATH_GUIDANCE}
|
|
530
|
+
description: `
|
|
531
|
+
Move or rename files and directories.
|
|
532
|
+
|
|
533
|
+
Can move files between directories and rename them in a single operation.
|
|
534
|
+
Both source and destination must be within allowed directories.
|
|
535
|
+
|
|
536
|
+
${PATH_GUIDANCE}
|
|
537
537
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
538
538
|
inputSchema: zodToJsonSchema(MoveFileArgsSchema),
|
|
539
539
|
annotations: {
|
|
@@ -545,84 +545,84 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
545
545
|
},
|
|
546
546
|
{
|
|
547
547
|
name: "start_search",
|
|
548
|
-
description: `
|
|
549
|
-
Start a streaming search that can return results progressively.
|
|
550
|
-
|
|
551
|
-
SEARCH STRATEGY GUIDE:
|
|
552
|
-
Choose the right search type based on what the user is looking for:
|
|
553
|
-
|
|
554
|
-
USE searchType="files" WHEN:
|
|
555
|
-
- User asks for specific files: "find package.json", "locate config files"
|
|
556
|
-
- Pattern looks like a filename: "*.js", "README.md", "test-*.tsx"
|
|
557
|
-
- User wants to find files by name/extension: "all TypeScript files", "Python scripts"
|
|
558
|
-
- Looking for configuration/setup files: ".env", "dockerfile", "tsconfig.json"
|
|
559
|
-
|
|
560
|
-
USE searchType="content" WHEN:
|
|
561
|
-
- User asks about code/logic: "authentication logic", "error handling", "API calls"
|
|
562
|
-
- Looking for functions/variables: "getUserData function", "useState hook"
|
|
563
|
-
- Searching for text/comments: "TODO items", "FIXME comments", "documentation"
|
|
564
|
-
- Finding patterns in code: "console.log statements", "import statements"
|
|
565
|
-
- User describes functionality: "components that handle login", "files with database queries"
|
|
566
|
-
|
|
567
|
-
WHEN UNSURE OR USER REQUEST IS AMBIGUOUS:
|
|
568
|
-
Run TWO searches in parallel - one for files and one for content:
|
|
569
|
-
|
|
570
|
-
Example approach for ambiguous queries like "find authentication stuff":
|
|
571
|
-
1. Start file search: searchType="files", pattern="auth"
|
|
572
|
-
2. Simultaneously start content search: searchType="content", pattern="authentication"
|
|
573
|
-
3. Present combined results: "Found 3 auth-related files and 8 files containing authentication code"
|
|
574
|
-
|
|
575
|
-
SEARCH TYPES:
|
|
576
|
-
- searchType="files": Find files by name (pattern matches file names)
|
|
577
|
-
- searchType="content": Search inside files for text patterns
|
|
578
|
-
|
|
579
|
-
PATTERN MATCHING MODES:
|
|
580
|
-
- Default (literalSearch=false): Patterns are treated as regular expressions
|
|
581
|
-
- Literal (literalSearch=true): Patterns are treated as exact strings
|
|
582
|
-
|
|
583
|
-
WHEN TO USE literalSearch=true:
|
|
584
|
-
Use literal search when searching for code patterns with special characters:
|
|
585
|
-
- Function calls with parentheses and quotes
|
|
586
|
-
- Array access with brackets
|
|
587
|
-
- Object methods with dots and parentheses
|
|
588
|
-
- File paths with backslashes
|
|
589
|
-
- Any pattern containing: . * + ? ^ $ { } [ ] | \\ ( )
|
|
590
|
-
|
|
591
|
-
IMPORTANT PARAMETERS:
|
|
592
|
-
- pattern: What to search for (file names OR content text)
|
|
593
|
-
- literalSearch: Use exact string matching instead of regex (default: false)
|
|
594
|
-
- filePattern: Optional filter to limit search to specific file types (e.g., "*.js", "package.json")
|
|
595
|
-
- ignoreCase: Case-insensitive search (default: true). Works for both file names and content.
|
|
596
|
-
- earlyTermination: Stop search early when exact filename match is found (optional: defaults to true for file searches, false for content searches)
|
|
597
|
-
|
|
598
|
-
DECISION EXAMPLES:
|
|
599
|
-
- "find package.json" → searchType="files", pattern="package.json" (specific file)
|
|
600
|
-
- "find authentication components" → searchType="content", pattern="authentication" (looking for functionality)
|
|
601
|
-
- "locate all React components" → searchType="files", pattern="*.tsx" or "*.jsx" (file pattern)
|
|
602
|
-
- "find TODO comments" → searchType="content", pattern="TODO" (text in files)
|
|
603
|
-
- "show me login files" → AMBIGUOUS → run both: files with "login" AND content with "login"
|
|
604
|
-
- "find config" → AMBIGUOUS → run both: config files AND files containing config code
|
|
605
|
-
|
|
606
|
-
COMPREHENSIVE SEARCH EXAMPLES:
|
|
607
|
-
- Find package.json files: searchType="files", pattern="package.json"
|
|
608
|
-
- Find all JS files: searchType="files", pattern="*.js"
|
|
609
|
-
- Search for TODO in code: searchType="content", pattern="TODO", filePattern="*.js|*.ts"
|
|
610
|
-
- Search for exact code: searchType="content", pattern="toast.error('test')", literalSearch=true
|
|
611
|
-
- Ambiguous request "find auth stuff": Run two searches:
|
|
612
|
-
1. searchType="files", pattern="auth"
|
|
613
|
-
2. searchType="content", pattern="authentication"
|
|
614
|
-
|
|
615
|
-
PRO TIP: When user requests are ambiguous about whether they want files or content,
|
|
616
|
-
run both searches concurrently and combine results for comprehensive coverage.
|
|
617
|
-
|
|
618
|
-
Unlike regular search tools, this starts a background search process and returns
|
|
619
|
-
immediately with a session ID. Use get_more_search_results to get results as they
|
|
620
|
-
come in, and stop_search to stop the search early if needed.
|
|
621
|
-
|
|
622
|
-
Perfect for large directories where you want to see results immediately and
|
|
623
|
-
have the option to cancel if the search takes too long or you find what you need.
|
|
624
|
-
|
|
625
|
-
${PATH_GUIDANCE}
|
|
548
|
+
description: `
|
|
549
|
+
Start a streaming search that can return results progressively.
|
|
550
|
+
|
|
551
|
+
SEARCH STRATEGY GUIDE:
|
|
552
|
+
Choose the right search type based on what the user is looking for:
|
|
553
|
+
|
|
554
|
+
USE searchType="files" WHEN:
|
|
555
|
+
- User asks for specific files: "find package.json", "locate config files"
|
|
556
|
+
- Pattern looks like a filename: "*.js", "README.md", "test-*.tsx"
|
|
557
|
+
- User wants to find files by name/extension: "all TypeScript files", "Python scripts"
|
|
558
|
+
- Looking for configuration/setup files: ".env", "dockerfile", "tsconfig.json"
|
|
559
|
+
|
|
560
|
+
USE searchType="content" WHEN:
|
|
561
|
+
- User asks about code/logic: "authentication logic", "error handling", "API calls"
|
|
562
|
+
- Looking for functions/variables: "getUserData function", "useState hook"
|
|
563
|
+
- Searching for text/comments: "TODO items", "FIXME comments", "documentation"
|
|
564
|
+
- Finding patterns in code: "console.log statements", "import statements"
|
|
565
|
+
- User describes functionality: "components that handle login", "files with database queries"
|
|
566
|
+
|
|
567
|
+
WHEN UNSURE OR USER REQUEST IS AMBIGUOUS:
|
|
568
|
+
Run TWO searches in parallel - one for files and one for content:
|
|
569
|
+
|
|
570
|
+
Example approach for ambiguous queries like "find authentication stuff":
|
|
571
|
+
1. Start file search: searchType="files", pattern="auth"
|
|
572
|
+
2. Simultaneously start content search: searchType="content", pattern="authentication"
|
|
573
|
+
3. Present combined results: "Found 3 auth-related files and 8 files containing authentication code"
|
|
574
|
+
|
|
575
|
+
SEARCH TYPES:
|
|
576
|
+
- searchType="files": Find files by name (pattern matches file names)
|
|
577
|
+
- searchType="content": Search inside files for text patterns
|
|
578
|
+
|
|
579
|
+
PATTERN MATCHING MODES:
|
|
580
|
+
- Default (literalSearch=false): Patterns are treated as regular expressions
|
|
581
|
+
- Literal (literalSearch=true): Patterns are treated as exact strings
|
|
582
|
+
|
|
583
|
+
WHEN TO USE literalSearch=true:
|
|
584
|
+
Use literal search when searching for code patterns with special characters:
|
|
585
|
+
- Function calls with parentheses and quotes
|
|
586
|
+
- Array access with brackets
|
|
587
|
+
- Object methods with dots and parentheses
|
|
588
|
+
- File paths with backslashes
|
|
589
|
+
- Any pattern containing: . * + ? ^ $ { } [ ] | \\ ( )
|
|
590
|
+
|
|
591
|
+
IMPORTANT PARAMETERS:
|
|
592
|
+
- pattern: What to search for (file names OR content text)
|
|
593
|
+
- literalSearch: Use exact string matching instead of regex (default: false)
|
|
594
|
+
- filePattern: Optional filter to limit search to specific file types (e.g., "*.js", "package.json")
|
|
595
|
+
- ignoreCase: Case-insensitive search (default: true). Works for both file names and content.
|
|
596
|
+
- earlyTermination: Stop search early when exact filename match is found (optional: defaults to true for file searches, false for content searches)
|
|
597
|
+
|
|
598
|
+
DECISION EXAMPLES:
|
|
599
|
+
- "find package.json" → searchType="files", pattern="package.json" (specific file)
|
|
600
|
+
- "find authentication components" → searchType="content", pattern="authentication" (looking for functionality)
|
|
601
|
+
- "locate all React components" → searchType="files", pattern="*.tsx" or "*.jsx" (file pattern)
|
|
602
|
+
- "find TODO comments" → searchType="content", pattern="TODO" (text in files)
|
|
603
|
+
- "show me login files" → AMBIGUOUS → run both: files with "login" AND content with "login"
|
|
604
|
+
- "find config" → AMBIGUOUS → run both: config files AND files containing config code
|
|
605
|
+
|
|
606
|
+
COMPREHENSIVE SEARCH EXAMPLES:
|
|
607
|
+
- Find package.json files: searchType="files", pattern="package.json"
|
|
608
|
+
- Find all JS files: searchType="files", pattern="*.js"
|
|
609
|
+
- Search for TODO in code: searchType="content", pattern="TODO", filePattern="*.js|*.ts"
|
|
610
|
+
- Search for exact code: searchType="content", pattern="toast.error('test')", literalSearch=true
|
|
611
|
+
- Ambiguous request "find auth stuff": Run two searches:
|
|
612
|
+
1. searchType="files", pattern="auth"
|
|
613
|
+
2. searchType="content", pattern="authentication"
|
|
614
|
+
|
|
615
|
+
PRO TIP: When user requests are ambiguous about whether they want files or content,
|
|
616
|
+
run both searches concurrently and combine results for comprehensive coverage.
|
|
617
|
+
|
|
618
|
+
Unlike regular search tools, this starts a background search process and returns
|
|
619
|
+
immediately with a session ID. Use get_more_search_results to get results as they
|
|
620
|
+
come in, and stop_search to stop the search early if needed.
|
|
621
|
+
|
|
622
|
+
Perfect for large directories where you want to see results immediately and
|
|
623
|
+
have the option to cancel if the search takes too long or you find what you need.
|
|
624
|
+
|
|
625
|
+
${PATH_GUIDANCE}
|
|
626
626
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
627
627
|
inputSchema: zodToJsonSchema(StartSearchArgsSchema),
|
|
628
628
|
annotations: {
|
|
@@ -632,27 +632,27 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
632
632
|
},
|
|
633
633
|
{
|
|
634
634
|
name: "get_more_search_results",
|
|
635
|
-
description: `
|
|
636
|
-
Get more results from an active search with offset-based pagination.
|
|
637
|
-
|
|
638
|
-
Supports partial result reading with:
|
|
639
|
-
- 'offset' (start result index, default: 0)
|
|
640
|
-
* Positive: Start from result N (0-based indexing)
|
|
641
|
-
* Negative: Read last N results from end (tail behavior)
|
|
642
|
-
- 'length' (max results to read, default: 100)
|
|
643
|
-
* Used with positive offsets for range reading
|
|
644
|
-
* Ignored when offset is negative (reads all requested tail results)
|
|
645
|
-
|
|
646
|
-
Examples:
|
|
647
|
-
- offset: 0, length: 100 → First 100 results
|
|
648
|
-
- offset: 200, length: 50 → Results 200-249
|
|
649
|
-
- offset: -20 → Last 20 results
|
|
650
|
-
- offset: -5, length: 10 → Last 5 results (length ignored)
|
|
651
|
-
|
|
652
|
-
Returns only results in the specified range, along with search status.
|
|
653
|
-
Works like read_process_output - call this repeatedly to get progressive
|
|
654
|
-
results from a search started with start_search.
|
|
655
|
-
|
|
635
|
+
description: `
|
|
636
|
+
Get more results from an active search with offset-based pagination.
|
|
637
|
+
|
|
638
|
+
Supports partial result reading with:
|
|
639
|
+
- 'offset' (start result index, default: 0)
|
|
640
|
+
* Positive: Start from result N (0-based indexing)
|
|
641
|
+
* Negative: Read last N results from end (tail behavior)
|
|
642
|
+
- 'length' (max results to read, default: 100)
|
|
643
|
+
* Used with positive offsets for range reading
|
|
644
|
+
* Ignored when offset is negative (reads all requested tail results)
|
|
645
|
+
|
|
646
|
+
Examples:
|
|
647
|
+
- offset: 0, length: 100 → First 100 results
|
|
648
|
+
- offset: 200, length: 50 → Results 200-249
|
|
649
|
+
- offset: -20 → Last 20 results
|
|
650
|
+
- offset: -5, length: 10 → Last 5 results (length ignored)
|
|
651
|
+
|
|
652
|
+
Returns only results in the specified range, along with search status.
|
|
653
|
+
Works like read_process_output - call this repeatedly to get progressive
|
|
654
|
+
results from a search started with start_search.
|
|
655
|
+
|
|
656
656
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
657
657
|
inputSchema: zodToJsonSchema(GetMoreSearchResultsArgsSchema),
|
|
658
658
|
annotations: {
|
|
@@ -662,16 +662,16 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
662
662
|
},
|
|
663
663
|
{
|
|
664
664
|
name: "stop_search",
|
|
665
|
-
description: `
|
|
666
|
-
Stop an active search.
|
|
667
|
-
|
|
668
|
-
Stops the background search process gracefully. Use this when you've found
|
|
669
|
-
what you need or if a search is taking too long. Similar to force_terminate
|
|
670
|
-
for terminal processes.
|
|
671
|
-
|
|
672
|
-
The search will still be available for reading final results until it's
|
|
673
|
-
automatically cleaned up after 5 minutes.
|
|
674
|
-
|
|
665
|
+
description: `
|
|
666
|
+
Stop an active search.
|
|
667
|
+
|
|
668
|
+
Stops the background search process gracefully. Use this when you've found
|
|
669
|
+
what you need or if a search is taking too long. Similar to force_terminate
|
|
670
|
+
for terminal processes.
|
|
671
|
+
|
|
672
|
+
The search will still be available for reading final results until it's
|
|
673
|
+
automatically cleaned up after 5 minutes.
|
|
674
|
+
|
|
675
675
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
676
676
|
inputSchema: zodToJsonSchema(StopSearchArgsSchema),
|
|
677
677
|
annotations: {
|
|
@@ -682,13 +682,13 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
682
682
|
},
|
|
683
683
|
{
|
|
684
684
|
name: "list_searches",
|
|
685
|
-
description: `
|
|
686
|
-
List all active searches.
|
|
687
|
-
|
|
688
|
-
Shows search IDs, search types, patterns, status, and runtime.
|
|
689
|
-
Similar to list_sessions for terminal processes. Useful for managing
|
|
690
|
-
multiple concurrent searches.
|
|
691
|
-
|
|
685
|
+
description: `
|
|
686
|
+
List all active searches.
|
|
687
|
+
|
|
688
|
+
Shows search IDs, search types, patterns, status, and runtime.
|
|
689
|
+
Similar to list_sessions for terminal processes. Useful for managing
|
|
690
|
+
multiple concurrent searches.
|
|
691
|
+
|
|
692
692
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
693
693
|
inputSchema: zodToJsonSchema(ListSearchesArgsSchema),
|
|
694
694
|
annotations: {
|
|
@@ -698,21 +698,21 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
698
698
|
},
|
|
699
699
|
{
|
|
700
700
|
name: "get_file_info",
|
|
701
|
-
description: `
|
|
702
|
-
Retrieve detailed metadata about a file or directory including:
|
|
703
|
-
- size
|
|
704
|
-
- creation time
|
|
705
|
-
- last modified time
|
|
706
|
-
- permissions
|
|
707
|
-
- type
|
|
708
|
-
- lineCount (for text files)
|
|
709
|
-
- lastLine (zero-indexed number of last line, for text files)
|
|
710
|
-
- appendPosition (line number for appending, for text files)
|
|
711
|
-
- sheets (for Excel files - array of {name, rowCount, colCount})
|
|
712
|
-
|
|
713
|
-
Only works within allowed directories.
|
|
714
|
-
|
|
715
|
-
${PATH_GUIDANCE}
|
|
701
|
+
description: `
|
|
702
|
+
Retrieve detailed metadata about a file or directory including:
|
|
703
|
+
- size
|
|
704
|
+
- creation time
|
|
705
|
+
- last modified time
|
|
706
|
+
- permissions
|
|
707
|
+
- type
|
|
708
|
+
- lineCount (for text files)
|
|
709
|
+
- lastLine (zero-indexed number of last line, for text files)
|
|
710
|
+
- appendPosition (line number for appending, for text files)
|
|
711
|
+
- sheets (for Excel files - array of {name, rowCount, colCount})
|
|
712
|
+
|
|
713
|
+
Only works within allowed directories.
|
|
714
|
+
|
|
715
|
+
${PATH_GUIDANCE}
|
|
716
716
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
717
717
|
inputSchema: zodToJsonSchema(GetFileInfoArgsSchema),
|
|
718
718
|
annotations: {
|
|
@@ -724,58 +724,58 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
724
724
|
// Editing tools
|
|
725
725
|
{
|
|
726
726
|
name: "edit_block",
|
|
727
|
-
description: `
|
|
728
|
-
Apply surgical edits to files.
|
|
729
|
-
|
|
730
|
-
BEST PRACTICE: Make multiple small, focused edits rather than one large edit.
|
|
731
|
-
Each edit_block call should change only what needs to be changed - include just enough
|
|
732
|
-
context to uniquely identify the text being modified.
|
|
733
|
-
|
|
734
|
-
FORMAT HANDLING (by extension):
|
|
735
|
-
|
|
736
|
-
EXCEL FILES (.xlsx, .xls, .xlsm) - Range Update mode:
|
|
737
|
-
Takes:
|
|
738
|
-
- file_path: Path to the Excel file
|
|
739
|
-
- range: ALWAYS use FROM:TO format - "SheetName!A1:C10" or "SheetName!C1:C1"
|
|
740
|
-
- content: 2D array, e.g., [["H1","H2"],["R1","R2"]]
|
|
741
|
-
|
|
742
|
-
TEXT FILES - Find/Replace mode:
|
|
743
|
-
Takes:
|
|
744
|
-
- file_path: Path to the file to edit
|
|
745
|
-
- old_string: Text to replace
|
|
746
|
-
- new_string: Replacement text
|
|
747
|
-
- expected_replacements: Optional number of replacements (default: 1)
|
|
748
|
-
|
|
749
|
-
DOCX FILES (.docx) - XML Find/Replace mode:
|
|
750
|
-
Takes same parameters as text files (old_string, new_string, expected_replacements).
|
|
751
|
-
Operates on the pretty-printed XML inside the DOCX — the same XML you see from
|
|
752
|
-
read_file with offset/length. Copy XML fragments from read output as old_string.
|
|
753
|
-
After editing, the XML is repacked into a valid DOCX.
|
|
754
|
-
Also searches headers/footers if not found in document body.
|
|
755
|
-
Examples:
|
|
756
|
-
- Replace text: old_string="<w:t>Old Text</w:t>" new_string="<w:t>New Text</w:t>"
|
|
757
|
-
- Change style: old_string='<w:pStyle w:val="Normal"/>' new_string='<w:pStyle w:val="Heading1"/>'
|
|
758
|
-
- Add content: include surrounding XML context in old_string, add new elements in new_string
|
|
759
|
-
|
|
760
|
-
By default, replaces only ONE occurrence of the search text.
|
|
761
|
-
To replace multiple occurrences, provide expected_replacements with
|
|
762
|
-
the exact number of matches expected.
|
|
763
|
-
|
|
764
|
-
UNIQUENESS REQUIREMENT: When expected_replacements=1 (default), include the minimal
|
|
765
|
-
amount of context necessary (typically 1-3 lines) before and after the change point,
|
|
766
|
-
with exact whitespace and indentation.
|
|
767
|
-
|
|
768
|
-
When editing multiple sections, make separate edit_block calls for each distinct change
|
|
769
|
-
rather than one large replacement.
|
|
770
|
-
|
|
771
|
-
When a close but non-exact match is found, a character-level diff is shown in the format:
|
|
772
|
-
common_prefix{-removed-}{+added+}common_suffix to help you identify what's different.
|
|
773
|
-
|
|
774
|
-
Similar to write_file, there is a configurable line limit (fileWriteLineLimit) that warns
|
|
775
|
-
if the edited file exceeds this limit. If this happens, consider breaking your edits into
|
|
776
|
-
smaller, more focused changes.
|
|
777
|
-
|
|
778
|
-
${PATH_GUIDANCE}
|
|
727
|
+
description: `
|
|
728
|
+
Apply surgical edits to files.
|
|
729
|
+
|
|
730
|
+
BEST PRACTICE: Make multiple small, focused edits rather than one large edit.
|
|
731
|
+
Each edit_block call should change only what needs to be changed - include just enough
|
|
732
|
+
context to uniquely identify the text being modified.
|
|
733
|
+
|
|
734
|
+
FORMAT HANDLING (by extension):
|
|
735
|
+
|
|
736
|
+
EXCEL FILES (.xlsx, .xls, .xlsm) - Range Update mode:
|
|
737
|
+
Takes:
|
|
738
|
+
- file_path: Path to the Excel file
|
|
739
|
+
- range: ALWAYS use FROM:TO format - "SheetName!A1:C10" or "SheetName!C1:C1"
|
|
740
|
+
- content: 2D array, e.g., [["H1","H2"],["R1","R2"]]
|
|
741
|
+
|
|
742
|
+
TEXT FILES - Find/Replace mode:
|
|
743
|
+
Takes:
|
|
744
|
+
- file_path: Path to the file to edit
|
|
745
|
+
- old_string: Text to replace
|
|
746
|
+
- new_string: Replacement text
|
|
747
|
+
- expected_replacements: Optional number of replacements (default: 1)
|
|
748
|
+
|
|
749
|
+
DOCX FILES (.docx) - XML Find/Replace mode:
|
|
750
|
+
Takes same parameters as text files (old_string, new_string, expected_replacements).
|
|
751
|
+
Operates on the pretty-printed XML inside the DOCX — the same XML you see from
|
|
752
|
+
read_file with offset/length. Copy XML fragments from read output as old_string.
|
|
753
|
+
After editing, the XML is repacked into a valid DOCX.
|
|
754
|
+
Also searches headers/footers if not found in document body.
|
|
755
|
+
Examples:
|
|
756
|
+
- Replace text: old_string="<w:t>Old Text</w:t>" new_string="<w:t>New Text</w:t>"
|
|
757
|
+
- Change style: old_string='<w:pStyle w:val="Normal"/>' new_string='<w:pStyle w:val="Heading1"/>'
|
|
758
|
+
- Add content: include surrounding XML context in old_string, add new elements in new_string
|
|
759
|
+
|
|
760
|
+
By default, replaces only ONE occurrence of the search text.
|
|
761
|
+
To replace multiple occurrences, provide expected_replacements with
|
|
762
|
+
the exact number of matches expected.
|
|
763
|
+
|
|
764
|
+
UNIQUENESS REQUIREMENT: When expected_replacements=1 (default), include the minimal
|
|
765
|
+
amount of context necessary (typically 1-3 lines) before and after the change point,
|
|
766
|
+
with exact whitespace and indentation.
|
|
767
|
+
|
|
768
|
+
When editing multiple sections, make separate edit_block calls for each distinct change
|
|
769
|
+
rather than one large replacement.
|
|
770
|
+
|
|
771
|
+
When a close but non-exact match is found, a character-level diff is shown in the format:
|
|
772
|
+
common_prefix{-removed-}{+added+}common_suffix to help you identify what's different.
|
|
773
|
+
|
|
774
|
+
Similar to write_file, there is a configurable line limit (fileWriteLineLimit) that warns
|
|
775
|
+
if the edited file exceeds this limit. If this happens, consider breaking your edits into
|
|
776
|
+
smaller, more focused changes.
|
|
777
|
+
|
|
778
|
+
${PATH_GUIDANCE}
|
|
779
779
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
780
780
|
inputSchema: zodToJsonSchema(EditBlockArgsSchema),
|
|
781
781
|
_meta: buildUiToolMeta(FILE_PREVIEW_RESOURCE_URI, true, showMcpUiPreviews),
|
|
@@ -789,68 +789,68 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
789
789
|
// Terminal tools
|
|
790
790
|
{
|
|
791
791
|
name: "start_process",
|
|
792
|
-
description: `
|
|
793
|
-
Start a new terminal process with intelligent state detection.
|
|
794
|
-
|
|
795
|
-
PRIMARY TOOL FOR FILE ANALYSIS AND DATA PROCESSING
|
|
796
|
-
This is the ONLY correct tool for analyzing local files (CSV, JSON, logs, etc.).
|
|
797
|
-
The analysis tool CANNOT access local files and WILL FAIL - always use processes for file-based work.
|
|
798
|
-
|
|
799
|
-
CRITICAL RULE: For ANY local file work, ALWAYS use this tool + interact_with_process, NEVER use analysis/REPL tool.
|
|
800
|
-
|
|
801
|
-
${OS_GUIDANCE}
|
|
802
|
-
|
|
803
|
-
REQUIRED WORKFLOW FOR LOCAL FILES:
|
|
804
|
-
1. start_process("python3 -i") - Start Python REPL for data analysis
|
|
805
|
-
2. interact_with_process(pid, "import pandas as pd, numpy as np")
|
|
806
|
-
3. interact_with_process(pid, "df = pd.read_csv('/absolute/path/file.csv')")
|
|
807
|
-
4. interact_with_process(pid, "print(df.describe())")
|
|
808
|
-
5. Continue analysis with pandas, matplotlib, seaborn, etc.
|
|
809
|
-
|
|
810
|
-
COMMON FILE ANALYSIS PATTERNS:
|
|
811
|
-
• start_process("python3 -i") → Python REPL for data analysis (RECOMMENDED)
|
|
812
|
-
• start_process("node -i") → Node.js REPL for JSON processing
|
|
813
|
-
• start_process("node:local") → Node.js on MCP server (stateless, ES imports, all code in one call)
|
|
814
|
-
• start_process("cut -d',' -f1 file.csv | sort | uniq -c") → Quick CSV analysis
|
|
815
|
-
• start_process("wc -l /path/file.csv") → Line counting
|
|
816
|
-
• start_process("head -10 /path/file.csv") → File preview
|
|
817
|
-
|
|
818
|
-
BINARY FILE SUPPORT:
|
|
819
|
-
For PDF, Excel, Word, archives, databases, and other binary formats, use process tools with appropriate libraries or command-line utilities.
|
|
820
|
-
|
|
821
|
-
INTERACTIVE PROCESSES FOR DATA ANALYSIS:
|
|
822
|
-
For code/calculations, use in this priority order:
|
|
823
|
-
1. start_process("python3 -i") - Python REPL (preferred)
|
|
824
|
-
2. start_process("node -i") - Node.js REPL (when Python unavailable)
|
|
825
|
-
3. start_process("node:local") - Node.js fallback (when node -i fails)
|
|
826
|
-
4. Use interact_with_process() to send commands
|
|
827
|
-
5. Use read_process_output() to get responses
|
|
828
|
-
When Python is unavailable, prefer Node.js over shell for calculations.
|
|
829
|
-
Node.js: Always use ES import syntax (import x from 'y'), not require().
|
|
830
|
-
|
|
831
|
-
SMART DETECTION:
|
|
832
|
-
- Detects REPL prompts (>>>, >, $, etc.)
|
|
833
|
-
- Identifies when process is waiting for input
|
|
834
|
-
- Recognizes process completion vs timeout
|
|
835
|
-
- Early exit prevents unnecessary waiting
|
|
836
|
-
|
|
837
|
-
STATES DETECTED:
|
|
838
|
-
Process waiting for input (shows prompt)
|
|
839
|
-
Process finished execution
|
|
840
|
-
Process running (use read_process_output)
|
|
841
|
-
|
|
842
|
-
PERFORMANCE DEBUGGING (verbose_timing parameter):
|
|
843
|
-
Set verbose_timing: true to get detailed timing information including:
|
|
844
|
-
- Exit reason (early_exit_quick_pattern, early_exit_periodic_check, process_exit, timeout)
|
|
845
|
-
- Total duration and time to first output
|
|
846
|
-
- Complete timeline of all output events with timestamps
|
|
847
|
-
- Which detection mechanism triggered early exit
|
|
848
|
-
Use this to identify missed optimization opportunities and improve detection patterns.
|
|
849
|
-
|
|
850
|
-
ALWAYS USE FOR: Local file analysis, CSV processing, data exploration, system commands
|
|
851
|
-
NEVER USE ANALYSIS TOOL FOR: Local file access (analysis tool is browser-only and WILL FAIL)
|
|
852
|
-
|
|
853
|
-
${PATH_GUIDANCE}
|
|
792
|
+
description: `
|
|
793
|
+
Start a new terminal process with intelligent state detection.
|
|
794
|
+
|
|
795
|
+
PRIMARY TOOL FOR FILE ANALYSIS AND DATA PROCESSING
|
|
796
|
+
This is the ONLY correct tool for analyzing local files (CSV, JSON, logs, etc.).
|
|
797
|
+
The analysis tool CANNOT access local files and WILL FAIL - always use processes for file-based work.
|
|
798
|
+
|
|
799
|
+
CRITICAL RULE: For ANY local file work, ALWAYS use this tool + interact_with_process, NEVER use analysis/REPL tool.
|
|
800
|
+
|
|
801
|
+
${OS_GUIDANCE}
|
|
802
|
+
|
|
803
|
+
REQUIRED WORKFLOW FOR LOCAL FILES:
|
|
804
|
+
1. start_process("python3 -i") - Start Python REPL for data analysis
|
|
805
|
+
2. interact_with_process(pid, "import pandas as pd, numpy as np")
|
|
806
|
+
3. interact_with_process(pid, "df = pd.read_csv('/absolute/path/file.csv')")
|
|
807
|
+
4. interact_with_process(pid, "print(df.describe())")
|
|
808
|
+
5. Continue analysis with pandas, matplotlib, seaborn, etc.
|
|
809
|
+
|
|
810
|
+
COMMON FILE ANALYSIS PATTERNS:
|
|
811
|
+
• start_process("python3 -i") → Python REPL for data analysis (RECOMMENDED)
|
|
812
|
+
• start_process("node -i") → Node.js REPL for JSON processing
|
|
813
|
+
• start_process("node:local") → Node.js on MCP server (stateless, ES imports, all code in one call)
|
|
814
|
+
• start_process("cut -d',' -f1 file.csv | sort | uniq -c") → Quick CSV analysis
|
|
815
|
+
• start_process("wc -l /path/file.csv") → Line counting
|
|
816
|
+
• start_process("head -10 /path/file.csv") → File preview
|
|
817
|
+
|
|
818
|
+
BINARY FILE SUPPORT:
|
|
819
|
+
For PDF, Excel, Word, archives, databases, and other binary formats, use process tools with appropriate libraries or command-line utilities.
|
|
820
|
+
|
|
821
|
+
INTERACTIVE PROCESSES FOR DATA ANALYSIS:
|
|
822
|
+
For code/calculations, use in this priority order:
|
|
823
|
+
1. start_process("python3 -i") - Python REPL (preferred)
|
|
824
|
+
2. start_process("node -i") - Node.js REPL (when Python unavailable)
|
|
825
|
+
3. start_process("node:local") - Node.js fallback (when node -i fails)
|
|
826
|
+
4. Use interact_with_process() to send commands
|
|
827
|
+
5. Use read_process_output() to get responses
|
|
828
|
+
When Python is unavailable, prefer Node.js over shell for calculations.
|
|
829
|
+
Node.js: Always use ES import syntax (import x from 'y'), not require().
|
|
830
|
+
|
|
831
|
+
SMART DETECTION:
|
|
832
|
+
- Detects REPL prompts (>>>, >, $, etc.)
|
|
833
|
+
- Identifies when process is waiting for input
|
|
834
|
+
- Recognizes process completion vs timeout
|
|
835
|
+
- Early exit prevents unnecessary waiting
|
|
836
|
+
|
|
837
|
+
STATES DETECTED:
|
|
838
|
+
Process waiting for input (shows prompt)
|
|
839
|
+
Process finished execution
|
|
840
|
+
Process running (use read_process_output)
|
|
841
|
+
|
|
842
|
+
PERFORMANCE DEBUGGING (verbose_timing parameter):
|
|
843
|
+
Set verbose_timing: true to get detailed timing information including:
|
|
844
|
+
- Exit reason (early_exit_quick_pattern, early_exit_periodic_check, process_exit, timeout)
|
|
845
|
+
- Total duration and time to first output
|
|
846
|
+
- Complete timeline of all output events with timestamps
|
|
847
|
+
- Which detection mechanism triggered early exit
|
|
848
|
+
Use this to identify missed optimization opportunities and improve detection patterns.
|
|
849
|
+
|
|
850
|
+
ALWAYS USE FOR: Local file analysis, CSV processing, data exploration, system commands
|
|
851
|
+
NEVER USE ANALYSIS TOOL FOR: Local file access (analysis tool is browser-only and WILL FAIL)
|
|
852
|
+
|
|
853
|
+
${PATH_GUIDANCE}
|
|
854
854
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
855
855
|
inputSchema: zodToJsonSchema(StartProcessArgsSchema),
|
|
856
856
|
annotations: {
|
|
@@ -862,38 +862,38 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
862
862
|
},
|
|
863
863
|
{
|
|
864
864
|
name: "read_process_output",
|
|
865
|
-
description: `
|
|
866
|
-
Read output from a running process with file-like pagination support.
|
|
867
|
-
|
|
868
|
-
Supports partial output reading with offset and length parameters (like read_file):
|
|
869
|
-
- 'offset' (start line, default: 0)
|
|
870
|
-
* offset=0: Read NEW output since last read (default, like old behavior)
|
|
871
|
-
* Positive: Read from absolute line position
|
|
872
|
-
* Negative: Read last N lines from end (tail behavior)
|
|
873
|
-
- 'length' (max lines to read, default: configurable via 'fileReadLineLimit' setting)
|
|
874
|
-
|
|
875
|
-
Examples:
|
|
876
|
-
- offset: 0, length: 100 → First 100 NEW lines since last read
|
|
877
|
-
- offset: 0 → All new lines (respects config limit)
|
|
878
|
-
- offset: 500, length: 50 → Lines 500-549 (absolute position)
|
|
879
|
-
- offset: -20 → Last 20 lines (tail)
|
|
880
|
-
- offset: -50, length: 10 → Start 50 from end, read 10 lines
|
|
881
|
-
|
|
882
|
-
OUTPUT PROTECTION:
|
|
883
|
-
- Uses same fileReadLineLimit as read_file (default: 1000 lines)
|
|
884
|
-
- Returns status like: [Reading 100 lines from line 0 (total: 5000 lines, 4900 remaining)]
|
|
885
|
-
- Prevents context overflow from verbose processes
|
|
886
|
-
|
|
887
|
-
SMART FEATURES:
|
|
888
|
-
- For offset=0, waits up to timeout_ms for new output to arrive
|
|
889
|
-
- Detects REPL prompts and process completion
|
|
890
|
-
- Shows process state (waiting for input, finished, etc.)
|
|
891
|
-
|
|
892
|
-
DETECTION STATES:
|
|
893
|
-
Process waiting for input (ready for interact_with_process)
|
|
894
|
-
Process finished execution
|
|
895
|
-
Timeout reached (may still be running)
|
|
896
|
-
|
|
865
|
+
description: `
|
|
866
|
+
Read output from a running process with file-like pagination support.
|
|
867
|
+
|
|
868
|
+
Supports partial output reading with offset and length parameters (like read_file):
|
|
869
|
+
- 'offset' (start line, default: 0)
|
|
870
|
+
* offset=0: Read NEW output since last read (default, like old behavior)
|
|
871
|
+
* Positive: Read from absolute line position
|
|
872
|
+
* Negative: Read last N lines from end (tail behavior)
|
|
873
|
+
- 'length' (max lines to read, default: configurable via 'fileReadLineLimit' setting)
|
|
874
|
+
|
|
875
|
+
Examples:
|
|
876
|
+
- offset: 0, length: 100 → First 100 NEW lines since last read
|
|
877
|
+
- offset: 0 → All new lines (respects config limit)
|
|
878
|
+
- offset: 500, length: 50 → Lines 500-549 (absolute position)
|
|
879
|
+
- offset: -20 → Last 20 lines (tail)
|
|
880
|
+
- offset: -50, length: 10 → Start 50 from end, read 10 lines
|
|
881
|
+
|
|
882
|
+
OUTPUT PROTECTION:
|
|
883
|
+
- Uses same fileReadLineLimit as read_file (default: 1000 lines)
|
|
884
|
+
- Returns status like: [Reading 100 lines from line 0 (total: 5000 lines, 4900 remaining)]
|
|
885
|
+
- Prevents context overflow from verbose processes
|
|
886
|
+
|
|
887
|
+
SMART FEATURES:
|
|
888
|
+
- For offset=0, waits up to timeout_ms for new output to arrive
|
|
889
|
+
- Detects REPL prompts and process completion
|
|
890
|
+
- Shows process state (waiting for input, finished, etc.)
|
|
891
|
+
|
|
892
|
+
DETECTION STATES:
|
|
893
|
+
Process waiting for input (ready for interact_with_process)
|
|
894
|
+
Process finished execution
|
|
895
|
+
Timeout reached (may still be running)
|
|
896
|
+
|
|
897
897
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
898
898
|
inputSchema: zodToJsonSchema(ReadProcessOutputArgsSchema),
|
|
899
899
|
annotations: {
|
|
@@ -903,62 +903,62 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
903
903
|
},
|
|
904
904
|
{
|
|
905
905
|
name: "interact_with_process",
|
|
906
|
-
description: `
|
|
907
|
-
Send input to a running process and automatically receive the response.
|
|
908
|
-
|
|
909
|
-
CRITICAL: THIS IS THE PRIMARY TOOL FOR ALL LOCAL FILE ANALYSIS
|
|
910
|
-
For ANY local file analysis (CSV, JSON, data processing), ALWAYS use this instead of the analysis tool.
|
|
911
|
-
The analysis tool CANNOT access local files and WILL FAIL - use processes for ALL file-based work.
|
|
912
|
-
|
|
913
|
-
FILE ANALYSIS PRIORITY ORDER (MANDATORY):
|
|
914
|
-
1. ALWAYS FIRST: Use this tool (start_process + interact_with_process) for local data analysis
|
|
915
|
-
2. ALTERNATIVE: Use command-line tools (cut, awk, grep) for quick processing
|
|
916
|
-
3. NEVER EVER: Use analysis tool for local file access (IT WILL FAIL)
|
|
917
|
-
|
|
918
|
-
REQUIRED INTERACTIVE WORKFLOW FOR FILE ANALYSIS:
|
|
919
|
-
1. Start REPL: start_process("python3 -i")
|
|
920
|
-
2. Load libraries: interact_with_process(pid, "import pandas as pd, numpy as np")
|
|
921
|
-
3. Read file: interact_with_process(pid, "df = pd.read_csv('/absolute/path/file.csv')")
|
|
922
|
-
4. Analyze: interact_with_process(pid, "print(df.describe())")
|
|
923
|
-
5. Continue: interact_with_process(pid, "df.groupby('column').size()")
|
|
924
|
-
|
|
925
|
-
BINARY FILE PROCESSING WORKFLOWS:
|
|
926
|
-
Use appropriate Python libraries (PyPDF2, pandas, docx2txt, etc.) or command-line tools for binary file analysis.
|
|
927
|
-
|
|
928
|
-
SMART DETECTION:
|
|
929
|
-
- Automatically waits for REPL prompt (>>>, >, etc.)
|
|
930
|
-
- Detects errors and completion states
|
|
931
|
-
- Early exit prevents timeout delays
|
|
932
|
-
- Clean output formatting (removes prompts)
|
|
933
|
-
|
|
934
|
-
SUPPORTED REPLs:
|
|
935
|
-
- Python: python3 -i (RECOMMENDED for data analysis)
|
|
936
|
-
- Node.js: node -i
|
|
937
|
-
- R: R
|
|
938
|
-
- Julia: julia
|
|
939
|
-
- Shell: bash, zsh
|
|
940
|
-
- Database: mysql, postgres
|
|
941
|
-
|
|
942
|
-
PARAMETERS:
|
|
943
|
-
- pid: Process ID from start_process
|
|
944
|
-
- input: Code/command to execute
|
|
945
|
-
- timeout_ms: Max wait (default: 8000ms)
|
|
946
|
-
- wait_for_prompt: Auto-wait for response (default: true)
|
|
947
|
-
- verbose_timing: Enable detailed performance telemetry (default: false)
|
|
948
|
-
|
|
949
|
-
Returns execution result with status indicators.
|
|
950
|
-
|
|
951
|
-
PERFORMANCE DEBUGGING (verbose_timing parameter):
|
|
952
|
-
Set verbose_timing: true to get detailed timing information including:
|
|
953
|
-
- Exit reason (early_exit_quick_pattern, early_exit_periodic_check, process_finished, timeout, no_wait)
|
|
954
|
-
- Total duration and time to first output
|
|
955
|
-
- Complete timeline of all output events with timestamps
|
|
956
|
-
- Which detection mechanism triggered early exit
|
|
957
|
-
Use this to identify slow interactions and optimize detection patterns.
|
|
958
|
-
|
|
959
|
-
ALWAYS USE FOR: CSV analysis, JSON processing, file statistics, data visualization prep, ANY local file work
|
|
960
|
-
NEVER USE ANALYSIS TOOL FOR: Local file access (it cannot read files from disk and WILL FAIL)
|
|
961
|
-
|
|
906
|
+
description: `
|
|
907
|
+
Send input to a running process and automatically receive the response.
|
|
908
|
+
|
|
909
|
+
CRITICAL: THIS IS THE PRIMARY TOOL FOR ALL LOCAL FILE ANALYSIS
|
|
910
|
+
For ANY local file analysis (CSV, JSON, data processing), ALWAYS use this instead of the analysis tool.
|
|
911
|
+
The analysis tool CANNOT access local files and WILL FAIL - use processes for ALL file-based work.
|
|
912
|
+
|
|
913
|
+
FILE ANALYSIS PRIORITY ORDER (MANDATORY):
|
|
914
|
+
1. ALWAYS FIRST: Use this tool (start_process + interact_with_process) for local data analysis
|
|
915
|
+
2. ALTERNATIVE: Use command-line tools (cut, awk, grep) for quick processing
|
|
916
|
+
3. NEVER EVER: Use analysis tool for local file access (IT WILL FAIL)
|
|
917
|
+
|
|
918
|
+
REQUIRED INTERACTIVE WORKFLOW FOR FILE ANALYSIS:
|
|
919
|
+
1. Start REPL: start_process("python3 -i")
|
|
920
|
+
2. Load libraries: interact_with_process(pid, "import pandas as pd, numpy as np")
|
|
921
|
+
3. Read file: interact_with_process(pid, "df = pd.read_csv('/absolute/path/file.csv')")
|
|
922
|
+
4. Analyze: interact_with_process(pid, "print(df.describe())")
|
|
923
|
+
5. Continue: interact_with_process(pid, "df.groupby('column').size()")
|
|
924
|
+
|
|
925
|
+
BINARY FILE PROCESSING WORKFLOWS:
|
|
926
|
+
Use appropriate Python libraries (PyPDF2, pandas, docx2txt, etc.) or command-line tools for binary file analysis.
|
|
927
|
+
|
|
928
|
+
SMART DETECTION:
|
|
929
|
+
- Automatically waits for REPL prompt (>>>, >, etc.)
|
|
930
|
+
- Detects errors and completion states
|
|
931
|
+
- Early exit prevents timeout delays
|
|
932
|
+
- Clean output formatting (removes prompts)
|
|
933
|
+
|
|
934
|
+
SUPPORTED REPLs:
|
|
935
|
+
- Python: python3 -i (RECOMMENDED for data analysis)
|
|
936
|
+
- Node.js: node -i
|
|
937
|
+
- R: R
|
|
938
|
+
- Julia: julia
|
|
939
|
+
- Shell: bash, zsh
|
|
940
|
+
- Database: mysql, postgres
|
|
941
|
+
|
|
942
|
+
PARAMETERS:
|
|
943
|
+
- pid: Process ID from start_process
|
|
944
|
+
- input: Code/command to execute
|
|
945
|
+
- timeout_ms: Max wait (default: 8000ms)
|
|
946
|
+
- wait_for_prompt: Auto-wait for response (default: true)
|
|
947
|
+
- verbose_timing: Enable detailed performance telemetry (default: false)
|
|
948
|
+
|
|
949
|
+
Returns execution result with status indicators.
|
|
950
|
+
|
|
951
|
+
PERFORMANCE DEBUGGING (verbose_timing parameter):
|
|
952
|
+
Set verbose_timing: true to get detailed timing information including:
|
|
953
|
+
- Exit reason (early_exit_quick_pattern, early_exit_periodic_check, process_finished, timeout, no_wait)
|
|
954
|
+
- Total duration and time to first output
|
|
955
|
+
- Complete timeline of all output events with timestamps
|
|
956
|
+
- Which detection mechanism triggered early exit
|
|
957
|
+
Use this to identify slow interactions and optimize detection patterns.
|
|
958
|
+
|
|
959
|
+
ALWAYS USE FOR: CSV analysis, JSON processing, file statistics, data visualization prep, ANY local file work
|
|
960
|
+
NEVER USE ANALYSIS TOOL FOR: Local file access (it cannot read files from disk and WILL FAIL)
|
|
961
|
+
|
|
962
962
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
963
963
|
inputSchema: zodToJsonSchema(InteractWithProcessArgsSchema),
|
|
964
964
|
annotations: {
|
|
@@ -970,9 +970,9 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
970
970
|
},
|
|
971
971
|
{
|
|
972
972
|
name: "force_terminate",
|
|
973
|
-
description: `
|
|
974
|
-
Force terminate a running terminal session.
|
|
975
|
-
|
|
973
|
+
description: `
|
|
974
|
+
Force terminate a running terminal session.
|
|
975
|
+
|
|
976
976
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
977
977
|
inputSchema: zodToJsonSchema(ForceTerminateArgsSchema),
|
|
978
978
|
annotations: {
|
|
@@ -984,19 +984,19 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
984
984
|
},
|
|
985
985
|
{
|
|
986
986
|
name: "list_sessions",
|
|
987
|
-
description: `
|
|
988
|
-
List all active terminal sessions.
|
|
989
|
-
|
|
990
|
-
Shows session status including:
|
|
991
|
-
- PID: Process identifier
|
|
992
|
-
- Blocked: Whether session is waiting for input
|
|
993
|
-
- Runtime: How long the session has been running
|
|
994
|
-
|
|
995
|
-
DEBUGGING REPLs:
|
|
996
|
-
- "Blocked: true" often means REPL is waiting for input
|
|
997
|
-
- Use this to verify sessions are running before sending input
|
|
998
|
-
- Long runtime with blocked status may indicate stuck process
|
|
999
|
-
|
|
987
|
+
description: `
|
|
988
|
+
List all active terminal sessions.
|
|
989
|
+
|
|
990
|
+
Shows session status including:
|
|
991
|
+
- PID: Process identifier
|
|
992
|
+
- Blocked: Whether session is waiting for input
|
|
993
|
+
- Runtime: How long the session has been running
|
|
994
|
+
|
|
995
|
+
DEBUGGING REPLs:
|
|
996
|
+
- "Blocked: true" often means REPL is waiting for input
|
|
997
|
+
- Use this to verify sessions are running before sending input
|
|
998
|
+
- Long runtime with blocked status may indicate stuck process
|
|
999
|
+
|
|
1000
1000
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
1001
1001
|
inputSchema: zodToJsonSchema(ListSessionsArgsSchema),
|
|
1002
1002
|
annotations: {
|
|
@@ -1006,11 +1006,11 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
1006
1006
|
},
|
|
1007
1007
|
{
|
|
1008
1008
|
name: "list_processes",
|
|
1009
|
-
description: `
|
|
1010
|
-
List all running processes.
|
|
1011
|
-
|
|
1012
|
-
Returns process information including PID, command name, CPU usage, and memory usage.
|
|
1013
|
-
|
|
1009
|
+
description: `
|
|
1010
|
+
List all running processes.
|
|
1011
|
+
|
|
1012
|
+
Returns process information including PID, command name, CPU usage, and memory usage.
|
|
1013
|
+
|
|
1014
1014
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
1015
1015
|
inputSchema: zodToJsonSchema(ListProcessesArgsSchema),
|
|
1016
1016
|
annotations: {
|
|
@@ -1020,11 +1020,11 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
1020
1020
|
},
|
|
1021
1021
|
{
|
|
1022
1022
|
name: "kill_process",
|
|
1023
|
-
description: `
|
|
1024
|
-
Terminate a running process by PID.
|
|
1025
|
-
|
|
1026
|
-
Use with caution as this will forcefully terminate the specified process.
|
|
1027
|
-
|
|
1023
|
+
description: `
|
|
1024
|
+
Terminate a running process by PID.
|
|
1025
|
+
|
|
1026
|
+
Use with caution as this will forcefully terminate the specified process.
|
|
1027
|
+
|
|
1028
1028
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
1029
1029
|
inputSchema: zodToJsonSchema(KillProcessArgsSchema),
|
|
1030
1030
|
annotations: {
|
|
@@ -1036,11 +1036,11 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
1036
1036
|
},
|
|
1037
1037
|
{
|
|
1038
1038
|
name: "get_usage_stats",
|
|
1039
|
-
description: `
|
|
1040
|
-
Get usage statistics for debugging and analysis.
|
|
1041
|
-
|
|
1042
|
-
Returns summary of tool usage, success/failure rates, and performance metrics.
|
|
1043
|
-
|
|
1039
|
+
description: `
|
|
1040
|
+
Get usage statistics for debugging and analysis.
|
|
1041
|
+
|
|
1042
|
+
Returns summary of tool usage, success/failure rates, and performance metrics.
|
|
1043
|
+
|
|
1044
1044
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
1045
1045
|
inputSchema: zodToJsonSchema(GetUsageStatsArgsSchema),
|
|
1046
1046
|
annotations: {
|
|
@@ -1050,18 +1050,18 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
1050
1050
|
},
|
|
1051
1051
|
{
|
|
1052
1052
|
name: "get_recent_tool_calls",
|
|
1053
|
-
description: `
|
|
1054
|
-
Get recent tool call history with their arguments and outputs.
|
|
1055
|
-
Returns chronological list of tool calls made during this session.
|
|
1056
|
-
|
|
1057
|
-
Useful for:
|
|
1058
|
-
- Onboarding new chats about work already done
|
|
1059
|
-
- Recovering context after chat history loss
|
|
1060
|
-
- Debugging tool call sequences
|
|
1061
|
-
|
|
1062
|
-
Note: Does not track its own calls or other meta/query tools.
|
|
1063
|
-
History kept in memory (last 1000 calls, lost on restart).
|
|
1064
|
-
|
|
1053
|
+
description: `
|
|
1054
|
+
Get recent tool call history with their arguments and outputs.
|
|
1055
|
+
Returns chronological list of tool calls made during this session.
|
|
1056
|
+
|
|
1057
|
+
Useful for:
|
|
1058
|
+
- Onboarding new chats about work already done
|
|
1059
|
+
- Recovering context after chat history loss
|
|
1060
|
+
- Debugging tool call sequences
|
|
1061
|
+
|
|
1062
|
+
Note: Does not track its own calls or other meta/query tools.
|
|
1063
|
+
History kept in memory (last 1000 calls, lost on restart).
|
|
1064
|
+
|
|
1065
1065
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
1066
1066
|
inputSchema: zodToJsonSchema(GetRecentToolCallsArgsSchema),
|
|
1067
1067
|
annotations: {
|
|
@@ -1071,38 +1071,38 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
1071
1071
|
},
|
|
1072
1072
|
{
|
|
1073
1073
|
name: "give_feedback_to_desktop_commander",
|
|
1074
|
-
description: `
|
|
1075
|
-
Open feedback form in browser to provide feedback about MCP Device.
|
|
1076
|
-
|
|
1077
|
-
IMPORTANT: This tool simply opens the feedback form - no pre-filling available.
|
|
1078
|
-
The user will fill out the form manually in their browser.
|
|
1079
|
-
|
|
1080
|
-
WORKFLOW:
|
|
1081
|
-
1. When user agrees to give feedback, just call this tool immediately
|
|
1082
|
-
2. No need to ask questions or collect information
|
|
1083
|
-
3. Tool opens form with only usage statistics pre-filled automatically:
|
|
1084
|
-
- tool_call_count: Number of commands they've made
|
|
1085
|
-
- days_using: How many days they've used MCP Device
|
|
1086
|
-
- platform: Their operating system (Mac/Windows/Linux)
|
|
1087
|
-
- client_id: Analytics identifier
|
|
1088
|
-
|
|
1089
|
-
All survey questions will be answered directly in the form:
|
|
1090
|
-
- Job title and technical comfort level
|
|
1091
|
-
- Company URL for industry context
|
|
1092
|
-
- Other AI tools they use
|
|
1093
|
-
- MCP Device's biggest advantage
|
|
1094
|
-
- How they typically use it
|
|
1095
|
-
- Recommendation likelihood (0-10)
|
|
1096
|
-
- User study participation interest
|
|
1097
|
-
- Email and any additional feedback
|
|
1098
|
-
|
|
1099
|
-
EXAMPLE INTERACTION:
|
|
1100
|
-
User: "sure, I'll give feedback"
|
|
1101
|
-
Claude: "Perfect! Let me open the feedback form for you."
|
|
1102
|
-
[calls tool immediately]
|
|
1103
|
-
|
|
1104
|
-
No parameters are needed - just call the tool to open the form.
|
|
1105
|
-
|
|
1074
|
+
description: `
|
|
1075
|
+
Open feedback form in browser to provide feedback about MCP Device.
|
|
1076
|
+
|
|
1077
|
+
IMPORTANT: This tool simply opens the feedback form - no pre-filling available.
|
|
1078
|
+
The user will fill out the form manually in their browser.
|
|
1079
|
+
|
|
1080
|
+
WORKFLOW:
|
|
1081
|
+
1. When user agrees to give feedback, just call this tool immediately
|
|
1082
|
+
2. No need to ask questions or collect information
|
|
1083
|
+
3. Tool opens form with only usage statistics pre-filled automatically:
|
|
1084
|
+
- tool_call_count: Number of commands they've made
|
|
1085
|
+
- days_using: How many days they've used MCP Device
|
|
1086
|
+
- platform: Their operating system (Mac/Windows/Linux)
|
|
1087
|
+
- client_id: Analytics identifier
|
|
1088
|
+
|
|
1089
|
+
All survey questions will be answered directly in the form:
|
|
1090
|
+
- Job title and technical comfort level
|
|
1091
|
+
- Company URL for industry context
|
|
1092
|
+
- Other AI tools they use
|
|
1093
|
+
- MCP Device's biggest advantage
|
|
1094
|
+
- How they typically use it
|
|
1095
|
+
- Recommendation likelihood (0-10)
|
|
1096
|
+
- User study participation interest
|
|
1097
|
+
- Email and any additional feedback
|
|
1098
|
+
|
|
1099
|
+
EXAMPLE INTERACTION:
|
|
1100
|
+
User: "sure, I'll give feedback"
|
|
1101
|
+
Claude: "Perfect! Let me open the feedback form for you."
|
|
1102
|
+
[calls tool immediately]
|
|
1103
|
+
|
|
1104
|
+
No parameters are needed - just call the tool to open the form.
|
|
1105
|
+
|
|
1106
1106
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
1107
1107
|
inputSchema: zodToJsonSchema(GiveFeedbackArgsSchema),
|
|
1108
1108
|
annotations: {
|
|
@@ -1113,28 +1113,28 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
1113
1113
|
},
|
|
1114
1114
|
{
|
|
1115
1115
|
name: "get_prompts",
|
|
1116
|
-
description: `
|
|
1117
|
-
Retrieve a specific MCP Device onboarding prompt by ID and execute it.
|
|
1118
|
-
|
|
1119
|
-
SIMPLIFIED ONBOARDING V2: This tool only supports direct prompt retrieval.
|
|
1120
|
-
The onboarding system presents 5 options as a simple numbered list:
|
|
1121
|
-
|
|
1122
|
-
1. Organize my Downloads folder (promptId: 'onb2_01')
|
|
1123
|
-
2. Explain a codebase or repository (promptId: 'onb2_02')
|
|
1124
|
-
3. Create organized knowledge base (promptId: 'onb2_03')
|
|
1125
|
-
4. Analyze a data file (promptId: 'onb2_04')
|
|
1126
|
-
5. Check system health and resources (promptId: 'onb2_05')
|
|
1127
|
-
|
|
1128
|
-
USAGE:
|
|
1129
|
-
When user says "1", "2", "3", "4", or "5" from onboarding:
|
|
1130
|
-
- "1" → get_prompts(action='get_prompt', promptId='onb2_01')
|
|
1131
|
-
- "2" → get_prompts(action='get_prompt', promptId='onb2_02')
|
|
1132
|
-
- "3" → get_prompts(action='get_prompt', promptId='onb2_03')
|
|
1133
|
-
- "4" → get_prompts(action='get_prompt', promptId='onb2_04')
|
|
1134
|
-
- "5" → get_prompts(action='get_prompt', promptId='onb2_05')
|
|
1135
|
-
|
|
1136
|
-
The prompt content will be injected and execution begins immediately.
|
|
1137
|
-
|
|
1116
|
+
description: `
|
|
1117
|
+
Retrieve a specific MCP Device onboarding prompt by ID and execute it.
|
|
1118
|
+
|
|
1119
|
+
SIMPLIFIED ONBOARDING V2: This tool only supports direct prompt retrieval.
|
|
1120
|
+
The onboarding system presents 5 options as a simple numbered list:
|
|
1121
|
+
|
|
1122
|
+
1. Organize my Downloads folder (promptId: 'onb2_01')
|
|
1123
|
+
2. Explain a codebase or repository (promptId: 'onb2_02')
|
|
1124
|
+
3. Create organized knowledge base (promptId: 'onb2_03')
|
|
1125
|
+
4. Analyze a data file (promptId: 'onb2_04')
|
|
1126
|
+
5. Check system health and resources (promptId: 'onb2_05')
|
|
1127
|
+
|
|
1128
|
+
USAGE:
|
|
1129
|
+
When user says "1", "2", "3", "4", or "5" from onboarding:
|
|
1130
|
+
- "1" → get_prompts(action='get_prompt', promptId='onb2_01')
|
|
1131
|
+
- "2" → get_prompts(action='get_prompt', promptId='onb2_02')
|
|
1132
|
+
- "3" → get_prompts(action='get_prompt', promptId='onb2_03')
|
|
1133
|
+
- "4" → get_prompts(action='get_prompt', promptId='onb2_04')
|
|
1134
|
+
- "5" → get_prompts(action='get_prompt', promptId='onb2_05')
|
|
1135
|
+
|
|
1136
|
+
The prompt content will be injected and execution begins immediately.
|
|
1137
|
+
|
|
1138
1138
|
${CMD_PREFIX_DESCRIPTION}`,
|
|
1139
1139
|
inputSchema: zodToJsonSchema(GetPromptsArgsSchema),
|
|
1140
1140
|
annotations: {
|