多平台开发工作流自动化服务器

一个集成Google Colab、GitHub和Google Docs的AI驱动开发工作流自动化服务器,提供智能文档生成、代码分析和跨平台操作功能。

  • by sreerajchintham
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 sreerajchintham/my-first-mcp-server

使用说明

🚀 MCP多业务服务器

全面 模型上下文协议(MCP) 集成的服务器 谷歌Colab, GitHub,以及 谷歌文件 随着 人工智能驱动的分析 实现无缝开发工作流自动化。

🌟 特性

🔗 多平台集成

  • 谷歌Colab -笔记本管理和分析
  • GitHub -存储库操作和代码见解
  • 谷歌文件 -文档管理和简历建设
  • AI分析 -由Google Gemini API提供支持

🤖 人工智能驱动能力

  • 智能README生成 -从笔记本创建专业文档
  • 代码分析 -全面的存储库见解和摘要
  • 恢复建筑 -自动生成专业配置文件的项目摘要
  • 智能解析 -提取库、依赖关系和项目结构

⚡ 自动化功能

  • 一键创建存储库 -将Colab笔记本转换为GitHub存储库
  • 交互式测试 -具有用户友好界面的全面测试套件
  • 批处理 -高效处理多个文件和存储库
  • 回退模式 -API不可用时性能下降

🚀 快速开始

1. 克隆并安装

git clone <https://github.com/sreerajchintham/my-first-mcp-server>
cd my-first-mcp-server
pip install -r requirements.txt

2. 配置API

# Set up Google APIs
python reauthorize_google_apis.py

# Create .env file
cp .env.example .env
# Edit .env with your API keys

3. 运行服务器

python mcp_server.py

4. 测试一切

python test_client.py

📋 先决条件

  • Python 3.8+
  • Google账户 具有驱动器访问权限
  • GitHub账号 带有个人访问令牌
  • Gemini API密钥 (可选,用于AI功能)

🛠️ 安装

选项1:开发设置

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # Linux/Mac
# .venv\Scripts\activate   # Windows

# Install dependencies
pip install -r requirements.txt

选项2:生产设置

# Use locked versions for reproducibility
pip install -r requirements-lock.txt

⚙️ 配置

1.谷歌API设置

  1. 在中创建项目 谷歌云控制台
  2. 启用 驱动API 和 API文档
  3. 创建 OAuth 2.0凭据 (桌面应用程序)
  4. 下载 client_secret.json → CREDENTIALS/client_secret.json
  5. 运行授权: python reauthorize_google_apis.py

2.GitHub API设置

  1. 首选 GitHub设置>个人访问令牌
  2. 使用创建令牌 repo 和 user 范围
  3. 增添 .env 文件

3.环境变量

# .env file
GOOGLE_CREDENTIALS_DIR=./CREDENTIALS
GOOGLE_TOKEN_FILE=token.json
GITHUB_TOKEN=your_github_token_here
GEMINI_API_KEY=your_gemini_api_key_here  # Optional

📚 用法

交互模式

python test_client.py
  • 浏览和分析GitHub存储库
  • 生成人工智能驱动的项目摘要
  • 创建专业文档
  • 管理Google Docs集成

程序化使用

from mcp.client.stdio import stdio_client
from mcp import StdioServerParameters

# Connect to MCP server
server_params = StdioServerParameters(
    command="python", 
    args=["mcp_server.py"]
)

# Use MCP tools
async with stdio_client(server_params) as (read, write):
    # ... MCP operations

🔧 可用工具

谷歌Colab工具

  • list_colab_files() -在Google云端硬盘中列出笔记本电脑
  • read_colab_notebook(file_id) -阅读笔记本内容
  • generate_readme(file_id, file_name) -AI驱动的README生成

GitHub工具

  • list_github_repos() -列出带有过滤器的存储库
  • read_github_repo_files(repo_name) -分析存储库文件
  • analyze_github_repo_with_ai(repo_name) -人工智能驱动的分析
  • create_github_repo() -从Colab笔记本创建仓库

谷歌文档工具

  • list_google_docs(search_term) -查找谷歌文档
  • create_google_doc(title, content) -创建新的Google文档
  • add_to_google_doc(doc_id, content) -向文档添加内容

实用工具

  • ping() -测试服务器连接
  • summarize_repo_analysis_for_resume() -生成简历摘要

🤖 AI分析类型

类型 描述 用例
全面的 对代码、文档和结构的全面分析 完整的项目概述
仅限README 专注于文档和描述 文档审查
仅限代码 深入了解代码结构和逻辑 技术评估
结构 项目组织和架构 架构审查

🔗 主要特点

GitHub分析与谷歌文档集成

  • 自动保存:将AI驱动的存储库分析直接保存到Google Docs
  • 文档选项:创建新文档或添加到现有文档中
  • 专业格式化:内容清晰、结构化,标题恰当
  • 交互式工作流:每次分析后提示选项
  • 搜索和选择:按搜索词查找和选择现有文档

增强的Google文档管理

  • 文档创建:使用初始内容创建新的Google文档
  • 内容添加:将格式化部分添加到现有文档中
  • 文档搜索:按关键字搜索和列出文档
  • 文档链接:创建/更新文档的直接链接

📊 集成示例

Claude桌面集成

{
  "mcpServers": {
    "multi-service-server": {
      "command": "python",
      "args": ["/path/to/mcp_server.py"],
      "cwd": "/path/to/project",
      "env": {
        "GOOGLE_CREDENTIALS_DIR": "/path/to/CREDENTIALS",
        "GITHUB_TOKEN": "your_token_here"
      }
    }
  }
}

简历构建工作流程

# 1. Analyze repository
analysis = await analyze_github_repo_with_ai("user/repo", "comprehensive")

# 2. Generate resume summary
summary = await summarize_repo_analysis_for_resume(
    "user/repo", 
    analysis, 
    "technical"
)

# 3. Add to Google Doc
await add_to_google_doc("doc_id", summary, "Projects")

GitHub对Google Docs工作流的分析

# 1. Analyze GitHub repository with AI
analysis = await analyze_github_repo_with_ai("user/repo", "comprehensive")

# 2. Option A: Create new document with analysis
doc_result = await create_google_doc(
    "GitHub Analysis - user/repo",
    analysis,
    "Repository Analysis"
)

# 2. Option B: Add analysis to existing document
await add_to_google_doc(
    "existing_doc_id",
    analysis,
    "GitHub Repository Analysis - user/repo"
)

🏗️ 项目结构

my-first-mcp-server/
├── 📄 mcp_server.py              # Main MCP server
├── 🧪 test_client.py             # Interactive test suite
├── 🧪 test_github_tool.py        # GitHub tool testing
├── 🔧 debug_mcp_connection.py    # MCP connection debugging
├── 🔑 reauthorize_google_apis.py # Google OAuth setup
├── ✅ validate_setup.py          # Dependency validation
├── 📋 requirements.txt           # Python dependencies
├── 🔒 requirements-lock.txt      # Locked versions
├── 📖 README.md                  # Project documentation
├── 📖 SETUP.md                   # Detailed setup guide
├── 🌍 .env                       # Environment variables
├── 📁 CREDENTIALS/               # OAuth credentials
│   ├── client_secret.json
│   └── token.json
└── 📁 support files/             # Configuration and support files
    ├── claude_desktop_config.json
    ├── cursor_mcp_config.json
    ├── cursor_mcp_config_final.json
    ├── CURSOR_FIX_GUIDE.md
    ├── CURSOR_SETUP_GUIDE.md
    ├── demo_readme.py
    ├── presentation_outline.md
    ├── render_deployment_guide.md
    └── run_env.py

🔍 故障排除

常见问题

问题 解决方案
Google身份验证错误 快跑 python reauthorize_google_apis.py
GitHub API错误 检查令牌权限和过期时间
Gemini API错误 验证API密钥和配额限制
导入错误 快跑 pip install -r requirements.txt

调试模式

import logging
logging.basicConfig(level=logging.DEBUG)

有效性检查

python validate_setup.py

🧪 测试

交互式测试

python test_client.py

README生成演示

python demo_readme.py

环境验证

python run_env.py

🤝 贡献

  1. 分叉 存储库
  2. 创建 特征分支(git checkout -b feature/amazing-feature)
  3. 提交 您的更改(git commit -m 'Add amazing feature')
  4. 推 到分行(git push origin feature/amazing-feature)
  5. 打开 拉取请求

📄 许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

🙏 致谢

  • 模型上下文协议 -对于优秀的MCP框架
  • 谷歌API -用于全面的服务集成
  • GitHub API -用于存储库管理功能
  • 谷歌双子座 -用于AI驱动的分析功能

📞 支持

  • 📖 文档:检查 设置.md 详细设置
  • 🐛 问题:通过GitHub Issues报告bug
  • 💬 讨论:使用GitHub讨论提问
  • 🧪 测试:运行 python test_client.py 用于交互式调试

⭐ 如果你觉得这个repo有用,请将其标记为星号!

由以下材料制成❤️ MCP社区