Content
# MCP Server Toolkit
This is a server toolkit based on the Model Context Protocol, providing various functions to assist in development and maintenance work.
## Feature Overview
### Basic Tools
- **add** - A simple addition calculation tool
- **npmBuild** - Executes the npm build command to build the project
- **npmInstall** - Executes the npm install command to install dependencies
### File Operation Tools
- **codeFileRead** - Reads code files and displays line numbers
- **codeLineInsert** - Inserts content at a specified line in the code file
- **codeLineDelete** - Deletes specified range of lines in the code file
- **fileWrite** - File writing functionality, providing create, edit, and write capabilities
- **fileRead** - Reads file content, supporting plain text and JSON formats
- **edit_file** - Performs precise edits on files, allowing replacement of specific text content
- **insert_to_file** - Inserts new content at a specific location in the file
- **delete_from_file** - Deletes specific content from the file
### Search Tools
- **find_files** - Searches for files matching the filename pattern in allowed directories
- **search_code** - Searches for code containing specific text in allowed directories
### Localization Tools
- **localizationGetByKey** - Queries specific translation items based on the key
- **localizationSearch** - Searches for translation items containing specific text
- **localizationAdd** - Adds a complete translation item
- **localizationUpdate** - Updates the content of existing translation items
- **localizationDelete** - Deletes translation items for the specified key
- **localizationExportJson** - Exports translations for a specific language in JSON format
- **localizationFindMissing** - Finds items with key values but missing translations in specific languages
- **localizationFindLongValues** - Finds translation items exceeding a specific word 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 with the specified ID
- **taskStepUpdate** - Updates a specific step of a task
- **taskStepAdd** - Adds a new step to a task
- **taskStepDelete** - Deletes a specific step of a task
- **taskSearch** - Searches for tasks based on conditions
- **taskAnalyze** - Retrieves a task status analysis report
- **taskSetAllSteps** - Sets the completion status for all steps of a specific task
- **taskGenerateReport** - Generates a Markdown report of task progress
## Detailed Description of File Operation Tools
### fileWrite
Provides file writing functionality, allowing the creation of new files or modification of existing files.
```javascript
fileWrite({
filePath: "path/to/file.txt",
content: "This is the content",
mode: "write", // Optional values: write, append, json
createDirs: true, // Optional, whether to automatically create directories
prettify: true // Optional, only effective in json mode, whether to beautify JSON output
})
```
### fileRead
Reads file content, supporting plain text and JSON formats.
```javascript
fileRead({
filePath: "path/to/file.txt",
mode: "text", // Optional values: text, json
encoding: "utf8" // Optional, specifies the encoding method
})
```
### edit_file
Performs precise edits on files, allowing replacement of specific text content.
```javascript
edit_file({
path: "path/to/file.txt",
edits: [
{
oldText: "Text to be replaced",
newText: "Replaced text"
}
],
dryRun: false // Optional, preview changes without actually modifying the file
})
```
### insert_to_file
Inserts new content at a specific location in the file.
```javascript
insert_to_file({
path: "path/to/file.txt",
position: 10, // Line number (starting from 1), or marker text
content: "Content to insert",
dryRun: false // Optional, preview changes without actually modifying the file
})
```
### delete_from_file
Deletes specific content from the file.
```javascript
delete_from_file({
path: "path/to/file.txt",
selector: "Text to delete", // 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 file content
fileRead({
filePath: "src/utils/helper.ts",
mode: "text"
});
// Edit specific text in the file
edit_file({
path: "src/utils/helper.ts",
edits: [
{
oldText: "export function add",
newText: "export function sum"
}
]
});
// Insert new content in the file
insert_to_file({
path: "src/utils/helper.ts",
position: 1, // Insert at the first line
content: "// Math utility functions\n"
});
// Delete specific content from the file
delete_from_file({
path: "src/utils/helper.ts",
selector: "// Math utility functions\n"
});
```
### Using JSON Mode
```javascript
// Create a JSON configuration file
fileWrite({
filePath: "config.json",
content: '{"version": "1.0.0", "debug": false}',
mode: "json",
prettify: true
});
// Read JSON file
fileRead({
filePath: "config.json",
mode: "json"
});
```
## Notes
1. The `codeFileRead`, `codeLineInsert`, and `codeLineDelete` tools are primarily used for code editing, while the new file tools (`fileWrite`, `fileRead`, etc.) are more general and can be used for any type of text file.
2. When using the `edit_file`, `insert_to_file`, and `delete_from_file` tools, it is recommended to enable `dryRun` mode to preview changes and ensure that operations do not cause unintended modifications.
3. File paths can be relative or absolute.
4. For batch operations, it is recommended to use the `edit_file` tool, which allows multiple edit operations in a single call.
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
servers
Model Context Protocol Servers
Time
A Model Context Protocol server for time and timezone conversions.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
Sequential Thinking
A structured MCP server for dynamic problem-solving and reflective thinking.
git
A Model Context Protocol server for Git automation and interaction.