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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。