
TrueIcon
io.github.manikumarkvPublished by GitHub account manikumarkvv0.6.0Updated Oct 24, 2026
Lets AI coding assistants search the icon packages actually installed in your project.
Overview
A local MCP server that lets an AI coding assistant search the icon packages installed in a project and get real icon names and import lines.
- What you can do
- Search icon packages for icons matching a query, with style, set, provider and result-limit filters, returning ranked matches with ready-to-paste import statements and usage snippets for React, Vue and Svelte packages. Look up a single icon by name or import name to get its full record, including tags, keywords and inner SVG markup. List the project directory in use, how it was found, the icon packages the project uses with resolved versions, and every supported provider. Run a health check.
- When to use it
- Useful when an assistant writes UI code and tends to invent icon names, or picks names from the wrong library or an older release. It fits projects that already depend on supported icon packages such as Lucide, Heroicons, react-icons, MUI, Font Awesome or their Vue and Svelte equivalents, and where exact, version-correct import lines matter.
- Requirements
- Runs locally over stdio; Node.js 20 or newer, typically started with npx. Needs a project directory containing package.json, .iconmcp.json or node_modules, found via MCP roots, the working directory, or TRUEICON_PROJECT_DIR. Network access to the npm registry to download package tarballs. Optional TRUEICON_CACHE sets the cache directory; optional semantic search needs the @huggingface/transformers package and a local model download.
Installation
In SourceWeft
- Open TrueIcon in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
TrueIcon
[npm] [Install in VS Code] [Install in VS Code Insiders] [Install in Cursor]
TrueIcon is an MCP server that gives AI coding assistants exact, version-correct icon references. Your assistant searches the icon packages your project actually uses (lucide-react, react-icons, @heroicons/react, @phosphor-icons/react, @tabler/icons-react, iconoir-react, @fluentui/react-icons, @carbon/icons-react, @ant-design/icons, @mui/icons-material, @radix-ui/react-icons, @remixicon/react, the Font Awesome Free packages, and the Vue and Svelte packages of Lucide, Heroicons, Tabler and Phosphor) and gets back real icon names, import paths and a ready-to-paste import line.
Why
AI assistants often guess icon names. The guess can be an icon that never existed, one renamed a few releases ago, or one from a different library, and you only find out when the build fails. TrueIcon closes that gap:
- It reads which icon packages and versions your project uses.
- It downloads those exact versions from npm and indexes every icon once.
- The assistant calls
search_iconsand gets results that are guaranteed to exist in that version, for exampleimport { Trash2 } from 'lucide-react';.
Supported providers
Vue and Svelte
These index the same artwork as the React packages above, with each package's own component names and import paths.
Heroicons has no official Svelte package. Angular packages aren't supported yet.
Tools accept either the provider id or the npm package name ("lucide" or "lucide-react"). Usage snippets are import lines, which work the same way in React, Vue and Svelte. Phosphor weights all share one component, so pass the record's style as the weight prop (e.g. <TrashIcon weight="bold" />); the usage snippet only shows the import. Font Awesome imports are icon definitions, not components: render them with @fortawesome/react-fontawesome, e.g. <FontAwesomeIcon icon={faTrashCan} />.
Install
TrueIcon needs Node.js 20 or newer.
trueicon is a stdio MCP server. Your MCP client starts it; running it by hand only prints trueicon: v<version> running on stdio to stderr and waits for JSON-RPC on stdin.
Quick start
- Register TrueIcon with your MCP client (Claude Code, Claude Desktop, or VS Code and Cursor).
- Ask your assistant for an icon.
That's it for most projects. TrueIcon finds the icon packages your package.json lists and the versions installed in node_modules. The first search for each package downloads and indexes it, which takes a few seconds. Later searches use the local cache.
Configuration
Which icon packages are searched
- By default, every supported package listed in
dependenciesordevDependenciesof yourpackage.json. - With
.iconmcp.jsonin the project, exactly the packages it lists. Use it to search only some of your icon packages, to add one yourpackage.jsondoesn't list (for example one that comes in through a UI kit), or to pin a version.
- Unsupported packages in
.iconmcp.jsonare skipped, andsearch_iconsreports them as a warning. - Invalid JSON or a malformed entry makes the tools return an error that names the file and the bad field.
- If neither file names a supported package,
search_iconsreturns an error that says which directory it looked in. You can still passproviderto a tool call.
Semantic search (opt-in)
Set "semantic": true in .iconmcp.json to add meaning-based ranking to search_icons. Each query is embedded with a small local model (all-MiniLM-L6-v2, ~90MB downloaded once to the transformers.js cache) and matched against per-icon vectors built at index time; those semantic candidates are merged with the keyword results using reciprocal rank fusion, so exact-name matches still win while conceptual queries like "remove background" can surface eraser.
Semantic search runs on @huggingface/transformers, which is an optional peer dependency and is not installed by default, so installs that never enable the flag stay lean. To enable semantic search, install it once (about 400MB) alongside trueicon:
If the flag is on but the package is missing, search_icons and get_icon fall back to keyword-only indexes and return a one-line warning with the install command.
Toggling the flag rebuilds the indexes once (vectors are stored in index.json alongside each record, and meta.json records the embedding model). It stays fully local: no data leaves your machine. TRUEICON_SEMANTIC=1 (or 0) overrides the flag for one-off runs.
Which directory is the project
TrueIcon reads package.json, .iconmcp.json and node_modules from the project directory. It picks the first of:
$TRUEICON_PROJECT_DIR, when set.- A folder your MCP client shares with the server (MCP roots) that contains a
package.jsonor.iconmcp.json. Clients that support roots, like VS Code, tell TrueIcon which folders you're working in, so it follows your open project without any setup. - The server's working directory, when it contains one of those files. Claude Code starts servers in your project, so this is how it finds it.
- The first shared folder, else the working directory.
list_providers shows the directory in use and which rule picked it, so you can check what your client does.
Environment variables
Versions
Auto-detection
A provider's version is resolved in this order:
- The
versionargument passed to the tool call, if any. - The provider's
versionin.iconmcp.json. - The version installed in
node_modules, looking in the project directory and then each parent directory, so packages hoisted to a monorepo root are found. - The version range declared for the package in the project's
package.json, checkingdependenciesfirst and thendevDependencies.
If none of these is available, the tool asks you to pin the version or add the package to package.json. TrueIcon doesn't read your lockfile, and it downloads its own copy of the package from npm rather than using the files in node_modules. For a range, it indexes the range's base version: ^0.460.0 indexes [email protected]. For a || b ranges, only the first part counts. Before you run npm install, that base version can be older than what you'll get, so pin it in .iconmcp.json if the exact version matters.
Version policy
Indexes are keyed by major.minor:
- Patch versions are ignored. One index serves all of
0.460.x. The index built from0.460.0answers requests for0.460.3. - A minor change gets its own index. Bumping
lucide-reactfrom0.460to0.461builds a fresh index on the next search, with no manual step. - Majors are strict. A different major is always a separate index and is never served from another major's index.
- Cached indexes rebuild automatically when the bundled
synonyms.jsonchanges (detected by hash) or the index format changes.
Using it with Claude
Claude Code
Add TrueIcon from your project directory:
Or commit a .mcp.json at the project root to share it with your team:
Claude Code starts the server in your project directory, so it finds your package.json there with no setup. If it runs from somewhere else, add "env": { "TRUEICON_PROJECT_DIR": "/absolute/path/to/project" }.
Claude Desktop
Claude Desktop doesn't start servers in your project directory, so set TRUEICON_PROJECT_DIR. If your version of Claude Desktop shares folders with servers, TrueIcon uses those instead; list_providers shows which directory it picked. Edit claude_desktop_config.json: ~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows.
Restart Claude Desktop after editing the file.
Using it in VS Code and Cursor
Use the install badges at the top of this README. They add TrueIcon with TRUEICON_PROJECT_DIR set to ${workspaceFolder}, so it searches the project you have open.
To add it by hand in VS Code, create .vscode/mcp.json in your project:
In Cursor, use the same entry under "mcpServers" in .cursor/mcp.json.
Tools
Every tool returns a single JSON text block. On failure, the block is {"error": "..."} and the MCP result is flagged with isError: true.
search_icons
Searches the index and returns ranked matches with import statements.
Example call:
Response:
How search works:
-
provider,styleandsetare exact, case-insensitive filters. They are applied before ranking. -
Candidates come from Fuse.js fuzzy matching over the icon name, import name, keywords and tags. Small typos are tolerated:
"detele"findsDelete. -
Icons whose name answers the query rank first, compared on the name without its style suffix (
delete-bin-line→delete-bin):- the name is the query:
deletefindsdelete,delete-outlined,DeleteRegular - the name starts with the query:
delete-bin-line - the query is a phrase inside the name:
"arrow right"findscircle-arrow-right - every query word is in the name, a synonym or a tag:
trashfindsrestore-from-trash, anddeletethrough the trash → delete synonym
Within a level, shorter names come first, so the plain icon beats composites (
deletebeforerestore-from-trash), and each icon's styles stay together with the default style first. Variant numbers are ignored unless the query has one, sotrashrankstrashthentrash-2. Everything else, such as typos, follows the fuzzy score. - the name is the query:
-
scoreruns from0(perfect) to1, so lower is better. It encodes the ranking above, so results from several providers are merged and sorted by score without losing it. -
Multi-word queries are tokenized: each word is matched on its own, only icons that match every word are kept, and they are ranked by their average score. So
"trash can"findstrash-canicons. Short keyword queries ("trash","settings","beer") still cast the widest net. -
If one provider fails, for example because its version can't be resolved or the download fails, its results are skipped and a
warningsarray explains why. The other providers still return results.
list_providers
Takes no arguments. Returns the project directory TrueIcon reads and how it was found, the providers the project uses with their resolved versions, and every provider TrueIcon supports.
project.sourceis"TRUEICON_PROJECT_DIR","roots"(a folder your MCP client shared) or"cwd"(the server's working directory). See Which directory is the project.providersFromis"iconmcp.json","package.json", ornullwhen neither names a supported package.- Each provider's
sourcesays where its version came from:"iconmcp.json","node_modules"or"package.json".versionandsourcearenullwhen none provides a version.idisnullfor a package in.iconmcp.jsonthat TrueIcon doesn't support.
get_icon
Gets the full record and import statement for an icon whose name the assistant already knows.
Example call:
Response:
svg is the icon's inner SVG markup, meaning the children of the root <svg> element. Heroicons uses the same import name in every size and style (TrashIcon). Pass the full variant name, such as "trash-24-outline", to get a specific one.
ping
A health check that returns {"status":"ok","server":"trueicon"}.
Indexing and caching
The first time a tool needs [email protected], TrueIcon does the following:
- It downloads the package tarball from
https://registry.npmjs.org, verifies its sha512 integrity, and extracts it into the cache. - It parses the package's shipped files with the provider's adapter. Nothing is executed. Icons are read from the compiled source.
- It writes
index.json(one record per icon) andmeta.json(exact version, synonyms hash, index format, build time).
Later calls only read index.json. Package files are never touched at query time. From your node_modules, TrueIcon only reads each icon package's package.json to get the installed version, and it never modifies anything there. If several tool calls need the same index at once, they share one download.
The cache root is ~/.trueicon/cache, or $TRUEICON_CACHE if set:
- Downloads go to
<package>@<major.minor>, where scoped names are flattened:@heroicons/reactbecomesheroicons-react. A.download-completemarker is written last, and a directory without it is treated as partial and replaced. - Indexes go to
<package>@<major.minor>/index.jsonandmeta.json. For unscoped packages this is the same directory as the download. - The cache is safe to delete. It is rebuilt on demand, which needs network access.
Each record's keywords combine the name parts, the tags, and synonym expansions from the bundled synonyms.json. The expansions are added at index time, so "bin" finds Trash2 without any extra work at query time.
Contributing
CI runs lint, typecheck and tests on Node 20 and 22 for every push and pull request.
In Claude Code on the web, a SessionStart hook (.claude/hooks/session-start.sh) installs the dependencies when a session starts, so these commands work straight away. It installs with --ignore-scripts because the sandbox blocks the native download in the optional semantic-search dependency; the semantic tests that need it are skipped there.
Tests
The fixtures only change when someone edits them, so they can't catch a provider that changes its package format upstream. npm run smoke does. Run npm run smoke -- lucide tabler to check only some providers. CI runs it on pull requests that change src/providers/, src/indexer/ or src/cache/, and every Monday against the latest releases.
Testing and debugging locally
These scripts build the server and run it against playground/, a sample project that lists all 24 providers at their latest versions. They use a separate cache in .cache/dev/, so your real ~/.trueicon cache is untouched.
- Arguments are
key=valuepairs. Numbers and booleans are parsed, solimit=5is sent as a number. - Another project: set
TRUEICON_PROJECT_DIRto test against itspackage.jsonand.iconmcp.json, e.g.TRUEICON_PROJECT_DIR=~/code/my-app npm run dev:inspect. - Rebuild indexes: add
--freshto delete the dev cache first, e.g.npm run dev:call -- --fresh search_icons query=trash. Use it after changing an adapter. - Breakpoints: run
npm run dev:debug, then in VS Code use Debug: Attach to Node Process, or openchrome://inspectin Chrome. Source maps are on, so breakpoints work in the.tsfiles undersrc/. Set them, then call a tool from the Inspector. - Logging: stdout carries the MCP protocol, so log with
console.error. It shows in the terminal fordev:calland in the Inspector's server log fordev:inspect. - Manual test prompts:
playground/TEST-PROMPTS.mdis a checklist of prompts to run in an MCP client against the playground, with the expected tool calls and results. It covers every tool, all 15 providers, ranking, configuration errors and semantic search. Run it before a release.
Extending synonyms.json
src/synonyms/synonyms.json maps a term to extra search terms:
- Keys are matched against an icon's name parts (the name split on
-) and its tags.trash-2matches the keytrash. - Values are added to that icon's
keywords. - Expansion is one-way. If
binshould also find icons nameddelete, add both"trash": ["bin"]and"delete": ["bin"], or add a reverse entry. - Write keys and values in lowercase, and give every key a non-empty array of strings.
tests/synonyms.test.tschecks this. - Changing the file changes its hash, so cached indexes rebuild automatically on the next search.
Adding a provider
- Register it in
src/providers/registry.tswith a stableid, the npmpackageand a shortdescription. - Write an adapter in
src/providers/adapters/<provider>.tsthat exportsparseIcons(packageDir: string): RawIcon[](seesrc/providers/adapter.ts). It gets the extracted package directory and returns oneRawIconper icon:name: kebab-case and unique within the package, because it becomes part of the record id. UsetoKebabCasefromadapter.ts. If the package has variants with clashing component names, add the variant to the name, as the heroicons, react-icons, phosphor and iconoir adapters do.importNameandimportPath: the exact export and module specifier a user would import.svg: the inner SVG markup.LiteralCursor(src/providers/jsLiteral.ts) parses JS object and array literals without executing code.toSvgAttrsandrenderSvg(src/providers/svg.ts) turn React props into SVG markup, andparseCreateElementreads compiledcreateElement(...)trees.- Optional
style,set,categoriesandtags. - Put a comment at the top of the adapter describing the package's file layout, as the existing adapters do.
- Wire it up in
src/providers/adapters/index.tsby adding it toADAPTERSunder the provider id. - Test it. Add a small pinned fixture under
tests/fixtures/<provider>/that mirrors the package layout, with a few real icon files plus any files the adapter must skip. Then addtests/adapters/<provider>.test.ts, covering name mapping, import paths, SVG output andbuildIndexrecord ids like the existing adapter tests.tests/adapters/common.test.tsfails if a registered provider has no adapter. - Add it to the tool tests by adding a case to
CASESintests/providers-tools.test.ts: the fixture, a search query, one icon with its exact import line, and a deprecated alias if the package has them. The test fails if a registered provider has no case. - Add smoke targets to
TARGETSinscripts/smoke.mjs: a few well-known import names and a minimum icon count well below the real one. Then runnpm run smoke -- <provider>to check it against the real published package.
License
MIT © 2026 manikumarkv
Source: README.md at commit d06a82f
Tools
0Version history
5- v0.6.0LatestOct 1, 2026
- v0.5.0Sep 29, 2026
- v0.4.0Sep 26, 2026
- v0.3.1Sep 24, 2026
- v0.1.1Sep 23, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts