研究分析MCP服务器准备
一个专门的模型上下文协议(MCP)服务器,用于将成绩单和文档转换为干净的Markdown格式,用于研究分析工作流程。
 ](https://nodejs.org/) 
🎯 目的
将原始成绩单、文档和图像转换为干净、匿名的Markdown,非常适合研究分析。专为研究人员、分析师和任何处理面试数据、会议记录或文档转换工作流程的人而设计。
✨ 主要特点
- 🎙️ VTT转录转换:使用智能说话者识别转换字幕文件
- � 文本文档转换:将纯文本文件(.txt)转换为结构化Markdown
- �🔒 隐私保护:自动匿名说话者(例如“Jennifer Adams”→ “(JA)”)
- 📊 研究就绪输出:用于AI分析工具和Agent Playground的YAML frontmatter
- 🖼️ 图像处理:使用OCR从屏幕截图和文档中提取内容
- 📝 内容消毒:删除电子邮件、电话号码和敏感数据
- ⚡ 生产准备就绪:高效处理大文件(测试了6000多行)
🚀 快速开始
安装
git clone https://github.com/your-username/prep-for-research-analysis.git
cd prep-for-research-analysis
npm install配置
- 复制环境模板:
cp .env.example .env- (可选)添加Azure AI凭据以进行高级图像处理:
AZURE_AI_FOUNDRY_ENDPOINT=your-endpoint-here
AZURE_AI_FOUNDRY_KEY=your-key-here启动服务器
npm start💬 GitHub复制集成
设置
添加到您的VS代码 settings.json:
{
"github.copilot.chat.mcp.servers": {
"prep-for-research-analysis": {
"name": "Prep for Research Analysis",
"command": "node",
"args": ["prep-for-research-analysis-server.js"],
"cwd": "/path/to/your/project"
}
}
}使用示例
@prep-for-research-analysis convert_vtt_to_md filePath="interview.vtt" anonymizeSpeakers=true
@prep-for-research-analysis convert_txt_to_md filePath="notes.txt" title="Meeting Notes" tags=["meeting", "notes"] anonymize=true
@prep-for-research-analysis process_file_for_azure inputPath="meeting.vtt" title="Strategy Meeting" tags=["strategy", "planning"]
@prep-for-research-analysis convert_image_to_md filePath="diagram.png" title="System Architecture"📊 样本输出
输入(VTT)
WEBVTT
00:07:10.709 --> 00:07:15.070
I think we need to focus on user experience first.
00:07:15.070 --> 00:07:17.709
Absolutely, that's our top priority.输出(Markdown)
---
title: Strategy Meeting
created: '2025-06-27T18:45:00.000Z'
content_type: transcript
tags:
- strategy
- planning
azure_ai_foundry:
ready: true
format_version: '1.0'
---
# Transcript
## Speaker Key
- (JA): [Speaker anonymized]
- (MJ): [Speaker anonymized]
---
**(JA):** I think we need to focus on user experience first.
**(MJ):** Absolutely, that's our top priority.🛠️ 可用工具
| 工具 | 描述 | 用例 |
|---|---|---|
convert_vtt_to_md | 将VTT文件转换为Markdown | 基本转录转换 |
convert_txt_to_md | 将纯文本文件转换为Markdown | 文档结构和匿名化 |
process_file_for_azure | 使用YAML frontmatter的完整管道 | 研究分析准备 |
convert_image_to_md | 从图像中提取文本 | 文档数字化 |
anonymize_content | 删除敏感信息 | 隐私保护 |
add_yaml_frontmatter | 添加元数据头 | AI工具兼容性 |
📁 项目结构
prep-for-research-analysis/
├── prep-for-research-analysis-server.js # Main MCP server
├── package.json # Dependencies
├── .env.example # Environment template
├── tests/
│ └── sample-files/ # Test data
├── docs/ # Documentation
└── .vscode/ # VS Code integration🧪 测试
# Run all tests
npm run test:all
# Test basic functionality
npm run test:basic
# Test VTT conversion
npm test📖 文档
⚙️ 高级配置
大文件处理
服务器高效地处理大型成绩单(测试了6000多行)。对于超大文件,解析器使用流技术来保持性能。
自定义匿名
说话者匿名化可以通过修改 extractSpeakerInfo 主服务器文件中的函数。
Azure AI集成
对于高级图像处理,请在您的 .env 文件。
🤝 贡献
- 分叉存储库
- 创建要素分支(
git checkout -b feature/amazing-feature) - 提交您的更改(
git commit -m 'Add amazing feature') - 推到分支(
git push origin feature/amazing-feature) - 打开拉取请求
🐛 故障排除
常见问题
服务器无法启动:
- 检查Node.js版本(需要18+)
- 验证是否已安装所有依赖项(
npm install)
大文件超时:
- 增加MCP客户端的超时时间
- 考虑对超大文件进行分块处理
图像处理失败:
- 确保安装了Tesseract.js依赖项
- 如果使用高级模式,请检查Azure AI凭据
📄 许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
🙏 致谢
- 建立在 模型上下文协议
- 用途 Tesseract.js 用于OCR处理
- 受到对干净、可用于研究的成绩单转换需求的启发
______________________________________________________________________
准备好转换你的成绩单了吗? 从 VTT转换指南!
项目结构
mcp-explore/
├── azure-ai-foundry-server-fixed.js # Main MCP server
├── mcp-explorer.js # MCP client utility
├── package.json # Node.js dependencies
├── .env # Environment variables (your credentials)
├── .env.example # Environment template
├── README.md # This file
├── USAGE_GUIDE.md # Comprehensive usage guide
├── CHANGELOG.md # Version history
├── CONTRIBUTING.md # Contribution guidelines
├── LICENSE # MIT license
├── examples/ # Sample files for testing
│ ├── sample-presentation.vtt # Sample VTT file
│ ├── research-meeting.vtt # Another VTT example
│ └── *.md # Generated outputs
├── tests/ # Test suite
│ ├── quick-validation.js # Quick server validation
│ ├── full-pipeline-test.js # Complete workflow test
│ ├── test-azure-ai-foundry.js # Azure AI specific tests
│ └── test-enhanced-vtt.js # VTT processing tests
├── docs/ # Additional documentation
└── .github/ # GitHub workflows安装
npm install用法
启动MCP服务器
npm start
# or
npm run server运行测试
# Run all enhanced tests
npm test
# Run specific tests
npm run test:basic # Basic functionality
npm run test:pipeline # Full pipeline test
npm run test:enhanced # Enhanced VTT processing可用工具
- convert_vtt_to_md -使用说话者匿名化将VTT文件转换为Markdown
- convert_image_to_md -使用OCR或Azure AI Foundry将图像转换为Markdown
- 匿名内容 -从文本中删除敏感信息
- add_yaml_frontmatter -添加Azure AI Foundry元数据
- 进程file_for_azure -完整的管道(推荐)
示例用法
输入VTT格式
WEBVTT
3e2f4a5b-9d8c-5f3e-b2c3-4d5e6f708901/10-0
00:00:01.000 --> 00:00:06.000
Good afternoon everyone.输出Markdown
---
title: Meeting Transcript
created: '2025-06-27T00:00:00.000Z'
content_type: transcript
tags: ['meeting', 'anonymized', 'azure-ai-foundry']
azure_ai_foundry:
ready: true
format_version: '1.0'
---
# Transcript
## Speaker Key
- (JA): [Speaker anonymized]
---
**(JA):** Good afternoon everyone.目录结构
├── azure-ai-foundry-server-fixed.js # Main MCP server
├── mcp-explorer.js # MCP client
├── package.json # Project configuration
├── README.md # This file
├── examples/ # Sample files and outputs
│ ├── research-meeting.vtt # Sample complex VTT
│ ├── sample-presentation.vtt # Sample simple VTT
│ ├── anonymized-research-meeting.md # Sample output
│ └── processed-presentation.md # Sample output
└── tests/ # Test scripts
├── test-azure-ai-server.js # Basic tests
├── test-enhanced-vtt.js # Enhanced VTT tests
└── full-pipeline-test.js # Complete pipeline tests支持的文件类型
- VTT:带有说话者标识的WebVTT字幕文件
- 图像:PNG、JPG、JPEG、GIF、BMP、TIFF、WEBP,带OCR或AI处理
- 未来:根据需要提供其他格式
处理选项
图像处理
- OCR模式 (默认):使用Tesseract.js进行文本提取
- Azure AI铸造模式:使用多模式AI增强内容理解
配置
要使用Azure AI Foundry模式,请执行以下操作:
- 复制
.env.example向.env - 添加您的Azure AI Foundry凭据:
AZURE_AI_FOUNDRY_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_AI_FOUNDRY_API_KEY=your_api_key_here
AZURE_AI_FOUNDRY_MODEL_NAME=gpt-4-vision- 使用
processingMode: "azure-ai"在您的工具调用中
Azure AI Foundry集成
服务器生成带有适当的YAML frontmatter的markdown文件,Azure AI Foundry代理可以直接使用这些文件:
title:文档标题content_type:内容类型(成绩单、文件等)tags:分类标签azure_ai_foundry.ready:表示文件已准备好用于AI消费azure_ai_foundry.format_version:格式规范版本
发展
要扩展功能,请执行以下操作:
- 向中添加新工具
setupHandlers()方法 - 将工具逻辑实现为异步方法
- 更新中的工具列表
ListToolsRequestSchema处理器 - 在中添加测试
tests/目录
许可证
国际协调委员会
