sf-symbol-mcp

sf-symbol-mcp

Enables coding agents to query real SF Symbol names from the local SF Symbols app on Mac, helping generate valid SwiftUI/UIKit code without guessing.

Category
访问服务器

README

sf-symbol-mcp

Languages: English | 简体中文

sf-symbol-mcp is a local MCP server and CLI that lets coding agents query real SF Symbol names from the SF Symbols app installed on your Mac.

It helps Codex, Claude Code, Cursor, and other MCP clients stop guessing Image(systemName:) values before generating SwiftUI or UIKit code.

Important Legal Note

This is not an Apple project and is not affiliated with Apple.

SF Symbols and the SF Symbols app are Apple resources. This package does not distribute Apple artwork, plist metadata, generated indexes, or a complete symbol database. It reads metadata from the user's locally installed SF Symbols app and writes a local index on that user's machine.

Use SF Symbols for in-app interface icons such as tabs, toolbar buttons, list rows, and status indicators. Do not use SF Symbols directly as App Store icons, launcher icons, logos, brand marks, trademarks, or marketing logos.

Requirements

  • macOS for the official SF Symbols app metadata path
  • Node.js 20 or newer
  • SF Symbols app installed at /Applications/SF Symbols.app, or SF_SYMBOLS_APP_PATH pointing to another .app

The CLI can also build a limited local index from a user-provided names file with --names-file.

Quick Start

npm install -g sf-symbol-mcp
sf-symbol-mcp inspect
sf-symbol-mcp build-index
sf-symbol-mcp search "income trend chart" --platform iOS --min-os 17.0
sf-symbol-mcp serve

From a local checkout:

npm install
npm run build
npm install -g .

By default, the generated index is stored outside the package:

  • macOS: ~/Library/Application Support/sf-symbol-mcp/sf-symbols-index.json
  • Other platforms: ~/.cache/sf-symbol-mcp/sf-symbols-index.json

Override this with:

export SF_SYMBOLS_INDEX_PATH="$HOME/.sf-symbol-mcp/sf-symbols-index.json"

Local Development

npm install
npm run build
npm test
node dist/cli.js inspect
node dist/cli.js build-index
node dist/cli.js serve

Codex Setup

After global install:

codex mcp add sf-symbols -- sf-symbol-mcp serve

From a local checkout:

npm install
npm run build
codex mcp add sf-symbols -- node /absolute/path/to/sf-symbol-mcp/dist/cli.js serve

Add the rules in AGENTS.md to Apple-platform app projects where agents should validate SF Symbols before use.

Claude / Cursor MCP Setup

Use stdio transport with the installed CLI:

{
  "mcpServers": {
    "sf-symbols": {
      "command": "sf-symbol-mcp",
      "args": ["serve"]
    }
  }
}

For a local checkout, use:

{
  "mcpServers": {
    "sf-symbols": {
      "command": "node",
      "args": ["/absolute/path/to/sf-symbol-mcp/dist/cli.js", "serve"]
    }
  }
}

CLI Reference

sf-symbol-mcp inspect
sf-symbol-mcp build-index [--output path] [--names-file path]
sf-symbol-mcp search "calendar work schedule" --platform iOS --min-os 17.0 --limit 10
sf-symbol-mcp get calendar.badge.clock --platform iOS --min-os 17.0
sf-symbol-mcp suggest --intent "premium income trend card" --tone "premium, calm, not financial trading" --platform iOS --min-os 17.0
sf-symbol-mcp validate gearshape.fill fake.symbol --platform iOS --min-os 17.0
sf-symbol-mcp scan ./MyApp
sf-symbol-mcp validate-project ./MyApp --platform iOS --min-os 17.0
sf-symbol-mcp serve

MCP Tools

  • health_check: reports server health, data source, generated index state, and symbol count.
  • search_symbols: searches symbols by name, keyword, category, and lightweight semantic expansion.
  • get_symbol: checks whether an exact symbol exists and returns usage snippets.
  • suggest_symbols: recommends symbols for a product intent and blocks logo/App icon usage.
  • validate_symbols: validates symbol names and target platform compatibility.
  • usage_snippet: generates SwiftUI or UIKit snippets for a symbol.

Environment Variables

  • SF_SYMBOLS_APP_PATH: custom path to SF Symbols.app.
  • SF_SYMBOLS_INDEX_PATH: custom path for the generated local JSON index.

Troubleshooting

SF Symbols.app not found

Install SF Symbols from Apple Developer, or set:

export SF_SYMBOLS_APP_PATH="/path/to/SF Symbols.app"

Index not found

Run:

sf-symbol-mcp build-index

If the default cache directory is not writable, use --output or SF_SYMBOLS_INDEX_PATH.

MCP server prints unexpected output

sf-symbol-mcp serve reserves stdout for MCP protocol messages. Logs and diagnostics must go to stderr. Avoid wrapping the command in scripts that print banners or debug output to stdout.

Availability looks approximate

SF Symbols metadata exposes SF Symbols release versions, not a perfect platform matrix. This project maps release years to likely Apple platform minimum versions as a practical guardrail. Verify edge cases against the SF Symbols app or Apple's documentation.

Publishing Notes

The npm package intentionally excludes local SF Symbols data. Before publishing, check:

npm run build
npm test
npm pack --dry-run

The tarball must not contain SF Symbols Names, data/generated/*, Apple plist files, .DS_Store, editor swap files, or local indexes.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选