MCP Server
The @react-spectrum/mcp package allows you to run Model Context Protocol (MCP) servers for React Spectrum (S2) and React Aria locally. It exposes a set of tools that MCP clients can discover and call to browse the docs.
Using with an MCP client
Add one or both servers to your MCP client configuration (the exact file and schema may depend on your client).
{
"mcpServers": {
"React Spectrum (S2)": {
"command": "npx",
"args": ["@react-spectrum/mcp", "s2"]
},
"React Aria": {
"command": "npx",
"args": ["@react-spectrum/mcp", "react-aria"]
}
}
}
Cursor
React Spectrum (S2):
React Aria:
Or follow Cursor's MCP install guide and use the standard config above.
VS Code
React Spectrum (S2):
React Aria:
Or follow VS Code's MCP install guide and use the standard config above. You can also add servers using the VS Code CLI:
Claude Code
Use the Claude Code CLI to add the servers:
For more information, see the Claude Code MCP documentation.
Codex
Create or edit the configuration file ~/.codex/config.toml and add:
[mcp_servers.react-spectrum-s2]
command = "npx"
args = ["@react-spectrum/mcp", "s2"]
[mcp_servers.react-aria]
command = "npx"
args = ["@react-spectrum/mcp", "react-aria"]
For more information, see the Codex MCP documentation.
Gemini CLI
Use the Gemini CLI to add the servers:
For more information, see the Gemini CLI MCP documentation.
Windsurf
Follow the Windsurf MCP documentation and use the standard config above.