connector
by OpticLM·★ 3·综合分 36
为 LLM 提供通过 MCP 和 AI SDK 实现连接代码分析工具的抽象接口
概述
@opticlm/connector 提供抽象接口,让 LLM 能够连接到各种事实源,包括 LSP、代码诊断、符号定义/引用、链接和 frontmatter。它同时提供 MCP 和 Vercel AI SDK 实现,全面覆盖代码分析、导航、编辑、诊断和文档链接等功能。该库采用基于提供程序的模块化架构,使 IDE 只需实现其支持的功能。
试试问 AI
装完之后,这里有 5 个你可以让 AI 做的事:
什么时候选它
当您需要将 LLM 功能与支持 LSP 的 IDE 环境集成,特别是用于代码导航、诊断和编辑功能时,选择此连接器。
什么时候不要选它
如果您需要用于非代码相关任务的通用 MCP 服务器,或者寻找超出 LSP 提供的语言支持的解决方案,请避免使用此工具。
此 server 暴露的工具
从 README 抽取出 12 个工具goto_definitionNavigate to the definition of a symbol.
find_referencesFind all references to a symbol.
find_file_referencesFind all references to a file across the workspace.
call_hierarchyGet call hierarchy for a function or method.
apply_editApply a text edit to a file using hashline references.
global_findSearch for text across the entire workspace.
get_link_structureGet all links in the workspace, showing relationships between documents.
add_linkAdd a link to a document by finding a text pattern and replacing it with a link.
get_frontmatter_structureGet frontmatter property values across documents.
set_frontmatterSet a frontmatter property on a document.
get_diagnosticsGet diagnostics (errors, warnings) for a specific file.
get_outlineGet document symbols (outline) for a file.
可对比工具
安装
npm install @opticlm/connector对于 Claude Desktop,添加到 claude_desktop_config.json:
{
"mcpServers": {
"opticlm-connector": {
"command": "npx",
"args": ["@opticlm/connector"]
}
}
}FAQ
- 连接器支持哪些文件格式?
- 连接器主要处理源代码文件,支持以 hashline 格式读取文件以实现安全的编辑操作。
- 它如何处理 LSP 集成?
- 它通过提供程序(providers)抽象 LSP 功能,包括定义、引用、诊断、大纲等,可无缝集成任何与 LSP 兼容的语言服务器。
connector 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。