Offers platform-specific installation support for Claude Desktop configuration on Linux systems.
Provides platform-specific installation support for Claude Desktop configuration on macOS systems.
Generates dependency graph visualizations in Mermaid format for TypeScript projects, with support for circular dependency detection and module boundary analysis.
Analyzes and optimizes TypeScript codebases in Node.js environments, supporting project-wide refactoring and dependency management.
Provides development tools for TypeScript projects including automated refactoring (file moves with import updates, symbol renaming), code analysis, dependency visualization, import optimization, and package.json validation.
TypeScript Tools MCP
A Model Context Protocol (MCP) server that provides TypeScript development tools for automated refactoring and code analysis.
Features
1. File Move with Import Updates (move_typescript_file
)
Move TypeScript files while automatically updating all import paths across your codebase.
Parameters:
source
: Source file pathdestination
: Destination file pathupdateImports
: Whether to update import paths (default: true)
Features:
- Smart Index File Handling: When moving
index.ts
files, imports are updated to reference the directory instead of the full path./utils/index
→./helpers
(when movingutils/index.ts
tohelpers/index.ts
)
- Automatic Path Resolution: Handles various file extensions (
.ts
,.tsx
) and index file patterns - Project-wide Updates: Scans and updates all TypeScript files in the project
2. Symbol Rename (rename_typescript_symbol
)
Rename variables, functions, types, interfaces, or classes with automatic reference updates throughout the codebase.
Parameters:
filePath
: Path to the file containing the symbololdName
: Current name of the symbolnewName
: New name for the symboltype
: Type of symbol ('variable' | 'function' | 'type' | 'interface' | 'class')
3. File/Folder Rename (rename_file_or_folder
)
Rename a file or folder and automatically update all import/export paths that reference it throughout the codebase.
Parameters:
sourcePath
: Path to the file or folder to renamedestinationPath
: New path for the file or folderupdateImports
: Whether to update import/export paths (default: true)
Features:
- Cascade Import Updates: Automatically updates all imports and exports that reference the renamed file/folder
- Directory Support: Can rename entire directories with all contained files
- Path Style Preservation: Maintains import style (with/without extensions, with/without /index)
- Dynamic Import Support: Updates dynamic
import()
statements in addition to static imports - Project-wide Scope: Scans and updates all TypeScript files in the project
4. Dependency Analysis (analyze_typescript_dependencies
)
Analyze file dependencies in both directions to understand code relationships.
Parameters:
filePath
: Path to the TypeScript file to analyzedirection
: Direction of analysis ('upstream' | 'downstream' | 'both')upstream
: Files that import the target filedownstream
: Files that the target file imports
includeTypes
: Whether to include type-only imports (default: true)
5. Package.json Validation (validate_package_json
)
Validate package.json configuration for type resolution, file existence, and proper exports setup.
Parameters:
packageJsonPath
: Path to the package.json file to validatecheckTypes
: Whether to check TypeScript type resolution (default: true)checkExports
: Whether to validate exports field (default: true)checkTypesVersions
: Whether to validate typesVersions field (default: true)
Validation includes:
- File Resolution: Validates that
main
,module
,browser
,types
,bin
fields point to existing files - Type Resolution: Checks if types are properly configured and accessible
- Exports Validation: Ensures all export paths resolve to existing files
- TypesVersions: Validates typesVersions mappings for different TypeScript versions
6. Import Optimization (optimize_imports
)
Optimize TypeScript import statements by removing unused imports, consolidating duplicates, separating types, and optimizing paths.
Parameters:
filePath
: Path to the TypeScript file to optimizeremoveUnused
: Whether to remove unused imports (default: true)optimizeIndexPaths
: Whether to remove /index suffixes from import paths (default: true)consolidateImports
: Whether to consolidate multiple imports from the same module (default: true)separateTypeImports
: Whether to separate type and value imports usingimport type
(default: true)
Optimizations include:
- Unused Import Removal: Removes unused named imports and entire unused import statements
- Index Path Optimization: Converts
./utils/index
to./utils
automatically - Import Consolidation: Merges multiple import statements from the same module
- Type Import Separation: Separates type imports using
import type { Type }
syntax for better tree-shaking
7. Conditional Optimization (optimize_conditionals
)
Optimize conditional statements by converting if-else chains to switch statements, flattening nested conditions, and simplifying boolean expressions.
Parameters:
filePath
: Path to the TypeScript file to optimizeconvertToSwitch
: Whether to convert if-else chains to switch statements (default: true)flattenNestedConditions
: Whether to flatten nested if statements (default: true)optimizeBoolean
: Whether to optimize boolean expressions (default: true)
Optimizations include:
- If-Else to Switch: Converts if-else chains with 3+ equality comparisons to switch statements
- Nested Condition Flattening: Combines nested if statements using logical operators
- Boolean Expression Simplification: Removes redundant boolean comparisons and double negations
8. Dependency Visualization (visualize_dependencies
)
Generate dependency graph visualization with circular dependency detection and module boundary analysis.
Parameters:
rootPath
: Root path of the project to analyzeformat
: Output format ('mermaid' | 'json' | 'dot', default: 'mermaid')includeNodeModules
: Whether to include node_modules in analysis (default: false)maxDepth
: Maximum directory depth to analyze (default: 10)detectCircular
: Whether to detect circular dependencies (default: true)
Features include:
- Dependency Graph Generation: Creates visual dependency graphs in Mermaid, DOT, or JSON format
- Circular Dependency Detection: Identifies and reports circular dependencies with severity levels
- Module Boundary Analysis: Analyzes import/export relationships and module structure
- Statistics: Provides metrics on file count, import count, dependency depth, and circular dependencies
Installation
Installation
Command Line Usage
After building, you can use the ts-tools
command directly:
Configuration
For Claude Desktop
- Generate configuration snippet:
- Automatic installation (macOS/Windows/Linux):
- Manual installation:
Add the generated configuration from
mcp-config.json
to your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Linux:
~/.config/claude/claude_desktop_config.json
Development
Requirements
- Bun runtime
- TypeScript project with tsconfig.json
- Node.js compatible environment
This server cannot be installed
A Model Context Protocol (MCP) server that provides TypeScript development tools for automated refactoring and code analysis.
- Features
- 1. File Move with Import Updates (move_typescript_file)
- 2. Symbol Rename (rename_typescript_symbol)
- 3. File/Folder Rename (rename_file_or_folder)
- 4. Dependency Analysis (analyze_typescript_dependencies)
- 5. Package.json Validation (validate_package_json)
- 6. Import Optimization (optimize_imports)
- 7. Conditional Optimization (optimize_conditionals)
- 8. Dependency Visualization (visualize_dependencies)
- Installation
- Installation
- Command Line Usage
- Configuration
- Development
- Requirements
Related MCP Servers
- AsecurityFlicenseAqualityA template for creating Model Context Protocol (MCP) servers in TypeScript, offering features like container-based dependency injection, a service-based architecture, and integration with the LLM CLI for architectural design feedback through natural language.Last updated -196TypeScript
- AsecurityAlicenseAqualityA TypeScript-based template for building Model Context Protocol servers, featuring fast testing, automated version management, and a clean structure for MCP tool implementations.Last updated -13274TypeScriptMIT License
- -securityFlicense-qualityA TypeScript framework for building Model Context Protocol (MCP) servers with automatic discovery and loading of tools, resources, and prompts.Last updated -0TypeScript
- -securityAlicense-qualityA simple TypeScript library for creating Model Context Protocol (MCP) servers with features like type safety, parameter validation, and a minimal code API.Last updated -51TypeScriptMIT License