关于 fabric-mcp
fabric-mcp 将 Fabric 内容处理模式提供给 Claude、Warp 等 MCP 客户端。它通过 Fabric CLI 支持模式发现,以及对文本、文件、URL 和 YouTube 字幕的分析。
主要功能
- 01发现可用的 Fabric 模式
- 02运行自定义或专用模式
- 03分析文件和 URL
- 04获取并分析 YouTube 字幕
- 05检查依赖项和配置
适用场景
- 01总结文章或网页
- 02从视频字幕中提取见解
- 03将讲义转换为抽认卡
- 04审阅代码差异或分析日志
MCP 相关
MCP 服务向客户端提供 Fabric 模式和组合式内容分析工具。它直接调用 Fabric CLI 并返回结果。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
npx -y @angrydad67/fabric-mcp-serverFABRIC_PATHCustom path to Fabric CLI (optional, uses PATH by default)YTDLP_PATHCustom path to yt-dlp CLI (optional, uses PATH by default)本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。
工具
19收录的工具列表 · 更新于 3 周前
此工具无需参数。
详细介绍
Fabric MCP 服务
适用于 Fabric 的模型上下文协议(MCP)服务。Fabric 是 Daniel Miessler 开发的 AI 驱动型内容处理框架。
此 MCP 服务让 Claude(通过 Claude Desktop 或 Warp CLI)能够使用 Fabric 丰富的 AI 模式集合,用于内容分析、摘要、学习、编码、安全分析等。
快速开始
-
安装 Fabric(如果尚未安装):
详细说明请参阅 Fabric 官方安装指南。
-
安装 yt-dlp(可选,用于获取 YouTube 字幕文本):
# macOS brew install yt-dlp # Linux/Windows pip install yt-dlp -
下载并安装:
- 从 Releases 下载
fabric-mcp.mcpb - 双击该文件
- 在 Claude Desktop 中点击“Install”
- 重启 Claude Desktop
- 从 Releases 下载
-
试用: 向 Claude 提问:“列出所有 fabric 模式”
功能
- 🚀 直接集成 CLI:直接使用 Fabric CLI(无需 REST API 服务)
- 🔧 19 个预配置工具:直接访问常用的 Fabric 模式及组合分析工具
- 🎯 通用模式运行器:使用
run_fabric_pattern运行任意 Fabric 模式 - 📺 YouTube 支持:直接获取视频字幕文本(需要 yt-dlp)
- 🔍 模式发现:动态列出所有可用模式
- 📁 文件和 URL 分析:使用 Fabric 模式处理文件和网页内容
- 🏥 健康检查:验证依赖项和配置
前置条件
1. 安装 Fabric
如果尚未安装 Fabric,请按照 Fabric 官方安装指南操作。
2. 安装 yt-dlp(可选)
仅当需要获取 YouTube 字幕文本时才需要:
# macOS
brew install yt-dlp
# Linux
pip install yt-dlp
# Or: sudo apt install yt-dlp (on Ubuntu/Debian)
# Windows
pip install yt-dlp
3. 验证安装
# Test Fabric
fabric --version
fabric --listpatterns
# Test yt-dlp (optional)
yt-dlp --version
安装
选项 1:下载并安装(推荐)🎉
最简单的安装方式:
- 下载最新的
fabric-mcp.mcpb,可从 Releases 获取 - 双击下载的文件
- Claude Desktop 将打开并提示你安装
- 点击 Install
- 重启 Claude Desktop
- 完成!
.mcpb 文件是一个独立软件包,包含所需的所有内容。
选项 2:从源代码构建
如果要从源代码构建:
git clone https://github.com/mpzarde/fabric-mcp.git
cd fabric-mcp
npm install
npm run build
然后选择以下任一方式:
- 构建
.mcpb软件包:./build-mcpb.sh(创建可供安装的fabric-mcp.mcpb) - 手动配置:手动设置请参阅下方的“配置”部分
配置
用于 Claude Desktop
注意:如果使用
.mcpb软件包(选项 1)安装,Claude Desktop 会自动完成配置。本部分仅适用于手动构建。
将以下内容添加到 Claude Desktop 配置文件中:
macOS:~/Library/Application Support/Claude/claude_desktop_config.json
Windows:%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"fabric": {
"command": "node",
"args": ["/absolute/path/to/fabric-mcp/dist/index.js"]
}
}
}
将 /absolute/path/to/fabric-mcp/ 替换为实际的项目路径。
可选环境变量(如有需要):
"env": {
"FABRIC_PATH": "/custom/path/to/fabric",
"YTDLP_PATH": "/custom/path/to/yt-dlp"
}
用于 Warp CLI
注意:Warp 需要手动配置。请先从源代码构建,或解压
.mcpb软件包。
将以下内容添加到 Warp MCP 配置文件中:
macOS/Linux:~/.warp/mcp_config.json
{
"mcpServers": {
"fabric": {
"command": "node",
"args": ["/absolute/path/to/fabric-mcp/dist/index.js"]
}
}
}
将 /absolute/path/to/fabric-mcp/ 替换为实际的项目路径。
可选环境变量(如有需要):
"env": {
"FABRIC_PATH": "/custom/path/to/fabric",
"YTDLP_PATH": "/custom/path/to/yt-dlp"
}
重启 Claude/Warp
完成配置后:
- Claude Desktop:重启应用
- Warp:重启终端或运行
warp mcp reload
可用工具
核心工具
health_check- 检查 Fabric、yt-dlp 和其他依赖项是否已安装并配置list_fabric_patterns- 列出所有可用的 Fabric 模式run_fabric_pattern- 使用自定义输入运行任意 Fabric 模式get_youtube_transcript- 获取 YouTube 视频的字幕文本
组合分析工具
这些工具将获取内容和应用模式合并为一步,从而简化常见工作流。优点:
- ✅ 不会截断:完整内容会直接传递给 Fabric
- ✅ 效率更高:只需调用一次工具,而不是多次
- ✅ 效果更好:Fabric 会处理完整内容,不受上下文窗口限制
analyze_youtube_video- 获取 YouTube 转录文本并在一步中应用模式analyze_file- 读取文件并在一步中应用模式analyze_url- 获取 URL 内容并在一步中应用模式
预配置模式工具
这些模式以带有 fabric_ 前缀的专用工具形式提供:
内容分析
fabric_extract_wisdom- 从内容中提取关键见解和引言fabric_summarize- 创建简明摘要fabric_analyze_claims- 分析并核查论断fabric_analyze_paper- 分析学术论文
学习
fabric_create_quiz- 生成测验题目fabric_to_flashcards- 将内容转换为学习卡片
开发
fabric_summarize_git_diff- 总结 git diff,便于审查fabric_create_coding_project- 根据创意生成项目结构fabric_explain_code- 用简单的语言解释代码
安全与运维
fabric_analyze_logs- 分析日志文件fabric_analyze_incident- 分析安全事件
写作
fabric_improve_writing- 提升写作质量
使用示例
使用 Claude Desktop
从 YouTube 视频中提取精华:
User: Can you extract the key insights from this video?
https://www.youtube.com/watch?v=dQw4w9WgXcQ
Claude: [Uses get_youtube_transcript + fabric_extract_wisdom]
总结文章:
User: Summarize this article: [paste article text]
Claude: [Uses fabric_summarize]
根据讲义创建学习卡片:
User: Convert these lecture notes into flashcards: [paste notes]
Claude: [Uses fabric_to_flashcards]
分析 git diff:
User: Review this git diff and summarize the changes:
[paste git diff output]
Claude: [Uses fabric_summarize_git_diff]
组合分析工具
为提高效率,请使用一步完成获取和分析的组合工具:
User: Extract wisdom from this YouTube video:
https://www.youtube.com/watch?v=example
Claude: [Uses analyze_youtube_video with pattern='extract_wisdom']
User: Summarize this article:
https://example.com/article
Claude: [Uses analyze_url with pattern='summarize']
User: Explain the code in /path/to/script.py
Claude: [Uses analyze_file with pattern='explain_code']
串联模式
Claude 可以串联多个模式:
User: Get the transcript from this video, extract the wisdom,
then create flashcards from it.
https://www.youtube.com/watch?v=example
Claude:
[1. Uses get_youtube_transcript]
[2. Uses fabric_extract_wisdom on transcript]
[3. Uses fabric_to_flashcards on extracted wisdom]
使用场景
基于 Daniel Miessler 的 Fabric 模式:
内容处理
- YouTube 视频 → 提取精华 / 总结
- 文章 / 博客文章 → 总结、分析论断
- 播客转录文本 → 提取精华、摘录引言
写作与开发
- 创意 → 文章(通过
create_coding_project或类似模式) - 代码差异 → PR 描述(通过
summarize_git_diff) - 会议记录 → 用户故事(通过
run_fabric_pattern和agility_story)
学习
- 任意内容 → 学习卡片(通过
to_flashcards) - 内容密集的文档 → 带类比的术语表
- 视频 / 文章 → 测验(通过
create_quiz)
安全分析
- 恶意软件样本 → 分析(通过
analyze_malware) - 日志文件 → 威胁解读(通过
analyze_logs) - 安全扫描 → 规则(通过
run_fabric_pattern)
故障排除
检查服务健康状况
向 Claude 询问:“运行健康检查”——这将验证:
- Fabric 安装情况和版本
- Fabric 配置(API 密钥、模式)
- yt-dlp 安装情况(用于支持 YouTube)
- 如果缺少任何内容,则提供安装说明
常见问题
未找到 Fabric
错误:Failed to spawn fabric: ENOENT
解决方案:
- 按照官方安装指南安装 Fabric
- 验证安装:
which fabric和fabric --version - 如果使用自定义 Fabric 路径,请在 MCP 配置中设置
FABRIC_PATH
未找到模式
错误:Pattern not found: pattern_name
解决方案:
- 让 Claude 列出所有模式:“列出所有 fabric 模式”
- 更新模式:
fabric --updatepatterns - 检查拼写——使用下划线(例如,
extract_wisdom而不是extractWisdom)
YouTube 转录文本无法使用
错误:Failed to fetch YouTube transcript
解决方案:
- 安装 yt-dlp:
brew install yt-dlp(macOS)或pip install yt-dlp - 验证:
yt-dlp --version - 如果使用自定义路径,请在 MCP 配置中设置
YTDLP_PATH
Claude 中未显示 MCP 服务
解决方案:
- 确认配置文件位置:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json
- macOS:
- 使用验证工具检查 JSON 语法
- 确保
dist/index.js的路径为绝对路径 - 完全重启 Claude Desktop
- 检查日志:
~/Library/Logs/Claude/mcp-server-fabric.log
模式执行超时
错误:Fabric command timed out
解决方案:
- 大型模式可能需要一些时间(默认:5 分钟)
- 检查 Fabric API 密钥和配额
- 先尝试使用较小的输入
开发
构建
# Build TypeScript only
npm run build
# Build complete .mcpb bundle
./build-mcpb.sh
监视模式
npm run watch
本地测试
# Build the project
npm run build
# Test the MCP server
node dist/index.js
# Server will run on stdio and wait for MCP protocol messages
# Or use the health check to verify dependencies
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"health_check","arguments":{}}}' | node dist/index.js
架构
┌─────────────────┐
│ Claude/Warp │
└────────┬────────┘
│ MCP Protocol (stdio)
▼
┌─────────────────┐
│ MCP Server │ ← This project
│ (Node.js) │
└────────┬────────┘
│ Direct CLI calls
▼
┌─────────────────┐
│ Fabric CLI │
│ (fabric cmd) │
└────────┬────────┘
│
▼
┌─────────────────┐
│ AI Patterns │
│ OpenAI/etc. │
└─────────────────┘
MCP 服务:
- 将 Fabric 模式作为 MCP 工具公开
- 直接使用模式名称和输入调用 Fabric CLI
- 将结果返回给 Claude/Warp
- 无需 REST API 服务端——使用 CLI 接口
资源
- Fabric:https://github.com/danielmiessler/Fabric
- yt-dlp:https://github.com/yt-dlp/yt-dlp
- MCP 文档:https://modelcontextprotocol.io
- MCP SDK:https://github.com/modelcontextprotocol/typescript-sdk
许可证
MIT
贡献
欢迎贡献!请提交 issue 或 PR。
致谢
- Daniel Miessler 的 Fabric
- Anthropic 的 MCP
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。