Skip to main content
Glama
Guslaier

MCP-skill-library-dynamic

by Guslaier

MCP-skill-library-dynamic 🚀

一个企业级的 MCP(Model Context Protocol)服务器,可按需从本地目录向 AI 代理提供技能和规则文件。它允许 AI 代理动态列出并获取以 Markdown 格式编写的特定技能指令,而不会遭受上下文膨胀(Context Bloat)的问题。


✨ 功能特性(v1.2.0)

  • 原生 TypeScript:100% 类型安全,编译为优化的 ES Modules。

  • 精选 200+ 核心技能库:高质量、去重且符合社区标准的技能集,已预先索引在 skills-base.json 中。

  • 确定性离线优先下载器:使用 npx skills add 直接从精选基础列表中快速、可靠地批量下载,并带有指数退避重试机制。

  • 智能搜索与过滤list_skills 支持可选的 query 参数(例如 list_skills({ query: "react" }))来直接过滤技能并节省 token。

  • 递归多文件规则聚合fetch_skill_rule 自动扫描并合并所有嵌套的 Markdown 文件(例如 rules/*.mdreferences/*.md),不会跳过更深层的文档。

  • 零配置自动路径解析:智能地相对于编译后的服务器位置解析 .agents/skills,消除了手动设置 SKILLS_DIR 的问题。

  • 幽灵技能消除:自动忽略空目录,仅提供包含已验证 .md 规则文件的文件夹。

  • 内存安全缓存:利用 TTL 缓存进行目录列表,并使用异步 I/O 进行文件读取,即使有 100,000+ 个技能,也能保证 0% 的内存溢出(OOM)崩溃几率。

  • 路径遍历防护:采用加密级路径解析,将 AI 严格限制在 .agents/skills/ 目录的沙箱中。

  • 优雅关闭:正确处理 SIGINT/SIGTERM 和未捕获的异常,确保 MCP 套接字干净关闭。

  • Token 精简架构(节省成本)

    • list_skills 仅返回原始文件夹名称(slugs),即使有 1,000+ 个技能,也能将注入的上下文最小化到仅约 ~1,500 个 token。

    • fetch_skill_rule 严格按需获取内容,一次只获取一个技能,防止 AI 幻觉和巨额 API 费用。


Related MCP server: SkillMCP

📦 安装与构建

  1. 克隆或下载仓库:

git clone https://github.com/Guslaier/MCP-skill-library-dynamic.git
cd skill-library-mcp
  1. 安装依赖:

npm install
  1. 编译 TypeScript 源代码:

npm run build

🧠 下载与管理技能

技能被加载到项目根目录下的 .agents/skills/ 中(或通过 SKILLS_DIR 配置)。

精选基础技能(skills-base.json

下载器使用 skills-base.json 作为唯一事实来源,其中包含来自官方和顶级仓库(anthropics/skillsobra/superpowersaffaan-m/eccbrowser-use 等)的 200+ 个精选且去重的技能。

CLI 命令

命令

描述

npm run download

下载并安装所有 200+ 基础技能

npm run download -- <skill-name>

仅下载与给定名称筛选条件匹配的技能

示例

# Download all 200+ curated base skills
npm run download

# Download only specific skills matching 'caveman'
npm run download -- caveman

# Download all React / Frontend related skills
npm run download -- react

📁 目录结构

skill-library-mcp/
├── package.json
├── tsconfig.json
├── skills-base.json        # Curated index of 200+ skills (name, repo url, description)
├── src/
│   ├── index.ts            # MCP Server entry point
│   └── download-skills.ts  # Batch downloader from skills-base.json
├── dist/
│   ├── index.js
│   └── download-skills.js
└── .agents/
    └── skills/             # Local skill files served to AI agents
        ├── code-review/
        │   └── SKILL.md
        ├── test-driven-development/
        │   └── SKILL.md
        └── ...

🚀 运行服务器

使用以下命令启动服务器:

npm start

⚙️ MCP 配置

要将此服务器与 MCP 客户端(如 AntigravityCursorRoo CodeCline)连接,请将以下配置添加到客户端的设置文件中:

{
  "mcpServers": {
    "skill-library": {
      "command": "node",
      "args": [
        "C:/path/to/skill-library-mcp/dist/index.js"
      ],
      "env": {
        "SKILLS_DIR": "C:/path/to/skill-library-mcp/.agents/skills"
      }
    }
  }
}

重要提示:C:/path/to/skill-library-mcp 替换为你的实际仓库路径,指向 dist/index.js


🤖 系统提示词(知识库协议)

将以下提示词添加到你的 AI 代理规则(.clinerules.cursorrules 或自定义指令)中,以便代理自动使用技能库:

# UNIVERSAL KNOWLEDGE BASE PROTOCOL
You are equipped with the Enterprise "Skill Library MCP". Before starting any architectural planning, refactoring, or feature implementation, you MUST:
1. Use `list_skills` (or `list_skills({ query: "keyword" })`) to check for relevant domain rules or coding standards.
2. If found, use `fetch_skill_rule({ skill_name: "..." })` to read the full context and nested rule guidelines.
3. Explicitly acknowledge the rules and apply them strictly to your code generation.

📜 许可证

MIT

Install Server
A
license - permissive license
A
quality
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Serves project-specific skills and behavioral rules to AI agents via MCP, enabling automatic injection of behavioral rules and on-demand knowledge for coding assistants like Claude Code and Gemini CLI.
    1
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI agents to discover, read, search, and install Markdown-based knowledge (rules, skills, workflows) from a local directory via MCP tools.
    12
    38
    MIT

View all related MCP servers

Related MCP Connectors

  • Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.

  • Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.

  • Securely search and manage workspace context files for AI agents and teams.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Guslaier/MCP-skill-library-dynamic'

If you have feedback or need assistance with the MCP directory API, please join our Discord server