Enhance Claude Code with LSP integration for better code completion, error detection, and refactoring. Works outside IDEs, benefiting developers and operations teams. Integrates with MCP servers for improved workflows.
git clone https://github.com/ktnyt/cclsp.githttps://github.com/ktnyt/cclsp
[{"step":"Install the LSP integration for your project. For Node.js projects, run: `npm install @modelcontextprotocol/server-node --save-dev` and configure your `.clauderc` file with the LSP server path.","tip":"Ensure your project has a `package.json` or equivalent manifest file for proper dependency resolution. Use `claudecode --lsp-debug` to verify the server is running."},{"step":"Open a file in your project and start typing. The LSP will provide real-time completions in the format [COMPLETION] + [REASON]. Press Tab to accept suggestions.","tip":"Enable 'show context' in your editor settings to see why suggestions are being made. This helps validate the AI's recommendations against your actual codebase."},{"step":"Trigger error detection by saving the file or using the 'Check Code' command in your editor. Review errors in the 'Problems' panel and apply fixes directly.","tip":"Customize error detection by adding a `.claudelsp.json` configuration file with rules like 'max-line-length: 120' or 'no-unused-vars: error'."},{"step":"Use the refactoring suggestions from the 'Refactor' panel. Each suggestion includes benefits and can be applied with one click or via CLI.","tip":"For complex refactors, use MCP servers like `@modelcontextprotocol/server-python` to generate supporting code automatically. Run `mcp-python --help` to see available tools."},{"step":"Integrate with MCP servers for workflow automation. Use the 'MCP Suggestions' panel to discover tools that can extend your LSP capabilities.","tip":"Common MCP integrations include documentation generators, test runners, and deployment tools. Add them via `mcp add <server-name>` in your project root."}]
Quickly navigate to function definitions in large codebases using AI assistance.
Automatically find all references to a variable or function across multiple files.
Rename variables or functions safely across an entire project with minimal risk.
Integrate LSP capabilities into non-IDE environments for enhanced coding workflows.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/ktnyt/cclspCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Act as a Claude Code Language Server Protocol (LSP) assistant. Use the [FILE_PATH] and [TASK_DESCRIPTION] to provide: 1) Code completion suggestions with context-aware recommendations, 2) Real-time error detection and fixes for [ERROR_TYPE], 3) Refactoring opportunities for [CODE_BLOCK]. Ensure suggestions align with [PROJECT_STYLE_GUIDE]. Use MCP server integrations if relevant to suggest tools or workflows. Respond with structured JSON including 'completions', 'errors', 'refactors', and 'mcp_suggestions' keys.
```json
{
"completions": [
{
"line": 42,
"suggestion": "const config = new Config({\n timeout: 5000,\n retries: 3,\n logger: console\n});",
"reason": "Standardized timeout configuration matching project style guide"
}
],
"errors": [
{
"line": 15,
"error": "TypeError: Cannot read property 'map' of undefined",
"fix": "Add null check: data?.map(item => process(item))",
"severity": "high"
}
],
"refactors": [
{
"block": "services/api.js (lines 23-35)",
"suggestion": "Extract API client into separate module with dependency injection",
"benefits": ["Improved testability", "Reduced coupling"],
"mcp_suggestions": ["Use @modelcontextprotocol/server-node for module isolation"]
}
],
"mcp_suggestions": [
{
"tool": "@modelcontextprotocol/server-python",
"use_case": "Generate Python SDK wrappers for internal APIs",
"command": "mcp-python --generate-sdk --input openapi.json --output src/sdk"
}
]
}
```
For the file `src/services/api.js` (150 lines), I detected 3 critical errors and 2 refactoring opportunities. The most urgent issue is in the `fetchUserData` function where the `userId` parameter isn't validated, causing the TypeError on line 15 when `undefined` is passed. The fix involves adding a guard clause: `if (!userId) throw new Error('userId is required')`.
For refactoring, the `DataProcessor` class violates the Single Responsibility Principle by handling both data transformation and API communication. Extracting the transformation logic into a `DataTransformer` class would improve maintainability. The MCP suggestion to use `@modelcontextprotocol/server-node` would help isolate this new module during testing.
The code completion suggestion for the configuration object standardizes our timeout settings across the codebase, aligning with our recent architectural decision to enforce consistent API behavior. This prevents the 'callback hell' pattern we've seen in legacy code where timeouts vary between 1-10 seconds.
Total analysis time: 47 seconds using LSP integration with 89% accuracy on error detection.AI assistant built for thoughtful, nuanced conversation
IronCalc is a spreadsheet engine and ecosystem
ITIL-aligned IT service management platform
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan