GonTwVn
服务介绍
MCP Server Toolkit
This is a server toolkit based on the Model Context Protocol, providing a variety of functions to assist in development and maintenance work.
Feature Overview
Basic Tools
- add - A simple addition calculation tool
- npmBuild - Executes the
npm buildcommand to build the project - npmInstall - Executes the
npm installcommand to install dependencies
File Operation Tools
- codeFileRead - Reads code files and displays line numbers
- codeLineInsert - Inserts content at a specified line in a code file
- codeLineDelete - Deletes lines within a specified range in a code file
- fileWrite - Provides file writing functionality, including creation, editing, and writing
- fileRead - Reads file contents, supporting plain text and JSON formats
- edit_file - Performs precise edits on a file, allowing for the replacement of specific text
- insert_to_file - Inserts new content at a specific position in a file
- delete_from_file - Deletes specific content from a file
Search Tools
- find_files - Searches for files matching a filename pattern in allowed directories
- search_code - Searches for code containing specific text in allowed directories
Localization Tools
- localizationGetByKey - Queries a specific translation item by key
- localizationSearch - Searches for translation items containing specific text
- localizationAdd - Adds a complete translation item
- localizationUpdate - Updates the content of an existing translation item
- localizationDelete - Deletes a translation item by key
- localizationExportJson - Exports translations for a specific language as a JSON file
- localizationFindMissing - Finds items with keys but missing translations in a specific language
- localizationFindLongValues - Finds translation items exceeding a specific character count
Task Manager Tools
- taskCreate - Creates a new task, which can include multiple steps
- taskGetAll - Retrieves a list of all tasks
- taskGetById - Retrieves a specific task by ID
- taskUpdate - Updates information for an existing task
- taskDelete - Deletes a task by ID
- taskStepUpdate - Updates a specific step in a task
- taskStepAdd - Adds a new step to a task
- taskStepDelete - Deletes a specific step in a task
- taskSearch - Searches for tasks based on conditions
- taskAnalyze - Retrieves a task status analysis report
- taskSetAllSteps - Sets the completion status for all steps in a task
- taskGenerateReport - Generates a Markdown report on task progress
- taskGuidanceRead - Reads AI task guidance documents
- taskGuidanceWrite - Writes AI task guidance documents
- taskStart - Starts a task
- taskComplete - Completes a task
Detailed Explanation of File Operation Tools
fileWrite
Provides file writing functionality, allowing for the creation or modification of files.
javascript
fileWrite({
filePath: "path/to/file.txt",
content: "This is the content",
mode: "write", // Options: write, append, json
createDirs: true, // Optional, whether to automatically create directories
prettify: true // Optional, only effective in json mode, whether to pretty-print JSON output
})
fileRead
Reads file contents, supporting plain text and JSON formats.
javascript
fileRead({
filePath: "path/to/file.txt",
mode: "text", // Options: text, json
encoding: "utf8" // Optional, specifies the encoding
})
edit_file
Performs precise edits on a file, allowing for the replacement of specific text.
javascript
edit_file({
path: "path/to/file.txt",
edits: [
{
oldText: "Text to be replaced",
newText: "Replacement text"
}
],
dryRun: false // Optional, preview changes without actually modifying the file
})
insert_to_file
Inserts new content at a specific position in a file.
javascript
insert_to_file({
path: "path/to/file.txt",
position: 10, // Line number (starting from 1), or a marker text
content: "Content to be inserted",
dryRun: false // Optional, preview changes without actually modifying the file
})### delete_from_file
Delete specific content from a file.
javascript
delete_from_file({
path: "path/to/file.txt",
selector: "Text to be deleted", // or {startLine: 5, endLine: 10} or {start: "Start marker", end: "End marker"}
dryRun: false // Optional, preview changes without actually modifying the file
})
Usage Examples
Creating and Editing Files
javascript
// Create a new TypeScript file
fileWrite({
filePath: "src/utils/helper.ts",
content: export function add(a: number, b: number): number { return a + b; },
mode: "write"
});
// Read the content of a file
fileRead({
filePath: "src/utils/helper.ts",
mode: "text"
});
// Edit specific text within a file
edit_file({
path: "src/utils/helper.ts",
edits: [
{
oldText: "export function add",
newText: "export function sum"
}
]
});
// Insert new content into a file
insert_to_file({
path: "src/utils/helper.ts",
position: 1, // Insert at the first line
content: "// Math utility functions
"
});
// Delete specific content from a file
delete_from_file({
path: "src/utils/helper.ts",
selector: "// Math utility functions
"
});
Using JSON Schema
javascript
// Create a JSON configuration file
fileWrite({
filePath: "config.json",
content: {"version": "1.0.0", "debug": false} ,
mode: "json",
prettify: true
});
// Read a JSON file
fileRead({
filePath: "config.json",
mode: "json"
});
Notes
-
The
codeFileRead,codeLineInsert, andcodeLineDeletetools are primarily used for code editing, while the new file tools (fileWrite,fileRead, etc.) are more general-purpose and can be used with any type of text file. -
When using the
edit_file,insert_to_file, anddelete_from_filetools, it is recommended to enable thedryRunmode first to preview the changes and ensure that no unintended modifications occur. -
File paths can be either relative or absolute.
-
For batch operations, it is suggested to use the
edit_filetool, which allows multiple edit operations in a single call.
