Exposes TypeScript LSP-like functionality including type inspection, definition lookup, references finding, hover documentation, diagnostics, and type testing capabilities for TypeScript projects.
ts-lsp-mcp
MCP server exposing TypeScript LSP-like functionality to AI agents.
Gives AI agents the same "what's the type at this position?" powers that IDE users have.
Quick Start
Install into Claude Code
That's it! The MCP server is now available to Claude Code.
Uninstall
Manual Installation
Global npm install
Manual config
Add to your Claude Code MCP config (.mcp.json in project or ~/.claude/settings.json globally):
HTTP/SSE Mode
For remote clients or debugging:
Endpoints:
GET /sse- SSE connectionPOST /message- Send messagesGET /health- Health check
Available Tools
Tool | Description |
| Get the TypeScript type at a specific file:line:col |
| Go to definition |
| Find all references |
| Get hover documentation |
| Get autocomplete suggestions |
| Get type errors and warnings |
| Trace where a type comes from and how it's composed |
| Run type assertions from |
| Type-check inline TypeScript without creating files |
Type Test Assertions
Add type assertions to your code:
Run tests:
Example Usage
Get type at position
Supports unified file:line:col format:
Or separate parameters:
Response:
Check for type errors
Type-check inline code
Response:
Features
Multi-project support: Works with monorepos with multiple tsconfigs
Auto-discovery: Finds tsconfig.json automatically
Smart file resolution: Accepts absolute, relative, or unique filenames
Virtual files: Type-check unsaved code with the
contentparameterEfficient: Long-lived daemon caches TypeScript projects
CLI Options
License
MIT