Skip to main content
Glama
hustcc

mcp-icon

by hustcc
README.md
<div align="center">

# ๐ŸŽจ mcp-icon

**A Model Context Protocol (MCP) server for semantic SVG icon search.**

Generate infographic SVG icons by keyword โ€” over **100,000 icons** with semantic search support, powered by [AntV Infographic](https://infographic.antv.vision/icon).

[![npm version](https://img.shields.io/npm/v/mcp-icon.svg)](https://www.npmjs.com/package/mcp-icon)
[![Build](https://github.com/hustcc/mcp-icon/actions/workflows/build.yml/badge.svg)](https://github.com/hustcc/mcp-icon/actions/workflows/build.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

</div>

---

## ๐Ÿ“‹ Table of Contents

- [โœจ Features](#-features)
- [๐Ÿค– Usage](#-usage)
- [๐Ÿšฐ Transport Modes](#-transport-modes)
- [๐ŸŽฎ CLI Options](#-cli-options)
- [๐Ÿ”จ Development](#-development)
- [๐Ÿ“„ License](#-license)

---

## โœจ Features

- ๐Ÿ” **Semantic search** โ€” Find icons by meaning, not just exact names
- ๐Ÿ–ผ๏ธ **100,000+ SVG icons** โ€” A massive library of high-quality infographic icons
- โšก **Three transport modes** โ€” `stdio`, `sse`, and `streamable-http`
- ๐Ÿชถ **Minimal dependencies** โ€” Clean, focused implementation
- ๐Ÿงช **Fully tested** โ€” Unit tests with Vitest

### Available Tool

| Tool | Description |
|------|-------------|
| `search_icons` | Search for SVG icons by keyword. Returns a list of SVG URLs matching the semantic query. |

**`search_icons` parameters:**

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `keyword` | string | โœ… | โ€” | Search keyword or phrase (e.g. `"data analysis"`, `"cloud"`) |
| `topK` | number | โŒ | `3` | Number of icons to return (1โ€“20) |

---

## ๐Ÿค– Usage

Add to your MCP client configuration (e.g. Claude Desktop, VS Code, Cursor):

**macOS / Linux:**

```json
{
  "mcpServers": {
    "mcp-icon": {
      "command": "npx",
      "args": ["-y", "mcp-icon"]
    }
  }
}
```

**Windows:**

```json
{
  "mcpServers": {
    "mcp-icon": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "mcp-icon"]
    }
  }
}
```

---

## ๐Ÿšฐ Transport Modes

`mcp-icon` supports three standard MCP transport protocols.

### stdio (default)

Used by desktop MCP clients (Claude Desktop, Cursor, etc.):

```bash
npx mcp-icon
# or explicitly:
npx mcp-icon --transport stdio
```

### SSE (Server-Sent Events)

```bash
npx mcp-icon --transport sse --port 3456
# Server available at: http://localhost:3456/sse
```

### Streamable HTTP

```bash
npx mcp-icon --transport streamable --port 3456
# Server available at: http://localhost:3456/mcp
```

---

## ๐ŸŽฎ CLI Options

```
mcp-icon CLI

Options:
  --transport, -t  Transport protocol: "stdio", "sse", or "streamable" (default: "stdio")
  --host, -h       Host for SSE or streamable transport (default: localhost)
  --port, -p       Port for SSE or streamable transport (default: 3456)
  --endpoint, -e   Endpoint path:
                   - For SSE: default is "/sse"
                   - For streamable: default is "/mcp"
  --help, -H       Show this help message
```

---

## ๐Ÿ”จ Development

```bash
# Clone the repository
git clone https://github.com/hustcc/mcp-icon.git
cd mcp-icon

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Start with MCP inspector (for local debugging)
npm start
```

### Project Structure

```
src/
โ”œโ”€โ”€ index.ts          # CLI entry point
โ”œโ”€โ”€ server.ts         # MCP server + tool handlers
โ”œโ”€โ”€ services/
โ”‚   โ”œโ”€โ”€ stdio.ts      # Stdio transport
โ”‚   โ”œโ”€โ”€ sse.ts        # SSE transport
โ”‚   โ””โ”€โ”€ streamable.ts # Streamable HTTP transport
โ”œโ”€โ”€ tools/
โ”‚   โ””โ”€โ”€ search-icons.ts  # Tool definition
โ””โ”€โ”€ utils/
    โ”œโ”€โ”€ api.ts        # Icon search API client
    โ””โ”€โ”€ logger.ts     # Logger utility
tests/
โ”œโ”€โ”€ api.test.ts       # API client unit tests
โ””โ”€โ”€ server.test.ts    # MCP server integration tests
```

---

## ๐Ÿ“„ License

MIT ยฉ [hustcc](https://github.com/hustcc)

TDQS

A4.1/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of confusion or overlap between tools. The single tool's purpose is clear and unambiguous.

Naming Consistency5/5

The tool name 'search_icons' follows a clear verb_noun pattern, which is consistent and predictable. There are no other tools to compare against, so consistency is perfect.

Tool Count2/5

A single tool for an icon server is too few. The server name implies a broader scope, and one tool feels insufficient for handling icon-related operations beyond searching.

Completeness2/5

The tool surface is severely incomplete for an icon service. Only search is offered; there are no tools for retrieving specific icons, listing categories, or managing icons, leaving significant gaps.

Maintenance

ActivityInactive
ResponsivenessNo issues