LSP工具MCP服务器
一种模型上下文协议(MCP)服务器,为文本分析提供类似语言服务器协议的功能。
特性
- 查找正则表达式位置:查找文件中正则表达式模式匹配的0索引行和列位置
- 列出允许的目录:获取允许服务器访问的目录列表
安装
npm install
npm run build用法
# Start the server allowing access to a specific directory
node dist/index.js /path/to/allowed/directory
# Start the server with multiple allowed directories
node dist/index.js /path/to/dir1 /path/to/dir2 /path/to/dir3发展
运行测试
该项目使用Jest进行测试。使用以下命令运行测试:
npm test在开发过程中以监视模式运行测试:
npm run test:watch代码检查
用ESLint抓取代码:
npm run lint工具文档
查找位置
此工具在文件中查找正则表达式模式匹配的0索引行和列位置。
参数:
path:要搜索的文件的路径regex:要搜索的正则表达式模式
退货:
- 具有以下属性的匹配数组:
- match:匹配的文本 - line:起始线(0索引) - column:起始列(0索引) - endLine:结束行(0索引) - endColumn:结束列(0索引,不包括)
list_allowed_directories
此工具列出了允许此服务器访问的所有目录。
参数:
- 无
退货:
- 允许目录的绝对路径数组
许可证
麻省理工学院

