@liangshanli/mcp-server-iconfont
v1.0.1
Published
Minimal MCP server: search iconfont.cn by a keyword and return SVG list
Downloads
40
Maintainers
Readme
MCP Iconfont Server
A minimal MCP server that searches iconfont.cn by a single keyword and returns the matching icons together with their SVG markup. Designed to be easy for an AI model to call: one keyword in, a small paginated list of SVGs out.
Version History
v1.0.1 (Latest)
- ✅ Pagination: Fixed page size of 10 icons per page; use the
pageparameter to fetch more - ✅ Richer Result: Response now includes
page,pageSize,total,totalPages,count - ✅ Docs: Installation and editor-integration guide
v1.0.0
- ✅ Initial release
- ✅ Single
search_iconstool - ✅ SVG markup returned per icon
Features
- ✅ Single-keyword icon search against iconfont.cn
- ✅ Returns ready-to-use SVG markup for each icon
- ✅ Fixed page size (10 per page) for fast model selection
- ✅ Pagination metadata (
total,totalPages,page) - ✅ Zero runtime dependencies (uses Node.js built-in
fetch) - ✅ Stdio JSON-RPC transport, works with any MCP client
Requirements
- Node.js >= 18 (uses the built-in
fetchAPI)
Installation
Global Installation (Recommended)
npm install -g @liangshanli/mcp-server-iconfontLocal Installation
npm install @liangshanli/mcp-server-iconfontFrom Source
git clone https://github.com/liliangshan/mcp-server-iconfont.git
cd mcp-server-iconfont
npm installUsage
1. Direct Run (Global Installation)
mcp-server-iconfont2. Using npx (Recommended)
npx @liangshanli/mcp-server-iconfont3. Direct Start (Source Installation)
npm startEditor Integration
Cursor Editor Configuration
Create a .cursor/mcp.json file in your project root:
{
"mcpServers": {
"iconfont": {
"command": "npx",
"args": ["@liangshanli/mcp-server-iconfont"]
}
}
}VS Code Configuration
Create a .vscode/mcp.json file (or add to your MCP client config):
{
"mcpServers": {
"iconfont": {
"command": "npx",
"args": ["@liangshanli/mcp-server-iconfont"]
}
}
}Claude Code / Generic MCP Client
{
"mcpServers": {
"iconfont": {
"command": "npx",
"args": ["@liangshanli/mcp-server-iconfont"]
}
}
}Tools
search_icons
Search icons from iconfont.cn by a single keyword. Returns 10 icons per page
with their SVG markup; use the page parameter to fetch more.
| Param | Type | Required | Default | Description |
| --------- | ------ | -------- | ------- | ------------------------------------------------------- |
| keyword | string | yes | — | Single keyword to search iconfont.cn against. |
| page | number | no | 1 | Page number, starting from 1. Always 10 icons per page. |
Returns JSON text:
{
"page": 1,
"pageSize": 10,
"total": 17131,
"totalPages": 1714,
"count": 10,
"icons": [
{ "id": 123, "name": "home-2", "svg": "<svg ...>...</svg>" }
]
}| Field | Description |
| ------------ | ------------------------------------------------ |
| page | Current page number. |
| pageSize | Icons per page (fixed at 10). |
| total | Total number of matching icons on iconfont.cn. |
| totalPages | Total number of pages (ceil(total / 10)). |
| count | Number of icons actually returned on this page. |
| icons | Array of { id, name, svg } objects. |
How It Works
- The client calls the
search_iconstool with akeyword(and optionalpage). - The server POSTs the query to the iconfont.cn search API.
- Each returned icon's
show_svg(fallbackicon) field is extracted as SVG. - The server replies with a paginated list of
{ id, name, svg }objects.
Environment Variables
| Variable | Default | Description |
| --------------------- | ------- | --------------------- |
| ICON_SEARCH_TIMEOUT | 30000 | Request timeout (ms). |
Project Structure
mcp-server-iconfont/
├── bin/
│ └── cli.js # CLI entry point
├── src/
│ └── server.js # MCP server (stdio JSON-RPC)
├── package.json
└── README.mdLicense
MIT © liliangshan
