Back to MCP directory
publicPublicdnsLocal runtime

lsp-tools-mcp

一个提供类似语言服务器协议功能的文本分析工具

article

README

🚀 LSP 工具 MCP 服务器

LSP 工具 MCP 服务器提供了类似于语言服务器协议(LSP)的功能,专注于文本分析,借助模型上下文协议(MCP)为文本处理提供支持。

🚀 快速开始

LSP 工具 MCP 服务器为文本分析提供了强大的支持,通过以下步骤,你可以快速启动并使用该服务器。

✨ 主要特性

  • 正则表达式位置查找:精准定位文件中正则表达式匹配模式的 0 索引行和列位置。
  • 列出允许目录:方便获取服务器被允许访问的目录列表。

📦 安装指南

在项目根目录下,依次执行以下命令进行安装和构建:

npm install
npm run build

💻 使用示例

基础用法

启动服务器并指定允许访问的特定目录:

node dist/index.js /path/to/allowed/directory

高级用法

启动服务器并指定多个允许访问的目录:

node dist/index.js /path/to/dir1 /path/to/dir2 /path/to/dir3

📚 详细文档

find_regex_position

此工具用于查找文件中正则表达式匹配模式的 0 索引行和列位置。

  • 参数
    • path:要搜索的文件路径。
    • regex:要搜索的正则表达式模式。
  • 返回:包含以下属性的匹配数组:
    • match:匹配到的文本。
    • line:起始行号(0 索引)。
    • column:起始列号(0 索引)。
    • endLine:结束行号(0 索引)。
    • endColumn:结束列号(0 索引,排除)。

list_allowed_directories

此工具列出服务器被允许访问的所有目录。

  • 参数:无。
  • 返回:绝对路径的允许目录数组。

🔧 技术细节

运行测试

该项目使用 Jest 进行测试。运行测试命令如下:

npm test

在开发期间,使用以下命令以观察模式运行测试:

npm run test:watch

代码检查

使用 ESLint 检查代码格式:

npm run lint
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client