ts-language-mcp
Enables AI coding agents to interact with TypeScript projects through compiler-level code intelligence, providing tools for navigation, type information, diagnostics, refactoring, and semantic search.
README
ts-language-mcp
A TypeScript code intelligence server for AI coding agents via MCP (Model Context Protocol).
Why Use This?
AI coding agents working with TypeScript treat code as text — reading entire files, grepping for patterns, guessing at types. ts-language-mcp exposes TypeScript's own compiler intelligence through MCP tools:
| Raw File Access | ts-language-mcp |
|---|---|
| Read entire file to find a function | Jump directly to definition |
| Grep for usage patterns | Get all references with read/write classification |
| Guess at types from context | Get exact types with full generic resolution |
| Hope renames don't break things | Preview and execute renames across files |
Unlike LSP-based alternatives, ts-language-mcp uses the TypeScript compiler API directly — zero config, deeper intelligence (AST search, batch analysis, executable renames, project-wide diagnostics), and no external LSP server required.
Quick Start
# Analyze current directory
npx ts-language-mcp
# Analyze specific project
npx ts-language-mcp /path/to/typescript/project
# Custom server name
npx ts-language-mcp --name my-ts-server /path/to/project
MCP Client Configuration
Claude Code:
claude mcp add typescript -- npx ts-language-mcp /path/to/your/project
Claude Desktop, Cline, etc.:
{
"mcpServers": {
"typescript": {
"command": "npx",
"args": ["ts-language-mcp", "/path/to/your/project"]
}
}
}
The target project needs a tsconfig.json and TypeScript source files. The server auto-loads compiler options and watches for file changes.
Resources
typescript://project/files- List all indexed project filestypescript://project/config- Current compiler optionstypescript://file/{path}- Read file content
Tools
| Category | Tool | Description |
|---|---|---|
| Navigation | get_definition |
Jump from usage to declaration |
get_references |
Find all usages with read/write classification | |
get_implementations |
Find concrete implementations of interfaces | |
get_call_hierarchy |
Trace function callers / callees | |
get_type_hierarchy |
Navigate inheritance chains | |
| Type Intelligence | get_hover |
Type info and JSDoc at a position |
get_signature |
Function parameter help | |
| Code Structure | get_symbols |
Flat list of symbols in a file |
get_outline |
Hierarchical file structure | |
get_imports |
List all imports with details | |
| Semantic Search | find |
AST search by name pattern, kind, scope |
get_workspace_symbols |
Fast fuzzy symbol search | |
| Diagnostics | get_diagnostics |
Errors/warnings for a file |
get_all_diagnostics |
Project-wide diagnostics | |
get_completions |
Context-aware completions | |
| Refactoring | rename_preview |
Preview rename impact |
rename_symbol |
Execute rename across project | |
format_document |
Format with built-in formatter | |
| Efficiency | analyze_position |
Combined analysis in one call |
batch_analyze |
Analyze multiple positions at once |
Development
npm test # Run tests (watch)
npm run test:run # Run tests once
npm run build # Build
npm run dev # Watch mode
Architecture
src/
index.ts # CLI entry point
server.ts # MCP server setup
language-service.ts # TypeScript Language Service wrapper
ast-finder.ts # AST traversal for semantic search
tools.ts # MCP tool definitions and handlers
resources.ts # MCP resource definitions
types.ts # Shared type definitions
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.