- Home
- MCP servers
- ts-lsp-mcp
ts-lsp-mcp
- typescript
0
GitHub Stars
typescript
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can run the ts-lsp-mcp MCP server to expose TypeScript LSP-like capabilities to AI agents, giving you powerful type-at-position, hover, and diagnostic features across multiple projects and tsconfig setups.
How to use
Launch the MCP server in stdio mode so your client can connect directly through standard input/output. You can also run in HTTP/SSE mode for remote clients, but the core local setup is the stdio configuration shown below.
How to install
Prerequisites: Node.js (and npm or npx) installed on your system.
Configuration and startup
{
"mcpServers": {
"ts_lsp_mcp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "ts-lsp-mcp", "serve", "--stdio"]
}
}
}
HTTP/SSE mode for remote use
If you want to debug or connect from remote clients, you can run the MCP server in HTTP/SSE mode. Start the server with the HTTP option and choose a port.
ts-lsp-mcp --http --port 3000
Notes on usage
When the server is running in stdio mode, your client should communicate over the standard input/output streams. In HTTP/SSE mode, your client will connect via the provided endpoints and manage messages through HTTP requests or SSE streams.
Available tools
getTypeAtPosition
Return the TypeScript type at a given file position, supporting file:line:col or separate file/line/col parameters.
getDefinition
Navigate to the symbol's definition across the project or workspace.
getReferences
Find all references to a symbol across the codebase.
getHover
Provide hover documentation for a symbol at a specific location.
getCompletions
Suggest autocomplete options at a given code position.
getDiagnostics
Provide type errors and warnings for a file or code snippet.
traceType
Trace where a type originates and how it is composed within the type system.
runTypeTests
Execute type assertions embedded in code comments to verify type expectations.
checkInlineCode
Type-check inline TypeScript code without creating separate files.