tsserver-mcp-server
Provides tools for TypeScript language services including completions, go-to-definition, type info, diagnostics, signature help, and references, enabling AI agents to interact with TypeScript/JavaScript code.
Click on "Deploy 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., "@tsserver-mcp-serverShow diagnostics for src/main.ts"
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.
tsserver-mcp-server
⚠️ Early development: this project is in an early stage and currently supports only a single TypeScript project at a time.
An MCP (Model Context Protocol) server built on the TypeScript Language Service. It exposes tools for completions, go-to-definition, type info, diagnostics, and more for use by AI or IDE clients.
Install dependencies
bun installRelated MCP server: TypeScript LSP MCP
Run
bun serveRuns in stdio mode for MCP client connections.
Tools
Tool | Description |
| Get completion suggestions at the cursor position |
| Get the definition location of a symbol (Go to Definition) |
| Get the definition location of a type |
| Get type and documentation at the cursor (Hover) |
| Get signature help (parameter hints) at a function call |
| Get all reference locations of a symbol (Find References) |
| Get syntactic and semantic diagnostics (errors/warnings) for a file |
Input parameters (shared by most tools)
filePath: File path (absolute or relative to project root)
fileContent: File content (TypeScript/JavaScript source code)
line / offset: Cursor line and column (1-based)
projectPath (optional): Project root directory (the one that contains
node_modules/tsconfig). When set, the server reads other project files from disk so that imports (e.g.zod), go-to-definition, and find-references work across the project. If omitted, only the in-memoryfileContentis used.
Cursor MCP configuration example
Add to your Cursor MCP settings:
{
"mcpServers": {
"tsserver": {
"command": "bun",
"args": ["run", "/path/to/tsserver-mcp-server/index.ts"]
}
}
}Replace /path/to/tsserver-mcp-server with the actual path to this project.
Technical notes
Uses TypeScript’s built-in
ts.createLanguageService; does not depend on a separate tsserver process.Project mode: Pass
projectPath(your repo root) so the host reads from disk. Thennode_modules, cross-file definitions, and references work.Single-file mode: Omit
projectPath(or only passfilePath+fileContent) to analyze one file in isolation without disk access.
Available Tools
7 toolsget_completionsB
Get completion suggestions (completion list) at the given position
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Cursor line (1-based) | |
| offset | Yes | Cursor column (1-based) | |
| filePath | Yes | File path (absolute or relative to project root) | |
| fileContent | Yes | File content (TypeScript/JavaScript source code) | |
| projectPath | No | Project root (directory with node_modules/tsconfig). When set, the server reads project files from disk so imports (e.g. zod) and cross-file features work. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It only states the basic action without revealing any side effects, prerequisites, or return behavior. For instance, it doesn't mention that projectPath enables reading files from disk or that completions depend on fileContent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no wasted words. It is appropriately concise for a simple query tool, and the structure is clear.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is minimal and lacks essential context. There is no output schema and no annotations, so the description should explain more about what to expect from a completion list or how the line/offset/position parameters relate. It is incomplete for a tool with five parameters and no other documentation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for all five parameters. The description adds no semantic value beyond the schema, but the schema already fully documents each parameter, so the baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'Get completion suggestions (completion list) at the given position'. The verb 'get' and resource 'completion suggestions' are specific, and it distinguishes from siblings like get_definition or get_references by focusing on completions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description only states what it does, not the contexts in which it is appropriate or preferable, nor any exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_definitionC
Get the definition location of the symbol at the cursor (Go to Definition)
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Cursor line (1-based) | |
| offset | Yes | Cursor column (1-based) | |
| filePath | Yes | File path (absolute or relative to project root) | |
| fileContent | Yes | File content (TypeScript/JavaScript source code) | |
| projectPath | No | Project root (directory with node_modules/tsconfig). When set, the server reads project files from disk so imports (e.g. zod) and cross-file features work. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must disclose behavioral traits. It only says 'get definition location' without explaining whether it reads from fileContent, requires projectPath for cross-file definitions, or what the return format is (e.g., range, URI). The optional projectPath parameter hints at behavior, but the description itself adds minimal transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with no redundant wording. It is concise and front-loaded with the core action. However, it may be too terse given the tool's complexity, yet it earns its place by stating the essential purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Without an output schema, the description should at least mention the result type (e.g., location/range) and whether cross-file resolution requires projectPath. It also doesn't differentiate from get_type_definition or clarify when the cursor-based approach is appropriate. The tool has moderate complexity and sibling tools, so more context is needed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides detailed descriptions for all five parameters (line, offset, filePath, fileContent, projectPath), so coverage is 100%. The description adds no extra parameter semantics, but the schema already explains the meaning and purpose of each field, including the optional projectPath behavior.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get the definition location') and the target ('the symbol at the cursor'), including the familiar 'Go to Definition' phrase. It is distinct from sibling get_type_definition by emphasizing definition location rather than type definition, though it doesn't explicitly call out that distinction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus siblings like get_type_definition or get_references. The description implies it is for navigating to a symbol's definition at the cursor position, but there are no explicit use-case instructions or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_diagnosticsA
Get syntactic and semantic diagnostics (errors/warnings) for the file
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | File path | |
| fileContent | Yes | File content | |
| projectPath | No | Project root directory |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It mentions 'syntactic and semantic diagnostics', which adds some context, but does not disclose output format, whether projectPath is required, or any side effects. The description is too brief to fully inform the agent about the tool's behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that front-loads the core purpose. It contains no filler or redundant information, making it highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity and that schema covers parameters, the description is adequate but incomplete. It lacks information about return structure or behavior, which is important since no output schema exists. The purpose is clear, but the agent would need to infer what 'diagnostics' entails beyond the given parenthetical.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% as filePath, fileContent, and projectPath each have a description in the schema. The description adds minimal extra meaning beyond the schema, only clarifying that the tool works on 'the file'. It does not provide additional parameter semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'Get syntactic and semantic diagnostics (errors/warnings) for the file'. The verb 'Get' combined with the resource 'diagnostics' is specific and distinguishes it from siblings like get_completions or get_definition, which serve different purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for retrieving errors/warnings from a file but does not explicitly state when to use this tool over alternatives or provide exclusions. Sibling tools (e.g., get_definition, get_references) are clearly different, but no direct comparison is made.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_quick_infoA
Get type and documentation at the cursor (hover)
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Cursor line (1-based) | |
| offset | Yes | Cursor column (1-based) | |
| filePath | Yes | File path (absolute or relative to project root) | |
| fileContent | Yes | File content (TypeScript/JavaScript source code) | |
| projectPath | No | Project root (directory with node_modules/tsconfig). When set, the server reads project files from disk so imports (e.g. zod) and cross-file features work. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the behavioral burden. It states the action is a read-only 'get' and describes the output conceptually, but does not mention any limitations, prerequisites (e.g., projectPath for cross-file resolution), or whether it reads from disk or uses the provided fileContent. Minimal but not misleading.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single 8-word sentence, front-loaded with the verb and object. No wasted words, though additional context could be added without harming structure.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has 5 parameters and no output schema, so the description should explain the return value and the effect of optional projectPath. It only states 'type and documentation' without format or behavioral details, making it adequate for a simple case but incomplete for the full feature set.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description does not add any parameter-specific semantics; the schema already explains line/offset/filePath/fileContent/projectPath. The description's 'at the cursor' loosely ties to line/offset but adds no new meaning.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Get' and identifies the target resource as 'type and documentation at the cursor', clearly differentiating from siblings like get_definition (which navigates) and get_signature_help (which shows call signatures). The '(hover)' parenthetical further narrows the intent.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage (when you want hover-style info) but does not explicitly compare to siblings or state when not to use. No exclusions or alternatives are mentioned, so the guidance is only implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_referencesA
Get all reference locations of the symbol at the cursor (Find References)
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Cursor line (1-based) | |
| offset | Yes | Cursor column (1-based) | |
| filePath | Yes | File path (absolute or relative to project root) | |
| fileContent | Yes | File content (TypeScript/JavaScript source code) | |
| projectPath | No | Project root (directory with node_modules/tsconfig). When set, the server reads project files from disk so imports (e.g. zod) and cross-file features work. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It does not reveal whether the tool reads fileContent from memory, requires a project, or works cross-file. The schema's projectPath description mentions disk reads, but the description itself adds no behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-structured sentence that leads with the action, scope, and context ('at the cursor'). Every word earns its place, and it is immediately understandable.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is a standard code navigation feature, and the schema is detailed, but the description omits important context such as how references are computed (in-memory vs disk), what counts as a reference, and what happens when projectPath is not set. Given no output schema or annotations, the description could be richer.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds no parameter-specific meaning, but the schema already provides adequate descriptions for all parameters, including the optional projectPath's role.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'Get all reference locations of the symbol at the cursor'. The parenthetical '(Find References)' reinforces the IDE feature name, and this distinctly differentiates from sibling tools like get_definition and get_type_definition.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The usage is implied by the name and the mention of 'at the cursor', but no explicit guidance is given about when to choose this over alternatives like get_definition or get_quick_info. There are no exclusions or alternative recommendations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_signature_helpB
Get signature help (parameter hints) at a function call
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Cursor line (1-based) | |
| offset | Yes | Cursor column (1-based) | |
| filePath | Yes | File path (absolute or relative to project root) | |
| fileContent | Yes | File content (TypeScript/JavaScript source code) | |
| projectPath | No | Project root (directory with node_modules/tsconfig). When set, the server reads project files from disk so imports (e.g. zod) and cross-file features work. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description carries the full burden. It only restates the purpose and does not disclose response format, failure modes, or side effects. 'Get' implies a read operation, but this is not explicitly stated.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence that is efficient and contains no wasted words. It immediately conveys the core functionality.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema and minimal description, the tool lacks contextual depth. It does not explain how fileContent and projectPath interact or what the return structure will look like. For a 5-parameter tool, this is insufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides 100% coverage for all 5 parameters with clear descriptions. The tool description adds no additional parameter semantics beyond the schema, so the baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's action: 'Get signature help (parameter hints) at a function call'. This uses a specific verb and resource, and clearly distinguishes it from siblings like get_completions and get_definition.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. It does not mention any exclusions or specify contexts where it should be preferred over sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_type_definitionB
Get the definition location of the type at the cursor
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Cursor line (1-based) | |
| offset | Yes | Cursor column (1-based) | |
| filePath | Yes | File path (absolute or relative to project root) | |
| fileContent | Yes | File content (TypeScript/JavaScript source code) | |
| projectPath | No | Project root (directory with node_modules/tsconfig). When set, the server reads project files from disk so imports (e.g. zod) and cross-file features work. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It only states 'Get the definition location' without revealing whether this is a read-only operation, what the response format is, or how the optional projectPath influences file reading. The agent is left uninformed about side effects or limitations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence that immediately communicates the core action. It contains no filler or redundant content, making it highly concise and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no output schema, so the description should explain return values, but it only mentions a vague 'definition location.' It also fails to mention important context such as the role of projectPath in enabling cross-file type resolution, leaving the description incomplete for a language-server tool with multiple parameters and siblings.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides 100% coverage with clear descriptions for all five parameters, including the nuanced projectPath. The tool description adds no additional parameter meaning beyond what the schema already offers, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Get the definition location of the type at the cursor.' It uses a specific verb and resource, and the word 'type' distinguishes it from the sibling 'get_definition' which presumably retrieves the symbol's definition rather than its type definition.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like get_definition or get_quick_info. There is no mention of context, prerequisites, or exclusion criteria, leaving the agent to infer usage solely from the name.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
7 tool updates
v0.1.0- First observed
get_completions - First observed
get_definition - First observed
get_diagnostics - First observed
get_quick_info - First observed
get_references - First observed
get_signature_help - First observed
get_type_definition
TDQS
Scored across 7 tools
Each tool targets a distinct IDE feature: completions, definition, type definition, hover info, diagnostics, signature help, and references. There is no overlap in their purposes.
All tool names follow the get_verb_noun pattern, making them predictable and consistent. The naming convention is uniform throughout.
Seven tools is a well-scoped count for a language server toolkit, covering the core navigation and diagnostic features without being excessive.
The set covers most common language server operations (navigation, hover, diagnostics, references), but misses features like rename or code actions. These gaps are minor and agents can work around them.
Maintenance
Related MCP Connectors
Lean 4 MCP server: compile, prove theorems, and formalize math with Mathlib.
The official Svelte MCP server providing docs and autofixing tools for Svelte development
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automati…
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceExposes VSCode's Language Server Protocol features through MCP, enabling AI assistants to perform language-aware operations like symbol navigation, reference tracking, safe renaming, type information retrieval, and hover documentation across codebases.-
- 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.91463MIT
- AlicenseAqualityDmaintenanceA TypeScript-aware MCP server that provides coding agents with repository discovery, code intelligence, and web project context for local codebases. It enables deep symbol navigation, diagnostic reporting, and structural analysis of monorepos without requiring full IDE integration.7111MIT
- AlicenseAqualityCmaintenanceProvides JavaScript/TypeScript code intelligence via LSP, enabling goto definition, hover info, and find references through MCP tools.31MIT