React Analyzer MCP server

Enables parsing and analysis of React component structures, props, and state management patterns for code review, debugging, and understanding complex React codebases
Back to servers
Provider
Azer
Release date
Apr 10, 2025
Language
TypeScript
Stats
9 stars

This MCP server allows you to analyze React components and generate documentation using Claude AI. It extracts information about components and their props from JSX/TSX files, making it easier to understand and document your React codebase.

Installation

To set up the React Analyzer MCP server:

# Clone the repository
git clone https://github.com/azer/react-analyzer-mcp.git
cd react-analyzer-mcp

# Install dependencies
npm install

# Update PROJECT_ROOT in the index.ts file
vim src/index.ts

# Build the project
npm run build

Configuring with Claude

Enable the MCP Server

Add the MCP server configuration to your Claude Desktop config:

{
    "react-analyzer-mcp": {
      "command": "node",
      "args": [
        "/Users/yourname/path/to/react-analyzer-mcp/build/index.js"
      ]
    }
}

Make sure to update the path to match your actual installation location.

Connect to Claude

Once configured, connect Claude to your MCP server using the Claude Shell. The server provides several tools that can be accessed directly in your Claude conversations.

Available Tools

The React Analyzer MCP provides three main tools:

  • analyze-react: Analyzes a single React component from source code
  • analyze-project: Generates documentation for all React components in a project folder
  • list-projects: Lists all projects under the root folder

Usage Examples

Analyzing Components in a Project

You can ask Claude to analyze components in a specific folder:

Can you analyze the components in my "foobar" folder?

Claude will return documentation for all React components found in that folder, including details about their props, types, and default values:

# Components

## Button

### Props

| Prop | Type | Optional | Default |
|------|------|----------|---------|
| `variant` | `string` | ✓ | `primary` |
| `size` | `string` | ✓ | `md` |
| `onClick` | `function` | ✓ | |

Listing Available Projects

You can ask Claude to show what React components are in your project:

What React components do I have in my project?

This will use the list-projects tool to show all available React projects under your configured root folder.

Analyzing a Single Component

To analyze just one component, you can ask Claude about it specifically:

Can you analyze the Button component for me?

This will provide detailed information about that specific component's props and structure.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later