Google Drive HPC Log Analyzer

Google Drive HPC Log Analyzer

Enables Claude to directly access Google Drive files and analyze High Performance Computing (HPC) log files. Automatically detects common HPC issues like memory errors, job timeouts, and resource allocation problems.

Category
访问服务器

README

Google Drive HPC Log Analyzer

A Model Context Protocol (MCP) server that brings Google Drive integration to Claude Desktop, with specialized tools for analyzing High Performance Computing (HPC) log files.

Overview

This MCP server enables Claude to directly access your Google Drive files and intelligently analyze HPC job logs, helping you quickly identify errors, warnings, and resource issues without leaving the Claude Desktop interface.

Features

  • Google Drive Integration: Search, list, and read files directly from Google Drive
  • HPC Log Analysis: Automatic detection of common HPC issues:
    • Out of memory (OOM) errors
    • Job timeouts and time limit issues
    • Failed jobs and fatal errors
    • Resource allocation problems
  • Smart Search: Quickly find log files (.log, .out, .err) across your Drive
  • Read-Only Access: Secure, read-only access to your Google Drive
  • Persistent Authentication: One-time OAuth setup with automatic token refresh

Prerequisites

  • Python 3.7+
  • Claude Desktop installed
  • Google Cloud account (free tier works fine)
  • pip for package management

Quick Start

1. Clone the Repository

git clone https://github.com/minitim222/gdrive_hpc_mcp.git
cd gdrive_hpc_mcp

2. Install Dependencies

pip install -r requirements.txt

3. Set Up Google Cloud Credentials

Follow the detailed SETUP_GUIDE.md to:

  1. Create a Google Cloud project
  2. Enable the Google Drive API
  3. Download OAuth credentials as credentials.json

4. Configure Claude Desktop

Run the automatic configuration script:

python configure_claude.py

Or manually edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "gdrive-hpc": {
      "command": "python",
      "args": ["/absolute/path/to/gdrive_hpc_mcp/server.py"]
    }
  }
}

5. Authenticate

Run the server once to authenticate:

python server.py

This will open your browser for Google OAuth authentication.

6. Restart Claude Desktop

Quit and restart Claude Desktop. Look for the 🔌 icon to confirm the MCP server is loaded.

Usage Examples

Once set up, you can ask Claude things like:

"Search for log files in my Google Drive"
"Analyze the latest job.log file and tell me why it failed"
"Find all HPC logs from last week"
"Read the error log from my simulations folder"

Available Tools

The MCP server provides these tools to Claude:

list_drive_files

Search and list files in Google Drive with optional queries and folder filtering.

Parameters:

  • query (str): Search query (e.g., "name contains 'log'")
  • max_results (int): Maximum number of results (default: 10)
  • folder_id (str, optional): Specific folder ID to search within

read_drive_file

Read the contents of a file from Google Drive.

Parameters:

  • file_id (str): Google Drive file ID

analyze_hpc_log

Analyze an HPC log file and provide insights.

Parameters:

  • file_id (str): Google Drive file ID of the log file

Returns:

  • File metadata (name, size, line count)
  • List of errors found
  • List of warnings found
  • Actionable suggestions for fixing issues

search_hpc_logs

Search specifically for HPC log files (.log, .out, .err extensions).

Parameters:

  • search_term (str): Search term (default: "*.log")
  • folder_id (str, optional): Folder to search within
  • max_results (int): Maximum results (default: 20)

Security

  • Read-Only Access: The server only requests read permissions to Google Drive
  • Local Credentials: All authentication tokens are stored locally on your machine
  • No Third-Party Access: Your Google Drive data is accessed directly by Claude running locally
  • Gitignored Secrets: credentials.json and token.pickle are excluded from version control

Important: Never commit credentials.json or token.pickle to public repositories.

File Structure

gdrive_hpc_mcp/
├── server.py              # Main MCP server
├── configure_claude.py    # Claude Desktop config helper
├── test_auth.py          # Authentication test script
├── install.sh            # Installation script
├── requirements.txt      # Python dependencies
├── SETUP_GUIDE.md       # Detailed setup instructions
├── README.md            # This file
├── .gitignore           # Excludes credentials
└── credentials.json     # Your OAuth credentials (not in repo)

Troubleshooting

"credentials.json not found"

Make sure you've downloaded the OAuth client credentials from Google Cloud Console and placed them in the project directory.

"Module not found" errors

Install dependencies: pip install -r requirements.txt

MCP tools don't appear in Claude

  • Verify claude_desktop_config.json syntax is valid JSON
  • Check that the file path is absolute, not relative
  • Restart Claude Desktop completely

Authentication issues

Delete token.pickle and run python server.py to re-authenticate.

See SETUP_GUIDE.md for more detailed troubleshooting.

Development

Testing Authentication

python test_auth.py

Running the Server Directly

python server.py

Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest new features
  • Submit pull requests

License

MIT License - feel free to use and modify as needed.

Resources

Acknowledgments

Built with FastMCP - a Python framework for creating MCP servers.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选