spm-search-mcp

spm-search-mcp

An MCP server that allows coding agents to search the Swift Package Index and retrieve GitHub READMEs without requiring an API key. It features comprehensive search filters for stars, platforms, and licenses, providing token-efficient responses optimized for LLM comprehension.

Category
访问服务器

README

spm-search-mcp

ci Python 3.14+

An MCP server that lets coding agents search the Swift Package Index. No API key required.

Built with FastMCP and designed using arcade patterns for optimal agent comprehension.

Quick install

The fastest way to add this server to your MCP client:

# Claude Desktop
uvx fastmcp install claude-desktop spm_search_mcp/server.py:mcp -n "Swift Package Index"

# Claude Code
uvx fastmcp install claude-code spm_search_mcp/server.py:mcp -n "Swift Package Index"

# Cursor
uvx fastmcp install cursor spm_search_mcp/server.py:mcp -n "Swift Package Index"

# Any client — get the JSON snippet to paste
uvx fastmcp install mcp-json spm_search_mcp/server.py:mcp -n "Swift Package Index"

Manual MCP client configuration

Published package (once on PyPI)

{
  "mcpServers": {
    "spm-search": {
      "command": "uvx",
      "args": ["spm-search-mcp"]
    }
  }
}

From source (development)

{
  "mcpServers": {
    "spm-search": {
      "command": "uv",
      "args": [
        "run",
        "--with", "fastmcp",
        "--with-editable", "/path/to/spm-search",
        "fastmcp", "run",
        "/path/to/spm-search/src/spm_search_mcp/server.py:mcp"
      ]
    }
  }
}

Tools

search_swift_packages

Search for Swift packages by keyword, author, stars, platform, license, and more. All of SPI's filter syntax is exposed as typed parameters — agents never need to learn the DSL.

Parameter Type Description
query str Free-text search (e.g. "networking", "json parsing")
author str Repository owner (e.g. "apple", "vapor")
keyword str Package keyword tag (e.g. "server", "ui")
min_stars int Minimum GitHub star count
max_stars int Maximum GitHub star count
platforms list Compatible platforms: ios, macos, watchos, tvos, visionos, linux
license_filter str "compatible" for App Store, or SPDX ID like "mit", "apache-2.0"
last_activity_after str ISO8601 date — only active packages (e.g. "2024-01-01")
last_commit_after str ISO8601 date — only recently committed packages
product_type str library, executable, plugin, or macro
page int Page number for pagination (default 1)

All parameters are optional. At least one must be provided. Parameters combine with AND logic.

get_package_readme

Fetch a package's README from GitHub. Returns truncated content by default (4000 chars) to save tokens.

Parameter Type Description
owner str GitHub repository owner (e.g. "Alamofire")
repo str GitHub repository name (e.g. "Alamofire")
max_length int Max chars to return (default 4000). Set to 0 for full content.

Example usage

Once connected, an agent can:

# Search for networking libraries with 500+ stars
search_swift_packages(query="networking", min_stars=500)

# Find iOS-compatible packages
search_swift_packages(platforms=["ios"], min_stars=100)

# Browse a specific author's packages
search_swift_packages(author="apple")

# Read a package's README
get_package_readme(owner="Alamofire", repo="Alamofire")

# Get full README (no truncation)
get_package_readme(owner="apple", repo="swift-nio", max_length=0)

Error handling

All errors return structured, actionable messages instead of raw exceptions:

  • RETRYABLE — transient failures (timeouts, rate limits, server errors). The agent can retry.
  • PERMANENT — the request itself is wrong (404, 403). The agent should change its approach.

Every error message tells the agent what happened, why, and how to fix it.

Design

This server implements these arcade patterns:

  • QUERY_TOOL — both tools are read-only, safe to retry
  • CONSTRAINED_INPUT — enums for platforms and product types
  • SMART_DEFAULTS — all parameters optional with sensible defaults
  • NEXT_ACTION_HINT — every response suggests what to do next
  • GUI_URL — every result includes SPI + GitHub URLs
  • TOKEN_EFFICIENT_RESPONSE — truncated README with opt-in full
  • PAGINATED_RESULThas_more flag with page navigation
  • ERROR_CLASSIFICATION — RETRYABLE vs PERMANENT error tagging
  • RECOVERY_GUIDE — actionable error messages with fix instructions
  • PROGRESSIVE_DETAILmax_length=0 for full README content

Development

uv sync                  # install dependencies
uv run pytest            # run tests (62 tests)
uv run poe test-cov      # run with coverage (90%+ required)
uv run ruff check .      # lint
uv run ty check .        # type check
prek run --all-files     # run all pre-commit hooks

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选