Skip to main content
Glama
skill-retrieval-mcp

skill-retrieval-mcp

by JayCheng113

skill-retrieval-mcp

PyPI Python License CI

对 374 个经过许可证审核的代理技能语料库进行语义搜索,通过 MCP 提供给您的编码代理。本地运行,毫秒级响应,零 API 调用。

适用于 Claude Code、Codex CLI、Gemini CLI、Cursor、OpenClaw、Hermes 以及任何兼容 MCP 的代理。

You: "Deploy this service to GKE"

─── Step 1: the agent searches ───────────────────────────────────────

Agent: search_skills("deploy a containerised service on kubernetes")   ← 6ms
     → 5 results (summaries only, no full instructions):
       1. "gke-service-networking"   (0.56) - Gateway API, Ingress, Cloud Armor, NEGs, managed SSL
       2. "gke-workload-scaling"     (0.51) - HPA and VPA for GKE workloads
       3. "gke-manifest-generation"  (0.51) - Production-ready Kubernetes YAML for Autopilot/Standard
       4. "gke-app-onboarding"       (0.46) - Containerizing and deploying an app to GKE for the first time
       5. "gke-basics"               (0.44) - Cluster provisioning, credentials, Autopilot vs Standard

─── Step 2: it reads the descriptions and picks #4, not #1 ───────────

Agent: get_skill("gke-app-onboarding")
     → gets the full guide: containerization, manifests, migration path
     → writes the Dockerfile and deployment.yaml

─── Step 3: a new need emerges mid-task ──────────────────────────────

Agent: # the service has to survive traffic spikes — search again
       search_skills("autoscale pods on cpu and memory")               ← 6ms
     → "gke-workload-scaling" (0.61) - Horizontal and Vertical Pod Autoscaler for GKE
     → reads the guide, adds the HPA manifest

这两次搜索都是所提供语料库的真实输出,而非示例。其中有三点体现了整个设计:

  • 搜索返回摘要,而非指令。 五条摘要只需几百个 token;代理实际读取的那一个技能大约需要 2,400 个 token。

  • 排名第一的结果并不总是正确的。 代理选择了第 4 条,因为其描述中写着 首次 —— 这是任何排序算法都无法做出的判断。这就是为什么搜索返回的是描述,而不是直接注入获胜者。

  • 代理会随着任务的发展再次搜索。 用户请求中既没有出现 "autoscale",也没有出现 "pods"。

安装

pip install "skill-retrieval-mcp[local,hf]"
skill-mcp pull --include-index      # corpus + pre-built vector index
skill-mcp init                      # detect and register with your agents

大约两分钟,主要是下载。init 会找到您已安装的代理并为其写入配置。

init 会自行写入 .mcp.json、~/.gemini/settings.json、.cursor/mcp.json 和 ~/.codex/config.toml。对于 OpenClaw 和 Hermes,它会调用它们自己的 mcp add,因为这两者都将 MCP 服务器保存在一个更大的手编辑配置中,在此处重新序列化会丢失您的注释。DeepSeek Harness 没有 mcp add,因此 init 会打印出供您粘贴的行。

如果它遗漏了您的代理,请自行注册此条目:

{
  "mcpServers": {
    "skill-retrieval": {
      "command": "/absolute/path/to/skill-mcp",
      "args": ["--data-dir", "/absolute/path/to/data-dir", "serve"]
    }
  }
}

有两个细节至关重要,如果缩短它们,都会静默失败:

  • command 必须是绝对路径,而不是 skill-mcp。代理会从会话中自行解析名称,而该会话的 PATH 通常从未包含您安装到的 venv 或 pipx 目录。which skill-mcp 会给出该值。

  • --data-dir 必须完整写出,并且必须放在 serve 之前。 ~ 会在代理启动服务器的任何环境中被重新解析,而记录您选择的配置位于所选目录 内部,因此没有其他方法可以恢复它。在错误目录上打开的服务器会干净地启动,列出其工具,并对每次搜索都返回空结果。skill-mcp status 会打印出要使用的已解析目录。

Related MCP server: skill-curator-mcp

为什么搜索而不是安装

手动安装技能在规模不大时是可行的,但无法扩展:

  • 您不知道存在什么。 您安装了恰好找到的十个。其他一切,代理只能猜测。

  • 您无法安装无法命名的东西。 任务中途,代理需要一个“基于 OIDC 的 PyPI 发布”技能——您永远不会想到要添加它。

  • 技能库无法放入提示词中。 即使采用懒加载,每个技能的名称和描述仍会呈现在模型面前:对于这个语料库,在读取任何一个技能之前就有 37K 个 token。指令还有 960K。

手动安装

skill-retrieval-mcp

规模

几十个,如果您勤勉的话

374 个,来自 8 个上游仓库

发现

