Generate a key and connect Codex
Requirements: Node.js 20 or newer, an MCP-capable Codex installation, and an IconSearch account. First generate an API key from your account. IconSearch shows the complete key once and gives you a ready-to-copy setup command.
codex mcp add iconsearch --env ICONSEARCH_TOKEN=YOUR_API_KEY -- npx -y @iconsearch/mcp-server- Sign in on the account page and press Generate API key.
- Copy the complete setup command shown beside the new key and run it in your terminal.
- Restart Codex, then ask it to call
iconsearch_status. - Run
codex mcp listif you need to confirm the server configuration.
Keep the key private. Do not put it in your repository, screenshots, or messages. Codex stores MCP configuration in ~/.codex/config.toml. See the official Codex MCP documentation .
How the system works
The npm package runs locally and tells Codex which icon tools are available.
The private API key identifies your account. It can be revoked from the account page at any time.
Search and exact-icon requests go to the authenticated IconSearch API, where access and daily usage are checked.
Approved SVGs and their semantic names are saved locally so every teammate and agent can reuse them.
Configure another MCP client
Use this standard stdio configuration when your client accepts JSON MCP server settings:
{
"mcpServers": {
"iconsearch": {
"command": "npx",
"args": ["-y", "@iconsearch/mcp-server"],
"env": { "ICONSEARCH_TOKEN": "YOUR_API_KEY" }
}
}
}Replace YOUR_API_KEY with the key shown once on your IconSearch account page. Keep this configuration outside your repository. Set ICONSEARCH_PROJECT_ROOT only if the client starts the server outside your repository. For local development, ICONSEARCH_API_BASE may use a loopback HTTP URL; every non-local endpoint must use HTTPS.
Use the project-aware workflow
- Read
iconsearch_get_project_iconsbefore choosing a new icon. - Reuse an existing semantic assignment when it already represents the requested purpose.
- Search with product intent such as “billing history” instead of guessing a package export.
- Retrieve the exact candidate and review its source and licence requirements.
- Save only after the icon is approved; then audit before shipping.
All ten available tools
iconsearch_start_sign_inStart the secure browser device sign-in flow.
iconsearch_finish_sign_inFinish an approved sign-in and store the revocable local session.
iconsearch_statusCheck the account connection without exposing the token.
iconsearch_sign_outRemove the locally saved IconSearch session.
iconsearch_get_project_iconsRead visual defaults and approved semantic icon assignments.
iconsearch_searchSearch by intent, collection, style, licence safety, and page.
iconsearch_get_iconRetrieve exact sanitized SVG plus source, author, and licence metadata.
iconsearch_save_project_iconSave an approved SVG and update project memory. This changes files.
iconsearch_audit_project_iconsReport missing or changed managed files, inline SVGs, unmanaged assets, and mixed packages.
iconsearch_snippetCreate React, SVG, Vue, Svelte, Tailwind, or URL output for compatible workflows.
Project manifest
The first save creates iconsearch.json and stores sanitized files under .iconsearch/icons. Commit both so teammates and agents share the same decisions.
{
"version": 1,
"style": {
"preferredLibraries": ["lucide"],
"defaultSize": 20,
"color": "currentColor",
"strokeWidth": 2
},
"icons": {}
}Each saved icon records a SHA-256 checksum, original library and name, source attribution, licence metadata, and the time it was approved.
Security model
The save tool writes only the manifest and managed SVG directory inside a validated project root.
Reads, writes, and audits refuse symlink traversal and filesystem-root projects.
Scripts, embedded documents, event handlers, unsafe protocols, and external resources are rejected.
API keys are stored as unreadable fingerprints on the server, expire after 90 days, and can be revoked from your account.
Authentication, plan access, and daily usage are checked before search or SVG retrieval.
The project manifest stores icon decisions and checksums, never your API key.
Review changes produced by any coding agent before committing or deploying them.
Verify that everything is working
npm view @iconsearch/mcp-server version license
codex mcp list- The npm command should report version
0.2.0and licenceMIT. codex mcp listshould include a server namediconsearch.- Ask Codex to call
iconsearch_status; it should reportconnected: truewithout showing your key. - Ask for “billing history.” Search should return relevant candidates such as a receipt or history icon.
- Return to your account page. The key should now say Last used with a recent date.
- In a test repository, approve one icon, save it, and confirm that only
iconsearch.jsonand.iconsearch/iconschanged. - Run
iconsearch_audit_project_iconsand review the report before committing.
Troubleshooting
- The
npxcommand is missing or fails to start. - Install Node.js 20 or newer, reopen the terminal, and run the install command again.
- The server says the Agent API is not configured.
- The production Supabase project is missing the latest agent-usage migration. Apply it, then redeploy the website.
- Search says authentication is required.
- Generate a new API key and copy the complete setup command again. If you revoked or replaced a key, restart Codex after updating the configuration.
- The server cannot find my project.
- Start the MCP client from the repository or set
ICONSEARCH_PROJECT_ROOTto an existing project directory. - An SVG could not be saved.
- The icon may contain active or external content, the semantic name may not be kebab-case, or the destination may already exist.