ts-language-mcp
Provides TypeScript code intelligence tools for AI coding agents, including navigation, type information, code structure, semantic search, diagnostics, and refactoring capabilities via direct TypeScript compiler API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ts-language-mcpget definition of UserService"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 | Ask for it by name, no coordinates needed |
Grep for usage patterns | Get all references with read/write classification and their source lines |
Guess at types from context | Get exact types with full generic resolution |
Hope renames don't break things | Preview and execute renames across files |
Hand-write the fix for a compiler error | Apply the compiler's own quick fix |
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.
Built for agents, not editors
Address symbols by name. Every position-based tool accepts
symbol: "UserService.getUser"instead of a line and column. An ambiguous name returns the candidates rather than silently picking one, and an out-of-range coordinate is an error rather than a quiet answer about the wrong code.Results carry their source line. References, definitions, implementations and hierarchy results include the code they point at, so there is no follow-up file read just to see what was found.
Fixes come from the compiler.
get_code_fixesandorganize_importssurface TypeScript's own edits, including the correct import path, instead of leaving an agent to guess one.Large results say they are large. Tools that can return unbounded lists report
total,returnedandtruncatedrather than quietly cutting off.
Related MCP server: code-dev-intel
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/projectMCP Client Configuration
Claude Code:
claude mcp add typescript -- npx ts-language-mcp /path/to/your/projectClaude 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, honours include/exclude, and re-checks changed files on each request (throttled; there is no filesystem watcher).
Resources
typescript://project/files- List all indexed project filestypescript://project/config- Current compiler optionstypescript://file/{path}- Read a single file's content
Tools
Tools marked by name accept symbol in place of line/column.
Category | Tool | Description |
| Jump from usage to declaration (by name, returns all declarations) | |
| Jump to a symbol's type rather than the symbol (by name) | |
| Find all usages with read/write classification (by name, paged) | |
| Find concrete implementations of interfaces (by name) | |
| Trace function callers / callees (by name) | |
| Navigate inheritance chains (by name) | |
Type Intelligence |
| Type info and JSDoc (by name) |
| Function parameter help (by name) | |
Code Structure |
| Flat list of symbols in a file (paged) |
| Hierarchical file structure | |
| List all imports with details | |
Semantic Search |
| AST search by name pattern, kind, scope (paged) |
| Fast fuzzy symbol search | |
Diagnostics |
| Errors/warnings for a file, TypeScript + ESLint |
| Project-wide diagnostics, including tsconfig errors | |
| Context-aware completions | |
| The compiler's own fixes for an error (by name) | |
| Apply a fix and write it to disk (by name) | |
| Sort imports and drop unused ones | |
| Preview rename impact (by name) | |
| Execute rename across project, written to disk (by name) | |
| Format with built-in formatter, written to disk | |
Code Quality |
| Cyclomatic complexity and LOC per function/file |
| Structurally duplicated code blocks | |
| Symbols reached through deep call chains | |
| What a file imports and what imports it | |
| Top offenders across all quality categories | |
Efficiency |
| Combined analysis in one call (by name) |
| Analyze multiple positions at once (by name) |
Writes to disk
rename_symbol, format_document, apply_code_fix and organize_imports (with apply: true) modify files on disk. Everything else is read-only; rename_preview and organize_imports without apply show the edits without making them.
Development
npm test # Run tests (watch)
npm run test:run # Run tests once
npm run build # Build
npm run dev # Watch modeArchitecture
src/
index.ts # CLI entry point
server.ts # MCP server setup
language-service.ts # TypeScript Language Service wrapper
file-manager.ts # In-memory file cache, tsconfig-scoped refresh
symbol-resolver.ts # Resolves symbol names to file positions
ast-finder.ts # AST traversal for semantic search
position-utils.ts # Line/column to offset conversion
paths.ts # Cross-platform path normalization
yaml.ts # Token-efficient result serializer
version.ts # Package version, read from package.json
types.ts # Shared type definitions
resources.ts # MCP resource definitions
tools/
index.ts # Tool registry, request queue, path validation
schemas.ts # Shared JSON Schema fragments
paginate.ts # limit/offset with truncation reporting
navigation.ts # definitions, references, hierarchies
intelligence.ts # hover, signatures, completions, batch analysis
structure.ts # symbols, outline, imports, search
diagnostics.ts # TypeScript + ESLint diagnostics
refactoring.ts # renames, formatting, code fixes
quality.ts # complexity, duplication, coupling, dependencies
analyzers/
complexity-analyzer.ts, coupling-analyzer.ts,
duplication-detector.ts, indirection-analyzer.tsLicense
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceExposes TypeScript Language Server Protocol functionality to AI agents, enabling them to query types at specific positions, find definitions and references, get diagnostics, run type tests, and type-check inline code just like in an IDE.91023MIT
- AlicenseNot gradedqualityCmaintenanceA self-hosted MCP and HTTP server for TypeScript code intelligence, providing AI agents with fast semantic code navigation tools like finding definitions, references, implementations, file outlines, dependency graphs, and search.272AGPL 3.0
- AlicenseAqualityDmaintenanceProvides real-time TypeScript diagnostics with intelligent caching for AI agents, enabling instant queries instead of running tsc repeatedly.9353MIT
- AlicenseNot gradedqualityDmaintenanceExposes type-aware code navigation and fast file search to AI agents via language servers, enabling definitions, references, symbols, and file lookup without reading entire codebases.3,520MIT
Related MCP Connectors
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Search @imqueue docs and scaffold typed services & clients from your AI coding agent.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jgauffin/ts-language-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server