AR

azer/react-analyzer-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

58 stars 6 forks 质量 39 趋势 13

用于分析和生成本地React代码文档的MCP服务器

概览

使用模型上下文协议分析并生成React代码文档。基于React分析器库。 该工具分析 React 组件文件(JSX/TSX),并提取有关组件及其 props 的信息。 - : 分析源代码中的单个 React 组件 - : 生成项目文件夹中所有 React 组件的文档 - : 在根目录下列出所有项目 1. 在 Claude Desktop 配置中启用 MCP 服务器: 2. 使用 Claude Shell 将 Claude 连接到你的 MCP 服务器。 3. 直接在Claude对话中使用这些工具:

概述(AI 翻译)

使用模型上下文协议分析并生成React代码文档。基于React分析器库。

它的作用

该工具分析 React 组件文件(JSX/TSX),并提取有关组件及其 props 的信息。

可用工具

  • analyze-react:分析源代码中的单个 React 组件
  • analyze-project:生成项目文件夹中所有 React 组件的文档
  • list-projects:列出根文件夹下的所有项目

安装

与克劳德一起使用

  1. 在 Claude Desktop 配置中启用 MCP 服务器:

  2. 使用 Claude Shell 将 Claude 连接到你的 MCP 服务器。

  3. 直接在Claude对话中使用这些工具:

或者:

示例

分析一个项目文件夹:

输入:

输出:

许可证

麻省理工学院

本页由 AI 翻译,技术细节请以原文为准。

README

react-analyzer-mcp

Analyze & generate docs for React code using the Model Context Protocol. Based on react-analyzer library.

What it does

This tool analyzes React component files (JSX/TSX) and extracts information about components and their props.

Available 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

Installation

# 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
npm run build

Using with Claude

  1. Enable MCP server in the Claude Desktop config:
{
    "react-analyzer-mcp": {
      "command": "node",
      "args": [
        "/Users/azer/code/sandbox/react-analyzer-mcp/build/index.js"
      ]
    }
}
  1. Connect Claude to your MCP server using the Claude Shell.

  2. Use the tools directly in Claude conversations:

Analyze my project's React components in the "ui" folder.

Or:

What React components do I have in my project?

Examples

Analyzing a project folder:

Input:

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

Output:

# Components

## Button

### Props

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

License

MIT

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →