Provides compiler-grade symbol renaming and file/directory move planning using the TypeScript Language Service, computing all affected locations and import path updates without modifying files.
@t09tanaka/ts-rename-helper-mcp
An MCP server that provides TypeScript symbol renaming and file/directory moves for coding agents.
This exists as a helper bridge: most current code agents can’t talk to the TypeScript Language Service (LSP) directly, so even a simple rename can be slow and error-prone.ts-rename-helper-mcp gives the agent compiler-grade rename/move plans without touching your filesystem.
⚠️ This project is intentionally narrow in scope and may become obsolete once agents can use LSPs directly.
Features
Type-safe symbol renaming
Uses the TypeScript Language Service to compute all affected locations
File move / rename planning
Returns edits for updated import paths across the project
Directory move / rename planning
Recursively plans file moves and import updates for all files under a directory
Read-only by design
MCP tools only return “edit plans” and suggested file moves
→ actual file writes are left to your editor/agent
Installation
1. Install the package
2. Add to your MCP client
Claude Code:
OpenAI Codex:
Other MCP clients (JSON config):
Requirements
Node.js 18+
A TypeScript project with a valid
tsconfig.json
Tools
This MCP server exposes three tools:
planRenameSymbolplanFileMoveplanDirectoryMove
All tools are pure: they never modify files, they only return structured edit plans.
1. planRenameSymbol
Compute all edits needed to rename a symbol at a specific position.
Input
Output
If the symbol cannot be renamed:
Notes
line/characterare 0-based (same as LSP).filePathmay be relative in input, but output paths are absolute.Agents should:
Read each file
Apply
textEditsin a stable order (typically reverse-sorted by position)Write updated content back
2. planFileMove
Plan a file move/rename and compute all necessary import updates.
Input
Output
Notes
fsMovesis only a suggestion – the agent/editor should perform the actual move.editsshould be applied after the move so that imports point to the new path.
3. planDirectoryMove
Plan a directory move/rename and compute all necessary import updates for files under that directory.
Input
Output
Notes
All TypeScript / TSX files under
oldDirare treated as candidates for moves.Internally this is typically implemented as repeated
getEditsForFileRenamecalls.
Typical agent flow
A coding agent integrating this MCP server would usually:
Decide on an operation:
rename a symbol, or
move a file/directory
Call the corresponding tool (
planRenameSymbol,planFileMove,planDirectoryMove)Inspect the returned
editsandfsMovesApply
fsMovesusing its own filesystem toolsApply
editsto the affected filesOptionally run
tscor tests to validate
Limitations
TypeScript only JavaScript-only projects without
tsconfig.jsonare not currently targeted.Project model is created per call (depending on implementation) For extremely large monorepos you may want to cache the server or run it close to the project root.
No actual file I/O via MCP This server never writes to disk; agents must handle file operations.
License
MIT © 2025 Takuto Tanaka