使用说明
结构MCP服务器
模型上下文协议(MCP)服务器 织物 -Daniel Miessler的人工智能内容处理框架。
此MCP服务器允许Claude(通过Claude Desktop或Warp CLI)使用Fabric广泛的AI模式集进行内容分析、摘要、学习、编码、安全分析等。
快速开始
-
安装结构 (如果尚未安装):
看 官方布料安装指南 详细说明。
-
安装yt-dlp (可选,适用于YouTube成绩单):
# macOS brew install yt-dlp # Linux/Windows pip install yt-dlp -
下载并安装:
- 下载
fabric-mcp.mcpb从 发布 - 双击文件
- 在Claude Desktop中单击“安装”
- 重新启动克劳德桌面
- 下载
-
试试看: 问克劳德:“列出所有面料图案”
特性
- 🚀 直接CLI集成:直接使用结构CLI(不需要REST API服务器)
- 🔧 19个预配置工具:直接访问常用的织物图案以及组合分析工具
- 🎯 通用模式运行器:运行任何织物图案
run_fabric_pattern - 📺 YouTube支持:直接获取视频转录(需要yt-dlp)
- 🔍 模式发现:动态列出所有可用模式
- 📁 文件和URL分析:使用结构模式处理文件和web内容
- 🏥 健康检查:验证依赖关系和配置
先决条件
1.安装织物
如果您没有安装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从 发布 - 双击 下载的文件
- Claude Desktop将打开并提示您安装
- 点击 安装
- 重启 克劳德桌面
- 完成!
这 .mcpb file是一个自包含的包,其中包含所需的一切。
选项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您可以安装) - 手动配置:有关手动设置,请参阅下面的配置部分
配置
适用于克劳德桌面
备注:如果您使用
.mcpb捆绑包(选项1),Claude Desktop会自动进行配置。本节仅适用于手动构建。
添加到您的Claude Desktop配置文件中:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
视窗: %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"
}
重启克劳德/沃普
配置后:
- 克劳德桌面:重新启动应用程序
- 扭曲:重新启动终端或运行
warp mcp reload
可用工具
核心工具
health_check-检查是否安装并配置了Fabric、yt-dlp和其他依赖项list_fabric_patterns-列出所有可用的织物图案run_fabric_pattern-使用自定义输入运行任何结构图案get_youtube_transcript-从YouTube视频中获取文字记录
组合分析工具
这些工具通过一步获取内容和应用模式简化了常见的工作流程。优点:
- ✅ 无截断:完整内容直接传递给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差异以供评论fabric_create_coding_project-根据想法生成项目结构fabric_explain_code-用简单的术语解释代码
安全与运营
fabric_analyze_logs-分析日志文件fabric_analyze_incident-分析安全事件
写作
fabric_improve_writing-提高写作质量
使用示例
使用克劳德桌面
从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的织物图案:
内容处理
- YouTube视频→ 提取智慧/总结
- 文章/博客文章→ 总结、分析索赔
- 播客记录→ 提取智慧,引用名言
写作与发展
- Idea → 论文(via
create_coding_project或类似图案) - 代码差异→ PR描述(通过
summarize_git_diff) - 会议记录→ 用户故事(通过
run_fabric_pattern随着agility_story)
学习
- 任何内容→ 抽认卡(通过
to_flashcards) - 密集文档→ 带类比的词汇表
- 视频/文章→ 测验(通过
create_quiz)
证券分析
- 恶意软件样本→ 分析(via
analyze_malware) - 日志文件→ 威胁解释(via
analyze_logs) - 安全扫描→ 规则(via
run_fabric_pattern)
故障排除
检查服务器运行状况
问克劳德:“运行健康检查”-这将验证:
- 结构安装和版本
- 结构配置(API键、模式)
- yt-dlp安装(用于YouTube支持)
- 如果缺少任何东西,请提供安装说明
常见问题
未找到织物
错误: Failed to spawn fabric: ENOENT
解决方案:
- 按照以下步骤安装结构 官方安装指南
- 验证安装:
which fabric和fabric --version - 如果使用自定义结构位置,请设置
FABRIC_PATH在MCP配置中
未找到图案
错误: Pattern not found: pattern_name
解决方案:
- 让克劳德列出所有图案:“列出所有织物图案”
- 更新模式:
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 - 如果使用自定义位置,请设置
YTDLP_PATH在MCP配置中
MCP服务器未出现在Claude中
解决方案:
- 验证配置文件位置:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - 窗户:
%APPDATA%/Claude/claude_desktop_config.json
- macOS:
- 使用验证器检查JSON语法
- 确保路径
dist/index.js是绝对的 - 完全重新启动克劳德桌面
- 检查日志:
~/Library/Logs/Claude/mcp-server-fabric.log
模式执行超时
错误: Fabric command timed out
解决方案:
- 大图案可能需要时间(默认值:5分钟)
- 检查结构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服务器:
- 将结构图案作为MCP工具公开
- 使用模式名称和输入直接调用Fabric CLI
- 将结果返回给Claude/Warp
- 不需要REST API服务器-使用CLI界面
资源
- 织物: 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
许可证
麻省理工学院
贡献
欢迎投稿!请打开问题或PR。