Sponsored by Deepsite.site

TypeScript Analyzer MCP Server - Enterprise Edition

Created By
davidleathers1138 months ago
Analyze and fix any types in TypeScript with an intelligent MCP server – fast, extensible, and React-aware.
Content

TypeScript Analyzer MCP Server - Enterprise Edition

A high-performance MCP (Model Context Protocol) server for analyzing and fixing TypeScript any types in your codebase, with advanced error handling, caching, and intelligent type inference.

Features

  • 🔍 Analyze TypeScript Files: Scan files for any types and get suggested replacements
  • 🛠️ Fix TypeScript Files: Automatically replace any types with more specific types
  • 📊 Batch Processing: Process multiple files at once
  • 🧩 Component Interface Generation: Generate TypeScript interfaces for React components
  • ⚙️ Server Configuration: Dynamically update server config (log level, caching, etc.)
  • 🔧 Cache Management: Clear and manage analysis caches

Installation

  1. Clone this repository
  2. Install dependencies:
    npm install
    
  3. Build the project:
    npm run build
    
  4. Start the server:
    npm run start
    
    or
    node dist/index.js
    

Using with Claude Desktop

To use this MCP server with Claude Desktop, add it to your .claude-app.json configuration file:

{
  "mcpServers": {
    "typescript-analyzer": {
      "command": "node",
      "args": ["/path/to/typescript-analyzer-mcp/dist/index.js"],
      "env": {}
    }
  }
}

Tools

getServerInfo

Retrieves basic information about the analyzer server (name, version, description, features, configuration).

Example:

Please provide server info

configureServer

Updates server configuration (log levels, caching, etc.) at runtime.

Parameters:

  • config: A partial configuration object to merge with the current config

Example:

Please update the logLevel to 'debug' for the server

analyzeTypeScriptFile

Analyzes a TypeScript file for any types.

Parameters:

  • filePath: Path to the TypeScript file to analyze
  • skipCache: (optional) If true, forces a fresh analysis

Example:

Please analyze the TypeScript file src/components/Button.tsx for any types

fixTypeScriptFile

Fixes any types in a single TypeScript file.

Parameters:

  • filePath: Path to the TypeScript file to fix
  • fixType: Default type to use for replacement (default: "unknown")
  • dryRun: If true, show changes without applying them
  • skipBackup: If true, do not create a backup file before modifying

Example:

Please fix the TypeScript file src/components/Button.tsx, using Record<string, unknown> as the default replacement

batchFixTypeScriptFiles

Batch fixes any types in multiple TypeScript files.

Parameters:

  • directory: Directory containing TypeScript files
  • pattern: Glob pattern for files to process (e.g. "**/*.ts")
  • fixType: Default type to use for replacement
  • dryRun: If true, show changes without applying them
  • concurrency: (optional) How many files to process in parallel

Example:

Please fix all TypeScript files in the src/components directory

generateComponentInterface

Generates a proper TypeScript interface for React component props.

Parameters:

  • filePath: Path to the React component file
  • componentName: Name of the component to analyze
  • outputPath: (optional) Path where to save the generated interface

Example:

Please generate an interface for the Button component in src/components/Button.tsx

clearCache

Clears the analysis cache to force fresh analysis on subsequent operations.

Example:

Please clear the analysis cache

Type Mapping Strategy

The server uses a set of predefined mappings for common patterns:

PatternReplacement
e: anye: React.SyntheticEvent
event: anyevent: React.SyntheticEvent
onChange: anyonChange: (value: unknown) => void
onClick: anyonClick: (event: React.MouseEvent<HTMLElement>) => void
ref: anyref: React.RefObject<HTMLElement>
data: anydata: Record<string, unknown>
options: anyoptions: Record<string, unknown>
config: anyconfig: Record<string, unknown>
props: anyprops: Record<string, unknown>
items: any[]items: unknown[]
results: any[]results: unknown[]
callback: anycallback: (...args: unknown[]) => unknown

For patterns not covered by the mappings, it defaults to using unknown.

License

MIT

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Playwright McpPlaywright MCP server
WindsurfThe new purpose-built IDE to harness magic
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Tavily Mcp
Serper MCP ServerA Serper MCP Server
DeepChatYour AI Partner on Desktop
CursorThe AI Code Editor
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
ChatWiseThe second fastest AI chatbot™
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Amap Maps高德地图官方 MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.