Token导航 LogoToken导航TokenDH.com
Text Editor logo
运维云端stdio官方级别未说明来源级核验

Text Editor

MCP Server

mcp-server-text-editor

一个开源的Claude内置文本编辑器工具的Model Context Protocol (MCP)服务器实现,提供查看、编辑和创建文本文件的标准API。

工具数

1

提示词数

0

GitHub Stars

36

资源数

0
文件操作TypeScriptClaudeAI工具集成Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

bhouston

提供方

bhouston

最后核验

2026/5/17 20:21

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx -y mcp-server-text-editor

详细介绍

Claude文本编辑器MCP服务器

](https://www.npmjs.com/package/mcp-server-text-editor) ![CI Status](https://github.com/bhouston/mcp-server-text-editor/actions/workflows/tests.yml) ![Test Coverage](https://github.com/bhouston/mcp-server-text-editor)

Claude内置文本编辑器工具的开源实现 模型上下文协议 (MCP)服务器。此软件包提供的功能与 Claude的内置文本编辑器工具,允许您通过标准化的API查看、编辑和创建文本文件。

特性

  • 与Claude的文本编辑器相同的API:实现与Claude的内置文本编辑器工具完全相同的接口
  • MCP服务器实现:遵循AI工具集成的模型上下文协议标准
  • 文件操作:

- 查看具有可选行范围规范的文件内容 - 创建新文件 - 替换现有文件中的文本 - 在特定行号处插入文本 - 撤消以前的编辑

支持的Claude文本编辑器版本

此包实现了一个等效的工具 内置的Claude文本编辑器工具 版本:

  • text_editor_20241022 (克劳德3.5十四行诗)
  • text_editor_20250124 (克劳德3.7十四行诗)

但是使用工具名“text_editor”来避免与内置的Claude工具发生名称冲突。

安装

# Install from npm
npm install mcp-server-text-editor

# Or with pnpm
pnpm add mcp-server-text-editor

用法

启动服务器

# Using npx
npx -y mcp-server-text-editor

# Or if installed globally
mcp-server-text-editor

在Claude Desktop中配置

{
  "mcpServers": {
    "textEditor": {
      "command": "npx",
      "args": ["-y", "mcp-server-text-editor"]
    }
  }
}

工具命令

视图

查看文件或目录的内容。

{
  "command": "view",
  "path": "/path/to/file.js",
  "view_range": [1, 10] // Optional: Show lines 1-10 only
}

创建

使用指定内容创建新文件。

{
  "command": "create",
  "path": "/path/to/file.js",
  "file_text": "console.log('Hello, world!');"
}

字符串替换

替换文件中的文本。

{
  "command": "str_replace",
  "path": "/path/to/file.js",
  "old_str": "console.log('Hello, world!');",
  "new_str": "console.log('Hello, Claude!');"
}

插入

在特定行插入文本。

{
  "command": "insert",
  "path": "/path/to/file.js",
  "insert_line": 5,
  "new_str": "// This line was inserted by Claude"
}

撤消编辑

还原上次对文件所做的编辑。

{
  "command": "undo_edit",
  "path": "/path/to/file.js"
}

发展

先决条件

  • Node.js 18+
  • pnpm

设置

# Clone the repository
git clone https://github.com/bhouston/mcp-server-text-editor.git
cd mcp-server-text-editor

# Install dependencies
pnpm install

# Build the project
pnpm build

脚本

  • pnpm build:构建TypeScript项目
  • pnpm lint:运行ESLint并自动修复
  • pnpm format:使用Prettier格式化代码
  • pnpm clean:删除构建工件
  • pnpm clean:all:删除构建工件和node_modules
  • pnpm test:运行测试
  • pnpm test:coverage:使用覆盖率报告运行测试

测试

该项目使用Vitest进行测试。

要运行测试,请执行以下操作:

# Run all tests
pnpm test

# Run tests with coverage report
pnpm test:coverage

测试覆盖率报告将在 coverage 目录。

许可证

麻省理工学院

贡献

欢迎投稿!请随时提交拉取请求。

  1. 分叉存储库
  2. 创建功能分支(git checkout -b feature/amazing-feature)
  3. 提交您的更改(git commit -m 'Add some amazing feature')
  4. 推到分支(git push origin feature/amazing-feature)
  5. 打开拉取请求

目录标签

目录标签

文件操作TypeScriptClaudeAI工具集成文本编辑本地部署MCP服务器

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

部署方式(deploymentType,部署类型)

local-only

来源包(packageName,安装包名)

mcp-server-text-editor

工具数量(toolCount,工具数)

1

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiononelocal-only

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP