Ts MCP Server

MCP server that renames/moves TypeScript files and updates all imports via tsserver

Local serverstdioTypeScript

What is the Ts MCP Server?

MCP server that renames/moves TypeScript files and updates all imports via tsserver

What you get

A lightweight Model Context Protocol (MCP) server for TypeScript and JavaScript refactoring and code intelligence. Every tool maps directly to a tsserver protocol command — the output is the raw, unmodified response from TypeScript's compiler. Rename symbols, extract functions, move declarations between files, reorganize imports, navigate type hierarchies, explore call graphs, search symbols across your workspace, map AI-generated code into the right locations, discover which error codes have automatic fixes, and more — with every import, require, re-export, and

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
renameRename a TypeScript/JavaScript symbol and update all references across the project.
renameFileOrDirectoryRename or move a TypeScript/JavaScript file or directory and update all import paths across the project.
references
getDiagnosticsGet all errors, warnings, and suggestions for a file. Returns semantic diagnostics and suggestion diagnostics as separate arrays.
organizeImports
getCodeFixesGet available code fixes for specific error codes at a range in a file. Use getDiagnostics first to discover error codes and ranges, then pass them here.
getCombinedCodeFixGet a combined code fix that applies all instances of a fix across a file in one action. Returns the full set of file edits as a CombinedCodeActions response. Use getCodeFixes first to discover available fixId values, th
extractFunctionExtract a selected code range into a new function. TypeScript auto-detects parameters and return type. The response includes renameFilename / renameLocation so you can follow up with rename to give the function a meaning
extractConstantExtract a selected expression into a named constant. TypeScript infers the type. The response includes renameFilename / renameLocation so you can follow up with rename to give the constant a meaningful name.
moveSymbolMove top-level declarations (functions, classes, types, constants) to another file. All imports across the project are rewired automatically. If the target file doesn't exist, tsserver creates it.
inlineVariableInline a variable — replace all references with the variable's initializer and delete the declaration. Position must be on the variable name in its declaration or any usage.
extractTypeExtract an inline type annotation into a named type alias. Select the type span to extract. The response includes renameFilename / renameLocation so you can follow up with rename to give the type a meaningful name.

How to install the Ts MCP Server

{
  "mcpServers": {
    "ts": {
      "command": "npx",
      "args": ["-y", "ts-mcp-server"]
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Example prompts to try

  • “Use Ts to Format.”
  • “Use Ts to rename.”
  • “Use Ts to renameFileOrDirectory.”

Frequently asked questions

MCP server that renames/moves TypeScript files and updates all imports via tsserver Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.