Get the FREE Ultimate OpenClaw Setup Guide →

mcp -icon

A Model Context Protocol (MCP) server for searching and fetching icons from iconfont.cn.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio liliangshan-mcp-server-icon npx @liangshanli/mcp-server-icon \
  --env LANGUAGE="en" \
  --env WEB_SERVER_AUTO_OPEN="true"

How to use

This MCP server provides a dedicated endpoint to search for icons from iconfont.cn, retrieve detailed icon information, and obtain SVG content. It also includes a built-in cache with commands to view and clear cache statistics. You can run the server directly via NPX or install it locally/global and start it as an MCP server. The available API tools exposed to MCP clients include: search_icons, which queries iconfont.cn with filters like keyword, page, and pageSize; get_cache_stats, which returns current cache usage statistics; and clear_cache, which purges cached icons (with an option to clear only expired entries). Use these tools to integrate icon search and retrieval into your editor, IDE, or application via MCP client's standard JSON-RPC style requests.

How to install

Prerequisites:

  • Node.js installed (preferred LTS version)
  • npm or pnpm

Installation options:

  1. Global installation (recommended for quick use):
npm install -g @liangshanli/mcp-server-icon
  1. Local installation (within a project):
npm install @liangshanli/mcp-server-icon
  1. From source:
git clone https://github.com/liliangshan/mcp-server-icon.git
cd mcp-server-icon
npm install

Usage after installation:

  • Direct run (via global installation):
mcp-server-icon
  • Using npx (recommended):
npx @liangshanli/mcp-server-icon
  • Direct start from source installation:
npm start
  • Development mode:
npm run dev
  • Daemon mode (background):
npm run daemon

Additional notes

Environment variables and configuration options:

  • LANGUAGE: Interface language (en or zh-CN, default en)
  • WEB_SERVER_AUTO_OPEN: Auto-open browser (true or false, default true)
  • MCP_LOG_DIR: Log directory (default: ./logs)
  • MCP_LOG_FILE: Log filename (default: mcp-icon.log)

Tips:

  • The MCP server uses only Node.js built-in features and communicates with MCP clients via JSON-RPC over stdin/stdout when run as an MCP server.
  • If you integrate into editors or tooling, you can configure a local cursor or VS Code MCP settings to point to the server via npx or a local install as shown in the README examples.
  • Ensure you have network access to iconfont.cn for the search and icon retrieval features.
  • When using caching, consider adjusting cache size or eviction policy if you operate at large scale.

Related MCP Servers

Sponsor this space

Reach thousands of developers