icons-mcp

v0.1.0
icons-mcp Checked 3 days ago Published 5 months ago

MCP server that serves Tabler SVG icons (search, list, and fetch) over stdio.

An MCP server that serves Tabler SVG icons to any MCP-compatible client (Claude Desktop, Claude Code, Cursor, etc.). It lets an AI assistant search, browse, and fetch ready-to-embed SVG markup for 6,146 icons (5,093 outline + 1,053 filled) — without you having to hunt through an icon library by hand. The icons are compiled at build time into a single bundled index (data/icons.json), so the server starts instantly and every lookup is in-memory. Icons use currentColor and a 0 0 24 24 viewBox — color and size are controlled by CSS at the call site.

Summary extracted from the README.

icons-mcp

An MCP server that serves Tabler SVG icons to any MCP-compatible client (Claude Desktop, Claude Code, Cursor, etc.). It lets an AI assistant search, browse, and fetch ready-to-embed SVG markup for 6,146 icons (5,093 outline + 1,053 filled) — without you having to hunt through an icon library by hand.

The icons are compiled at build time into a single bundled index (data/icons.json), so the server starts instantly and every lookup is in-memory.

Tools

Tool Purpose
search_icons Find icons by name, tag, or category. Returns ranked matches with names, categories, and available styles.
get_icon Fetch the raw <svg> markup for an icon by exact name. Defaults to outline; pass style: "filled" to choose.
list_icons List/paginate icon names, optionally filtered by category and/or style.
list_categories List every category with counts, plus total icon count and available styles.

Icons use currentColor and a 0 0 24 24 viewBox — color and size are controlled by CSS at the call site.

Typical flow

  1. search_icons({ query: "shopping cart" }) → pick a name from the results.
  2. get_icon({ name: "shopping-cart" }) → get the SVG string to drop into your markup.

Install & build

This project uses Yarn (Berry, v4 — pinned via the packageManager field). Enable it with corepack enable if you don't already have Yarn 4.

yarn install
yarn build        # builds the icon index (data/icons.json) + compiles TypeScript to dist/
yarn smoke        # optional: end-to-end test that boots the server and calls every tool

yarn build runs two steps:

  • build:index — parses icons/tabler-icons/{outline,filled}/*.svg into data/icons.json.
  • build:ts — compiles src/*.ts to dist/.

Use it in an MCP client

After building, point your client at the compiled entry (dist/server.js). The server speaks stdio.

Claude Code

claude mcp add icons -- node /absolute/path/to/icons-mcp/dist/server.js

Claude Desktop / Cursor (JSON config)

{
  "mcpServers": {
    "icons": {
      "command": "node",
      "args": ["/absolute/path/to/icons-mcp/dist/server.js"]
    }
  }
}

Once published to a registry you can instead run it without a local checkout:

{
  "mcpServers": {
    "icons": { "command": "npx", "args": ["-y", "icons-mcp"] }
  }
}

Project layout

icons/tabler-icons/{outline,filled}/*.svg   source SVGs (input; not published)
scripts/build-index.mjs                      compiles SVGs + metadata -> data/icons.json
src/icons.ts                                 load / search / list / get logic
src/server.ts                                MCP server (the bin entry)
data/icons.json                              generated bundle (loaded at runtime)
dist/                                         compiled output (the published code)

Only dist/, data/, README.md, NOTICE, and LICENSE are included in the published package (see the files field in package.json). The raw icons/ source and src/ are not shipped — everything the server needs is baked into data/icons.json.

Publishing

The package is configured and ready to publish, but nothing is published automatically. The prepack script runs the full build first (Yarn runs it for both yarn pack and yarn npm publish), so the index and compiled code are always fresh in the tarball.

Preview exactly what would ship:

yarn pack --dry-run       # lists tarball contents without writing or publishing
yarn pack                 # writes package.tgz locally for inspection

Public publish

yarn npm login
yarn npm publish

Private publish

A truly private package on the public npm registry requires a scoped name and a paid npm account/org. To do that:

  1. Rename in package.json to a scope you own, e.g. "name": "@your-scope/icons-mcp".
  2. Add publish config so it stays private:
    "publishConfig": { "access": "restricted" }
    
  3. Publish:
    yarn npm login
    yarn npm publish
    

Alternatively, publish to a private registry (GitHub Packages, Verdaccio, JFrog Artifactory, etc.) by setting publishConfig.registry and authenticating to it. To make the package unpublishable entirely (internal-only), set "private": true in package.json.

License

icons-mcp is MIT licensed. The icon artwork is from Tabler Icons and is MIT licensed separately — see NOTICE.