LSP-MCP:为AI提供代码上下文的MCP服务器
一个为大语言模型提供代码库语言感知上下文的模型上下文协议(MCP)服务器。
快速入门
使用 Docker(推荐)
- 修改配置文件
claude_desktop_config.json
,添加以下内容: { "mcpServers": { "lsp": { "command": "docker", "args": ["run", "-i", "--rm", "docker.io/jonrad/lsp-mcp:0.3.1"] } } } - 可通过
-v /本地路径:/远程路径
共享文件。
使用 npx
- 配置如下: { "mcpServers": { "lsp": { "command": "npx", "args": ["-y", "--silent", "git+https://github.com/jonrad/lsp-mcp", "--lsp", "npx -y --silent -p 'typescript@5.7.3' -p 'typescript-language-server@4.3.3' typescript-language-server --stdio"] } } }
- 重启相关工具以应用更改。
更多支持请参考 README。