Skip to main content

Lightweight MCP Server for RAG-based skill retrieval

Project description

skill-retrieval-mcp

Your agent doesn't need 200K skills in context. It needs the right 5.

An MCP server that brings RAG to skill loading. Instead of pre-loading all skills into your agent's context, it retrieves only the most relevant ones per task — zero LLM calls, millisecond latency.

Works with Claude Code, Codex CLI, Gemini CLI, Cursor, and any MCP-compatible agent.

Pre-loading skill-retrieval-mcp
Scale 10–20 skills 200K+
Selection Manual Semantic similarity
Latency < 5ms
Context cost All loaded Top-k only

Quick Start

3 commands to go from zero to 89K searchable skills:

pip install "skill-retrieval-mcp[local,hf]"
skill-mcp pull                    # download 89K pre-built skills from HuggingFace
skill-mcp build-index             # build vector index locally (~2 min)

That's it. Register with your agent and start using:

# Claude Code — auto-registers during init
skill-mcp init

# Or add manually to ~/.claude/settings.json
{"mcpServers": {"skill-retrieval": {"command": "skill-mcp", "args": ["serve"]}}}

How Your Agent Uses It

The server exposes 4 tools. The typical flow is search → fetch:

Agent: search_skills({"query": "debug memory leak in python", "k": 3})
→ [{"id": "a1b2", "name": "debug-memory-leak", "score": 0.81, ...}, ...]

Agent: get_skill({"skill_id": "a1b2"})
→ {"instructions": "Memory leaks cause applications to consume increasing RAM..."}
Tool What it does
search_skills Semantic search — returns top-k skill summaries with scores
get_skill Fetch full instructions for a skill by ID
keyword_search FTS5 text search — works without vector index
list_categories Browse all skill categories and counts

search_skills returns summaries only (no full instructions) to save context tokens. Call get_skill for the ones you need.

Skill Loading

Use pre-built dataset (recommended)

skill-mcp pull                    # merge 89K skills into your store
skill-mcp pull --include-index    # also download pre-built vector index
skill-mcp pull --replace          # replace local DB entirely (discard custom skills)

pull merges by default — your custom skills are preserved. The dataset includes LangSkills, SkillNet, Anthropic official, and community sources, already deduplicated.

Add your own skills

Create SKILL.md files anywhere:

---
name: "debug-memory-leak"
description: "Identify and fix memory leaks in long-running applications"
tags: ["debugging", "memory", "profiling"]
---

## Instructions

Your detailed skill instructions here...

Then import and index:

skill-mcp import --source directory --path ~/my-skills/
skill-mcp build-index             # incremental — only encodes new skills

Mixed usage (HF + custom)

skill-mcp pull                    # 89K pre-built skills
skill-mcp import --source directory --path ~/my-skills/   # add yours
skill-mcp build-index             # encodes only your new skills, keeps the rest

Deduplication is automatic. Priority: ANTHROPIC > COMMUNITY > LANGSKILLS > SKILLNET.

Embedding Backends

Default: sentence-transformers/all-MiniLM-L6-v2 (384-dim, local, free, no API key).

skill-mcp build-index                                              # default (local)
skill-mcp build-index --backend openai --model text-embedding-3-large   # highest quality
skill-mcp build-index --backend ollama --model nomic-embed-text    # self-hosted
Backend Install Requires
sentence-transformers pip install skill-retrieval-mcp[local] Nothing
openai pip install skill-retrieval-mcp[openai] OPENAI_API_KEY
ollama pip install skill-retrieval-mcp[ollama] Ollama running locally

Switching backends requires --force to rebuild the index.

CLI Reference

skill-mcp init [--no-register]              Create data dir, config, register with agents
skill-mcp pull [--replace] [--include-index] Download/merge pre-built dataset from HuggingFace
skill-mcp import --source SOURCE --path PATH Import skills from directory/langskills/anthropic
skill-mcp build-index [--backend B] [--force] Build or incrementally update vector index
skill-mcp serve [--transport stdio|sse]      Start MCP server
skill-mcp search QUERY [--k N]              Test search locally
skill-mcp status                            Show skills/index/config status
skill-mcp dedup                             Remove duplicate skills

All commands support --data-dir DIR or env SKILL_MCP_DATA_DIR for custom locations.

Development

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

Architecture, data model, and extension guide: dev.md

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

skill_retrieval_mcp-0.1.0.tar.gz (34.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

skill_retrieval_mcp-0.1.0-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

Details for the file skill_retrieval_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: skill_retrieval_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 34.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for skill_retrieval_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 244af368edf90d2f551401b5ef4b27e92431ee52e58f9886f70bd8a6d5681da1
MD5 7f7141d75dea9b831775f1c7ab794f26
BLAKE2b-256 342d84d0354d39a7c0645c0597b108c4d2cff8bbfc0e53f5ffdbf2be4dc21815

See more details on using hashes here.

Provenance

The following attestation bundles were made for skill_retrieval_mcp-0.1.0.tar.gz:

Publisher: publish.yml on JayCheng113/skill-retrieval-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file skill_retrieval_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for skill_retrieval_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 968753ddd25ff8c653eadd9b1bef7a1038c89af22d16eebd36cebd8a60e7eac1
MD5 09c3b673cb3b363aaac38fb72ab44512
BLAKE2b-256 2f0cfa82638059cc5d38c677c7aeaa49ccaf72ca20569b3122b53190419622f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for skill_retrieval_mcp-0.1.0-py3-none-any.whl:

Publisher: publish.yml on JayCheng113/skill-retrieval-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page