TypeScript Analyzer MCP Server - Enterprise Edition

by davidleathers113

1 stars
356 downloads
Not rated
GitHub

About

Analyze and fix any types in TypeScript with an intelligent MCP server – fast, extensible, and React-aware.

Details

Author
davidleathers113
GitHub stars
1
Downloads
356
Categories
Other

- Scan TypeScript files for any types and suggest replacements
- Automatically replace any types with more specific types
- Process multiple files in batch with configurable concurrency
- Generate TypeScript interfaces for React component props
- Update server configuration (log level, caching) at runtime
- Clear and manage analysis caches on demand

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name TypeScript Analyzer MCP Server - Enterprise Edition
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, run npm install, build with npm run build, and start with npm start (or node dist/index.js). To use with Claude Desktop, add the server to your .claude-app.json configuration under mcpServers. Invoke operations via tools such as analyzeTypeScriptFile, fixTypeScriptFile, batchFixTypeScriptFiles, generateComponentInterface, clearCache, configureServer, and getServerInfo.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "typescript analyzer mcp server - enterprise edition": {
            "typescript-analyzer-mcp": {
                "command": "node",
                "args": [
                    "dist/index.js"
                ]
            }
        }
    }
}

McpServers

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

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:

| Pattern | Replacement |
|-----------------|------------------------------------------------------|
| e: any | e: React.SyntheticEvent |
| event: any | event: React.SyntheticEvent |
| onChange: any | onChange: (value: unknown) => void |
| onClick: any | onClick: (event: React.MouseEvent<HTMLElement>) => void |
| ref: any | ref: React.RefObject<HTMLElement> |
| data: any | data: Record<string, unknown> |
| options: any | options: Record<string, unknown> |
| config: any | config: Record<string, unknown> |
| props: any | props: Record<string, unknown> |
| items: any[] | items: unknown[] |
| results: any[]| results: unknown[] |
| callback: any | callback: (...args: unknown[]) => unknown |

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

License

MIT

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.