您找到并安装每一个

代理按需搜索

选择

您提前挑选

代理按任务挑选

匹配

基于描述的名称匹配

语义,毫秒级,本地 FAISS

来源

您碰巧克隆的任何内容

每个技能都带有其仓库、URL 和 SPDX 许可证

在 43 个以代理表达任务的方式表述的保留查询上——从不重复技能自身的名称——所提供语料库的 排名第一准确率为 81.4%,前三名准确率为 90.7%。测试工具在仓库中;参见 dev.md 了解其测量内容和发现。

语料库内容

来自八个仓库的 374 个技能,在导入任何内容之前均已阅读其许可证:

每个技能都是一份带有代码示例、陷阱和建议的分步指南——而不是一行式提示。中位数约为 9,600 个字符。

每一行都记录了其来源仓库、上游 URL 和 SPDX 许可证,因此您获得的任何内容都可以追溯和归属。没有允许再分发的许可证的仓库不会被导入,无论内容多么优秀。

skill-mcp status 显示您本地拥有的内容。

工具

工具

功能

search_skills

语义搜索——用自然语言描述您的需求

keyword_search

精确匹配——工具名称、错误消息、CLI 命令

get_skill

获取完整指令;搜索后调用

list_categories

浏览可用领域和数量

搜索仅返回摘要。代理会为它真正想要的技能调用 get_skill,这正是 token 节省的来源。

添加您自己的技能

<!-- ~/my-skills/deploy-checklist/SKILL.md -->
---
name: "deploy-checklist"
description: "Pre-deployment verification checklist for production releases"
tags: ["deployment", "production", "checklist"]
---

## Steps

1. Run full test suite...
2. Check database migrations...
skill-mcp import --source directory --path ~/my-skills/

索引会自动更新——新技能立即可搜索,并且只嵌入新技能。在批量导入多个来源并准备一次构建时,可传递 --no-index 跳过此步骤。您的技能会与语料库合并;自动去重。

配置

所有内容都位于一个数据目录中,默认为 ~/.skill-mcp:

~/.skill-mcp/
├── config.yaml
├── skills.db          # SQLite + FTS5
└── index/             # FAISS

使用全局 --data-dir 标志或 SKILL_MCP_DATA_DIR 指向其他位置。该标志属于组,因此它位于子命令 之前:

skill-mcp --data-dir /srv/skills pull

嵌入后端

默认是 sentence-transformers/all-MiniLM-L6-v2——本地、免费、无需 API 密钥,也是预构建索引所使用的。

后端

预构建索引

要求

sentence-transformers(默认)

是

无

openai

本地构建

OPENAI_API_KEY

ollama

本地构建

Ollama 运行中

索引仅对构建它的模型有效,因此切换意味着重建:

# set backend: openai, model: text-embedding-3-large in config.yaml, then
skill-mcp build-index --backend openai

CLI 参考

skill-mcp [--data-dir DIR] [--log-level LEVEL] COMMAND [ARGS]

  init [--data-dir DIR] [--no-register]        Set up the data directory, register with agents
  pull [--replace] [--include-index]           Download the corpus from HuggingFace
  import --source SOURCE --path PATH           Import your own skills
       [--no-index]
  build-index [--backend B] [--model M]        Build or update the vector index
       [--force]
  serve [--transport stdio|sse]                Start the MCP server
  search QUERY [--k N]                         Search from the terminal
  status                                       Show what is loaded
  dedup                                        Remove cross-source duplicates

贡献

欢迎在 github.com/JayCheng113/skill-retrieval-mcp 提交 Issue 和 Pull Request。dev.md 记录了架构和设计决策背后的推理,包括尝试过和拒绝的方案——在进行非平凡更改之前请阅读它。

要为语料库提议一个仓库,请提交一个 Issue,附上其许可证以及它覆盖当前 374 个技能所不具备的内容的理由。标准在 dev.md 中:允许再分发的许可证,以及技能确实能赢得查询的证据。

git clone https://github.com/JayCheng113/skill-retrieval-mcp
cd skill-retrieval-mcp
pip install -e ".[all,dev]"
pytest tests/ -v    # 240 tests, ~6s

许可证

MIT — 参见 LICENSE。

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Connects AI coding agents to the SkillsMP marketplace, allowing users to search, read, and install over 8,000 community-made skills. It enables agents to gain new capabilities either through on-the-spot instruction or permanent installation without requiring an API key.
    5
    10 npm
    10
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    Enables AI agents to intelligently match tasks to skills through semantic embeddings, track skill effectiveness, detect skill gaps, and discover new skills from external sources.
    Apache 2.0
  • A
    license
    A
    quality
    C
    maintenance
    Enables AI agents to autonomously search, evaluate, and install skills from the skills.sh catalog.
    4
    20 npm
    ISC