Heroicons MCP provides a Model Context Protocol (MCP) server that exposes Heroicons icon library as resources and tools for Large Language Models (LLMs) and agentic applications. It allows AI assistants to search, retrieve, and provide usage examples for icons from the Heroicons collection, making it easier to incorporate these icons into web development projects.
git clone https://github.com/SeeYangZhi/heroicons-mcp.git
cd heroicons-mcp
Follow the Bun installation guide, then verify installation:
bun --version
bun install
bun run build
You can run the server in two modes: HTTP or stdio.
Install and run globally:
npm install -g heroicons-mcp
heroicons-mcp
Or use npx without installing:
npx heroicons-mcp
The server runs on port 3000 by default.
This mode is used for direct integration with tools like Claude Desktop:
npx heroicons-mcp --stdio
Or if installed globally:
heroicons-mcp --stdio
Run in HTTP mode during development:
bun run start
# or
bun run src/entry.ts
Run in stdio mode during development:
bun run src/entry.ts --stdio
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"heroicons": {
"command": "npx",
"args": ["heroicons-mcp", "--stdio"]
}
}
}
Alternatively, point directly to the build output:
{
"mcpServers": {
"heroicons": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/heroicons-mcp/build/entry.js", "--stdio"]
}
}
}
The server exposes these tools for AI assistants:
Lists all available Heroicons, optionally filtered by style.
style
(optional: "outline" | "solid")Searches for Heroicons by name or keywords.
query
(string)style
(optional: "outline" | "solid")Retrieves JSX example usage for a specific icon.
name
(string)style
(string: "outline" | "solid")Here's a typical interaction flow:
search_icons
with parameters:
query
: "user"style
: "solid"UserIcon
, UserCircleIcon
, etc.get_icon_usage_examples
with:
name
: "UserIcon"style
: "solid"import { UserIcon } from "@heroicons/react/24/solid";
function Example() {
return (
<div>
<UserIcon className="w-6 h-6 text-blue-500" />
</div>
);
}
Test the server in stdio mode using the MCP Inspector:
bun run build
npx @modelcontextprotocol/inspector node ./build/entry.js --stdio
This opens an interface where you can test the server's resources and tools interactively.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "heroicons" '{"command":"npx","args":["heroicons-mcp","--stdio"]}'
See the official Claude Code MCP documentation for more details.
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.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"heroicons": {
"command": "npx",
"args": [
"heroicons-mcp",
"--stdio"
]
}
}
}
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"heroicons": {
"command": "npx",
"args": [
"heroicons-mcp",
"--stdio"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect