loading…
Search for a command to run...
loading…
Provides JavaScript/TypeScript code intelligence via LSP, enabling goto definition, hover info, and find references through MCP tools.
Provides JavaScript/TypeScript code intelligence via LSP, enabling goto definition, hover info, and find references through MCP tools.
Python MCP server wrapping TypeScript Language Server for JavaScript/TypeScript code intelligence.
Status: ✅ Working with real LSP protocol (not mock)
Supports JavaScript and TypeScript files via TypeScript Language Server.
cd /path/to/w3-mcp-server-lsp
# Remove old lockfile and venv
rm -rf uv.lock .venv venv
# Unset old environment variable
unset VIRTUAL_ENV
# Install TypeScript Language Server
npm install -g typescript typescript-language-server
# Install Python dependencies (using uv)
uv sync
# Install MCP CLI dependencies
uv pip install 'mcp[cli]'
# Check typescript-language-server
which typescript-language-server
typescript-language-server --version
# Check Python env
uv run python -c "from mcp.server.fastmcp import FastMCP; print('✓ MCP ready')"
# Start MCP Inspector (interactive web UI)
uv run mcp dev server.py
Opens URL like:
http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=...
Features:
Best way to test and debug:
cd /path/to/w3-mcp-server-lsp
# Start inspector
uv run mcp dev server.py
Opens web UI at http://localhost:5173:
# Run server (stdio mode)
uv run python server.py
Install from PyPI:
pip install w3-mcp-server-lsp
# or
uv pip install w3-mcp-server-lsp
Edit ~/.claude/claude_config.json or ~/.mcp.json:
{
"mcpServers": {
"w3-lsp": {
"type": "stdio",
"command": "uv",
"args": ["run", "--with", "w3-mcp-server-lsp", "w3-mcp-server-lsp"],
"env": {
"PROJECT_ROOT": "/path/to/your/project"
}
}
}
}
Advantages:
Edit ~/.claude/claude_config.json:
{
"mcpServers": {
"w3-lsp": {
"type": "stdio",
"command": "uv",
"args": ["run", "server.py"],
"cwd": "/path/to/w3-mcp-server-lsp",
"env": {
"PROJECT_ROOT": "/path/to/your/project"
}
}
}
}
Then restart Claude Code.
All tools use 0-indexed positioning (start from 0, not 1):
| Editor Display | Tool Input | Formula |
|---|---|---|
| Ln 5, Col 10 | line: 4 | lsp_value = editor_value - 1 |
| Ln 1, Col 1 | line: 0 | character: 0 |
| Ln 10, Col 5 | line: 9 | character: 4 |
Quick Reference:
line: 0 in toolcharacter: 0 in toolHow to Calculate Character Position:
Given this code line:
const greeting = "Hello";
0123456789...
c in const → character: 0o in const → character: 1g in greeting → character: 6H in "Hello" → character: 18In VSCode:
Ln X, Col Yline: X-1, character: Y-1Jump to definition of symbol at specified position.
Input:
{
"file_path": "fixtures/sample.js",
"line": 4,
"character": 9
}
Output:
/path/to/fixtures/sample.js:5:9
Get type information and documentation for symbol.
Input:
{
"file_path": "fixtures/sample.js",
"line": 5,
"character": 10
}
Output:
(parameter) a: any
Find all references/usages of symbol.
Input:
{
"file_path": "fixtures/sample.js",
"line": 4,
"character": 9
}
Output:
Found 2 references:
/path/to/fixtures/sample.js:5:9
/path/to/fixtures/sample.js:14:22
Specifies the root directory of your project. Files paths in tool calls are relative to this.
Set via:
Environment variable:
export PROJECT_ROOT="/path/to/your/project"
uv run python server.py
Current directory (default):
cd /path/to/your/project
uv run python /path/to/w3-mcp-server-lsp/server.py
In .claude/settings.json:
"env": {
"PROJECT_ROOT": "/path/to/your/project"
}
LSP uses 0-indexed positions:
Ln 5, Col 10line: 4, character: 9Formula: lsp_value = vscode_value - 1
w3-mcp-server-lsp/
├── server.py # MCP server entry point
├── lsp_client.py # LSP protocol implementation
├── pyproject.toml # Project config
├── fixtures/
│ └── sample.js # Sample file for testing
├── test_mcp_server.py # Integration test
├── test_lsp_debug.py # Debug test with logging
└── README.md
MCP Client (Claude, IDE, etc.)
↓
MCP Server (server.py)
↓
LSP Client (lsp_client.py)
↓
TypeScript Language Server (subprocess)
Initialization
initialize requestinitialized notificationDocument Opening
textDocument/didOpen notificationQueries
textDocument/definition, textDocument/hover, etc.Details
uv run mcp dev server.py
Web UI opens at http://localhost:5173:
uv run python server.py
Runs in stdio mode, ready to connect from Claude Code or other MCP clients.
# Install
npm install -g typescript typescript-language-server
# Verify
which typescript-language-server
# Install dependencies
pip install -e .
# Or manually
pip install mcp pydantic
typescript-language-server --stdio directlyNone or erroruv run mcp dev server.py) to see requests/responsesuv run mcp dev server.py
Web UI at http://localhost:5173 shows:
uv run python server.py
For debugging, check logs output in terminal.
MIT
Run in your terminal:
claude mcp add w3-mcp-lsp-server -- npx Security
Low riskAutomated heuristic from public metadata — not a security guarantee.