Hierarchical Skills For AI MCP Server

Hierarchical Skills For AI MCP Server

A hierarchical MCP server for managing skill definitions with a browsable tree structure and full-text search. It allows AI agents to efficiently discover and use skills without consuming context tokens.

Category
访问服务器

README

Hierarchical Skills For AI - A Skills Serving Hierarchical MCP Server

A hierarchical MCP (Model Context Protocol) server for managing skill definitions. Skills are stored as folders containing SKILL.md with YAML frontmatter, organized in a browsable tree structure with full-text search and a web UI.

When to Use / When Not to Use

Use this when

  • You have many skills (100+) and including all their frontmatter in the AI's context window would waste tokens
  • You want structured, hierarchical organization of skills by domain (coding, security, writing...)
  • You want search + browse so the AI can find the right skill without knowing the exact path
  • You want usage tracking so popular skills naturally rank higher over time
  • You want a web UI for humans to browse the same skill tree

Don't use this when

  • You have few skills (< 15) — just install them as per your agents' instructions, no server needed
  • Your skills are ephemeral or one-shot — the server setup overhead isn't worth it
  • You need real-time editing or CRUD from the web UI — it's read-only by design
  • You need multi-user auth or permissions — not built for that
  • You need relational queries or a database backend — this is filesystem + in-memory index

Architecture

  Agent (MCP client)             Human (browser)
       ↓                              ↓
Skills MCP Server ← python mcp_server.py --port 8080
       │                              │
       ├── MCP (stdio)                ├── HTTP (web UI)
       │   browse(path, depth=1)      │   GET /api/browse?path=&depth=
       │   read(path)                 │   GET /api/search?q=
       │   search(query)              │   GET /api/read?path=
       │   info(path)                 │   GET /api/info?path=
       │   use(path)                  │
       │   steps(path)                │
       │   reload()                   │
       │                              │
       └──────────────────────────────┘
                      ↓
          ┌───────────┼───────────┐
          ↓           ↓           ↓
     File system    Index     Usage stats
     (SKILL.md)   (tags,     (uses count,
                   aliases,   last_used)
                   body,
                   relations)

Quick Start

# Install
python3 -m venv venv
source venv/bin/activate
pip install -e .

# Run with sample skills (activate venv first)
python mcp_server.py --port 8080

# Open web UI
open http://localhost:8080

CLI Arguments

Argument Required Default Description
--repo No sample_skills Path to root folder containing grouped skills
--max-depth No 4 Maximum folder depth to walk
--port No 8080 Port for web UI
--host No localhost Host for web UI

MCP Tools

Tool Input Output Description
browse(path, depth=1) "", "coding", "coding/python" Child groups + skills (nested if depth>1) Navigate the skill hierarchy
read(path) "coding/python/fastapi" Full SKILL.md body Load skill content
search(query) "fastapi", "web" Ranked paths Search by name, tags, aliases, description, path segments
info(path) "coding/python/fastapi" YAML metadata (no body) Lightweight skill inspection
use(path) "coding/python/fastapi" Updated metadata Track skill usage (boosts search ranking)
steps(path) "coding/python/fastapi" Ordered step list Get workflow sub-skills
reload() Status Re-scan repo, re-validate, re-index

Skill File Format

Each skill lives in its own folder containing a SKILL.md file with YAML frontmatter delimited by ---.

Folder structure rules

skills/
  coding/                      # group folder (has subfolders, no SKILL.md)
    python/
      fastapi/                 # skill folder → contains SKILL.md
        SKILL.md
      pytest/
        SKILL.md
    rust/
      tokio/
        SKILL.md
  • A folder is a skill if it contains SKILL.md
  • A folder is a group if it has subfolders but no SKILL.md
  • A folder can be dual (both group + skill) — has SKILL.md AND subfolders
  • Folders beyond --max-depth are silently ignored
  • Empty folders (no SKILL.md, no subfolders) are silently ignored
  • Use lowercase with hyphens for folder names: web-scraping
  • All path lookups are case-insensitive"Coding/Python" and "coding/python" resolve to the same node
  • Case collisions are rejected at startup: having both Coding/ and coding/ folders will abort the server — use consistent casing

Frontmatter fields

Field Required Type Description
name Yes string Unique identifier across the entire tree. Does not need to match folder name.
tags No list Keywords for search: [python, api, web]
aliases No list Alternative names an AI might search by: [fast api, fastapi framework]
description No string One or two sentences explaining the skill. Indexed for search.
depends_on No list of paths Prerequisites the AI should know first: [python/basics]
related No list of paths Conceptually similar skills: [flask, starlette]
followed_by No list of paths Natural next skills after mastering this one
steps No list of paths Ordered sub-skill paths for multi-step workflows
uses Auto integer Usage counter — auto-incremented by use() tool
last_used Auto string or null ISO timestamp — auto-set by use() tool

Example

---
name: fastapi
tags: [python, api, web]
aliases: [fast api, fastapi framework]
description: Python web framework for building APIs
depends_on: [python/basics]
related: [flask, starlette]
followed_by: [sqlalchemy, pytest]
uses: 0
last_used: null
steps: [setup/project-scaffold, coding/python/fastapi/routing]
---

After the closing ---, write standard Markdown body content. The server never modifies the body — only uses and last_used in the frontmatter are updated automatically.

Validation rules

On startup and reload() the server validates every skill:

  • SKILL.md must exist and have valid YAML frontmatter
  • name field is required and must be unique across the entire tree
  • Duplicate names cause an abort with per-skill error logging
  • Folders with case-colliding paths (e.g. Coding/ and coding/) cause an abort — use consistent casing
  • Folders beyond --max-depth are silently ignored

Hierarchy guidelines

  • Keep --max-depth between 3 and 5 levels
  • Aim for 5–15 children per group node; split into sub-groups if exceeding 20
  • Use dual nodes (folder with SKILL.md + subfolders) when a group has general content applying to all children
  • Prefer 3–8 tags per skill, lowercase, singular form

Project Structure

skills-mcp-server/
├── mcp_server.py           # Root-level entry point
├── pyproject.toml          # Project configuration
├── src/
│   ├── __init__.py         # Package init
│   ├── __main__.py         # Entry point
│   ├── main.py             # CLI + server orchestration
│   ├── models.py           # Data models
│   ├── frontmatter.py      # YAML frontmatter parser
│   ├── discovery.py        # Folder walker
│   ├── tree.py             # In-memory skill tree
│   ├── index.py            # Search index
│   ├── mcp_server.py       # MCP tool definitions
│   ├── http_server.py      # HTTP server for web UI
│   └── static/
│       └── index.html      # Web UI (vanilla HTML/CSS/JS)
├── tests/
│   ├── test_discovery.py   # Tests for discovery
│   ├── test_frontmatter.py # Tests for YAML parsing
│   └── test_tools.py       # Tests for tree tools & search
├── sample_skills/          # Demo skills
├── HANDOFF.md              # Session handoff notes
├── AGENTS.md               # Agent conventions
└── IMPLEMENTATION_PLAN.md  # Full implementation plan

Design Principles

  • Hierarchy for humans, search for models — tree browsing and full-text search coexist
  • Filesystem as source of truth — no database needed
  • Minimal dependencies — only mcp and pyyaml
  • Read-only web UI — no editing, no auth, no build step
  • Self-improving index — usage tracking boosts popular/recent skills in search results

Tests

python -m pytest tests/ -v

推荐服务器

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

官方
精选