Sponsored by Deepsite.site

Unofficial Mcp Server For Primereact 10.x

创建者
wisdomrock2 months ago
An unofficial MCP Server for PrimeReact 10.x to fill the gap while we wait for the official one (coming with PrimeReact v11). **What it does:** - Covers 105 PrimeReact v10 components parsed from their TypeScript definitions - Exposes props, types, JSDoc descriptions, and event callbacks - Tools include: `get_component`, `get_component_props`, `search_components`, `suggest_component`, `get_form_components`, `get_data_components`, and more **Why it's useful:** If you use Claude Code, Cursor, or any MCP-compatible AI assistant, you can now get accurate PrimeReact component suggestions and code generation grounded in the actual API — no more hallucinated props.
概览

primereact-mcp

A Model Context Protocol (MCP) server that gives AI assistants full access to PrimeReact v10 component documentation — props, events, examples, and search.

Why does this exist?
The PrimeReact team has not yet published an official @primereact/mcp package. This server fills that gap using the same engine (@primeuix/mcp) that powers the official PrimeNG MCP server, with component data extracted from PrimeReact's TypeScript definitions. The official PrimeReact MCP will be launched with v11.


Features

  • 105 PrimeReact v10 components with full prop/event documentation
  • 15+ MCP tools: search, suggest, inspect props, get examples, compare components, and more
  • Works with Claude Code, Claude Desktop, Cursor, Windsurf, and any MCP-compatible client
  • Generated directly from PrimeReact's TypeScript .d.ts source — no stale hand-written docs

Quick Start

Prerequisites

  • Node.js 18 or later
  • An MCP-compatible AI client (see below)

Option A — npx (no install needed)

Use npx -y primereact-mcp directly in your MCP client config. Component data ships pre-generated inside the package.

Option B — clone and run locally

git clone https://github.com/wisdomrock/primereact-mcp.git
cd primereact-mcp
npm install
node index.mjs   # starts the server

To regenerate component data after a PrimeReact version upgrade:

npm install primereact@10   # install the target version
node generate-data.mjs      # rewrites components-data.json

MCP Client Setup

Claude Code (CLI)

# via npx — zero install
claude mcp add primereact -- npx -y primereact-mcp

# or point at a local clone
claude mcp add primereact -- node /absolute/path/to/primereact-mcp/index.mjs

Or add it to your project's .mcp.json:

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

Claude Desktop

Add the following to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

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

Cursor

Add to .cursor/mcp.json in your project root:

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

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

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

Available Tools

ToolDescription
list_componentsList all 105 PrimeReact components, optionally filtered by category
get_componentGet full details for a component (stats, props preview, sections)
get_component_propsGet all props for a component with types and descriptions
get_component_eventsGet all event callbacks a component supports
get_component_methodsGet component methods (where documented)
get_component_slotsGet slots/render props for a component
get_component_ptGet Pass Through (PT) customization options
get_component_tokensGet design tokens (CSS variables)
get_component_stylesGet CSS class names
get_component_sectionsGet all sections with examples (basic, advanced, etc.)
get_component_importGet the correct import statement
get_component_urlGet the official documentation URL
get_usage_exampleGet code examples for a component
search_componentsSearch components by name or description
find_by_propFind all components that have a specific prop
find_by_eventFind all components that emit a specific event
find_components_with_featureFind components with a feature (e.g. "filter", "lazy", "virtual")
compare_componentsCompare two components side by side
suggest_componentSuggest components based on a use-case description
get_categoriesGet all component categories
get_version_infoGet PrimeReact version and compatibility info
get_form_componentsGet all form input components
get_data_componentsGet all data display components (tables, lists, trees)
get_overlay_componentsGet all overlay/popup components

Example prompts

Which PrimeReact component should I use for a searchable multi-select?

What props does the DataTable component accept?

Find all PrimeReact components that have a filter prop.

Compare the Dropdown and AutoComplete components.

Show me the import statement for the Calendar component.

Upgrading PrimeReact Version

To update the component data after upgrading PrimeReact:

npm install primereact@NEW_VERSION
node generate-data.mjs

The generate-data.mjs script re-reads all .d.ts files and rewrites components-data.json.


Project Structure

primereact-mcp/
├── index.mjs              # MCP server entry point
├── generate-data.mjs      # Generates components-data.json from .d.ts files
├── components-data.json   # Generated component data (committed for convenience)
├── server.json            # MCP Registry metadata
├── package.json
└── README.md

MCP Registry

This server is published to the Official MCP Registry. Registry metadata is in server.json at the repo root.

How it works

  1. generate-data.mjs reads each component's .d.ts file from the primereact npm package, parses JSDoc comments and TypeScript interface definitions using a line-by-line state machine, and writes structured JSON to components-data.json.

  2. index.mjs calls runPrimeMcpServer() from @primeuix/mcp — the same shared engine used by the official PrimeNG MCP server — passing PrimeReact-specific configuration and the generated component data.


Contributing

Contributions welcome! Areas that would benefit from improvement:

  • Richer examples — add JSX code snippets to more component sections
  • PrimeReact v11 support — the alpha v11 uses @primereact/types, requiring a different parsing strategy
  • Pass Through (PT) data — extract PT options from .d.ts files
  • Design tokens — extract CSS variable names

Please open an issue before sending a large PR.


License

MIT — see LICENSE.


服务器配置

{
  "mcpServers": {
    "primereact": {
      "command": "npx",
      "args": [
        "-y",
        "primereact-mcp"
      ]
    }
  }
}
推荐的 MCP Server
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
WindsurfThe new purpose-built IDE to harness magic
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Playwright McpPlaywright MCP server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Tavily Mcp
ChatWiseThe second fastest AI chatbot™
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
DeepChatYour AI Partner on Desktop
Amap Maps高德地图官方 MCP Server
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.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
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"
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Serper MCP ServerA Serper MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
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.
CursorThe AI Code Editor