React MCP is a server implementation that enables Claude AI to interact with React applications through the Model Context Protocol. It creates a bridge between Claude and the React ecosystem, allowing Claude to create new apps, run development servers, manage files, install packages, and execute terminal commands.
The easiest way to install React MCP for Claude Desktop is automatically via Smithery:
npx -y @smithery/cli install @Streen9/react-mcp --client claude
Alternatively, you can install manually:
npm install
Add this to your claude_desktop_config
:
{
"mcpServers": {
"react-mcp": {
"command": "node",
"args": [
"C:/Users/kalip/OneDrive/Desktop/react-mcp/index.js"
]
}
}
}
The server runs on the stdio transport, allowing it to be used with Desktop Claude app as a Model Context Protocol tool.
The create-react-app
tool creates a new React application:
{
"name": "my-app",
"template": "typescript",
"directory": "/path/to/base/directory"
}
Parameters:
name
(required): Name of the React apptemplate
(optional): Template to use (e.g., typescript, cra-template-pwa)directory
(optional): Base directory to create the app in (defaults to home directory)The run-react-app
tool runs a React application in development mode:
{
"projectPath": "/path/to/react/project"
}
Parameters:
projectPath
(required): Path to the React project folderThe run-command
tool executes terminal commands:
{
"command": "npm list",
"directory": "/path/to/directory"
}
Parameters:
command
(required): Command to executedirectory
(optional): Directory to run the command in (defaults to current directory)The get-process-output
tool retrieves output from a running or completed process:
{
"processId": "process-123"
}
Parameters:
processId
(required): ID of the process to get output fromThe stop-process
tool stops a running process:
{
"processId": "process-123"
}
Parameters:
processId
(required): ID of the process to stopThe list-processes
tool shows all running processes without any parameters.
The edit-file
tool creates or edits a file:
{
"filePath": "/path/to/file.js",
"content": "// Your content here"
}
Parameters:
filePath
(required): Path to the file to editcontent
(required): Content to write to the fileThe read-file
tool reads file contents:
{
"filePath": "/path/to/file.js"
}
Parameters:
filePath
(required): Path to the file to readThe install-package
tool installs npm packages:
{
"packageName": "react-router-dom",
"directory": "/path/to/project",
"dev": false
}
Parameters:
packageName
(required): Name of the package to install (can include version)directory
(optional): Directory of the project (defaults to current directory)dev
(optional): Whether to install as a dev dependencyThe check-installation-status
tool checks the status of a package installation:
{
"processId": "process-123"
}
Parameters:
processId
(required): ID of the installation process to checkThe server maintains detailed logs in the logs
directory:
react-mcp-logs.json
: Structured JSON logsreact-mcp-logs.txt
: Human-readable text logsThere 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.
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"
]
}
}
}
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.
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.