Fast MCP Task Manager

Fast MCP Task Manager

Enables AI-powered task management with Google Gemini integration, providing CRUD operations, task analytics, CSV export, and natural language interaction for comprehensive project management.

Category
访问服务器

README

Fast MCP Server with Google Gemini Integration

A comprehensive Model Context Protocol (MCP) server built with FastAPI that integrates with Google Gemini CLI for AI-powered task management and data processing.

🚀 Features

  • FastAPI-based MCP Server: High-performance async server running on port 5000
  • Google Gemini Integration: Seamless integration with Gemini CLI for AI responses
  • Task Management Tools: Complete CRUD operations for task management
  • Data Analytics: Task statistics and CSV export capabilities
  • Comprehensive Logging: JSON-based operation logging for tracking and debugging
  • CLI Interface: Easy-to-use command-line tool for server interaction
  • RESTful API: Full API documentation with Swagger UI
  • Production Ready: Modular, clean, and well-documented code

📋 Prerequisites

  • Python 3.8 or higher
  • Google Gemini CLI installed and configured
  • curl (for CLI operations)
  • Git (for cloning the repository)

🛠️ Installation

1. Clone the Repository

git clone <repository-url>
cd FAST_MCP

2. Create Virtual Environment

python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Install Google Gemini CLI

Follow the official Gemini CLI installation guide:

Make sure Gemini CLI is properly configured with your API key.

🚀 Quick Start

Start the Server

./mcp_cli.sh start

The server will start on http://localhost:5000

Check Server Status

./mcp_cli.sh status

List Available Tools

./mcp_cli.sh list

Use MCP Tools

# List all tasks
./mcp_cli.sh run list_tasks

# Create a new task
./mcp_cli.sh run create_task "Implement authentication" "Add JWT-based auth" "high"

# Update task status
./mcp_cli.sh run update_task_status 1 "in_progress"

# Search tasks
./mcp_cli.sh run search_tasks "authentication"

# Get task statistics
./mcp_cli.sh run get_task_statistics

# Export tasks to CSV
./mcp_cli.sh run export_tasks_to_csv

Interact with Gemini

./mcp_cli.sh gemini "What are the best practices for API security?"

View Logs

./mcp_cli.sh logs

Stop the Server

./mcp_cli.sh stop

📚 API Documentation

Once the server is running, visit:

  • Swagger UI: http://localhost:5000/docs
  • ReDoc: http://localhost:5000/redoc

🔧 Available MCP Tools

1. list_tasks

  • Description: List all tasks with optional status filtering
  • Parameters:
    • status_filter (optional): Filter by status (pending, in_progress, completed)
  • Example: ./mcp_cli.sh run list_tasks pending

2. create_task

  • Description: Create a new task
  • Parameters:
    • title (required): Task title
    • description (required): Task description
    • priority (optional): Priority level (low, medium, high)
    • assigned_to (optional): User ID to assign the task
  • Example: ./mcp_cli.sh run create_task "New Feature" "Implement user dashboard" "high" "dev1"

3. update_task_status

  • Description: Update the status of an existing task
  • Parameters:
    • task_id (required): ID of the task to update
    • new_status (required): New status (pending, in_progress, completed)
  • Example: ./mcp_cli.sh run update_task_status 1 "completed"

4. get_task_statistics

  • Description: Get comprehensive task statistics and analytics
  • Parameters: None
  • Example: ./mcp_cli.sh run get_task_statistics

5. search_tasks

  • Description: Search tasks by title or description
  • Parameters:
    • query (required): Search query string
  • Example: ./mcp_cli.sh run search_tasks "authentication"

6. export_tasks_to_csv

  • Description: Export all tasks to a CSV file
  • Parameters: None
  • Example: ./mcp_cli.sh run export_tasks_to_csv

🤖 Gemini Integration

The server integrates with Google Gemini CLI to provide AI-powered responses:

Features

  • Multi-turn Conversations: Maintains context across interactions
  • Error Handling: Graceful handling of CLI failures and timeouts
  • Logging: All Gemini interactions are logged for tracking
  • Timeout Protection: 30-second timeout to prevent hanging requests

Usage Examples

# Technical questions
./mcp_cli.sh gemini "How do I implement JWT authentication in FastAPI?"

# Code review
./mcp_cli.sh gemini "Review this Python function for best practices"

# Documentation help
./mcp_cli.sh gemini "Generate API documentation for a task management system"

📁 Project Structure

FAST_MCP/
├── server.py              # Main FastAPI server
├── requirements.txt       # Python dependencies
├── mcp_cli.sh            # CLI interface script
├── sample_data.json      # Sample task data
├── README.md             # This file
├── venv/                 # Virtual environment (created during setup)
├── server.log            # Server logs (created when running)
├── mcp_logs.json         # MCP operation logs (created when running)
└── tasks_export_*.csv    # Exported CSV files (created when exporting)

🔍 Logging and Monitoring

Operation Logs

All MCP tool calls and Gemini interactions are logged to mcp_logs.json:

{
  "timestamp": "2024-01-17T10:30:00Z",
  "operation": "mcp_tool_call",
  "tool_name": "create_task",
  "success": true,
  "result": {...},
  "error": null
}

Server Logs

Server logs are written to server.log and include:

  • Server startup/shutdown events
  • Request/response details
  • Error messages and stack traces
  • Performance metrics

Health Monitoring

Check server health at any time:

./mcp_cli.sh health

🛡️ Error Handling

The server includes comprehensive error handling:

  • Tool Validation: Validates tool names and parameters
  • Data Persistence: Handles file I/O errors gracefully
  • Gemini CLI Integration: Manages CLI failures and timeouts
  • HTTP Errors: Proper HTTP status codes and error messages
  • Logging: All errors are logged for debugging

🔧 Configuration

Server Configuration

  • Port: 5000 (configurable in server.py)
  • Host: 0.0.0.0 (all interfaces)
  • Data File: sample_data.json
  • Log File: mcp_logs.json

Gemini CLI Configuration

Ensure Gemini CLI is properly configured:

gemini config set api_key YOUR_API_KEY

🚀 Deployment

Development

./mcp_cli.sh start

Production

For production deployment, consider:

  • Using a process manager like PM2 or systemd
  • Setting up reverse proxy with Nginx
  • Implementing proper authentication
  • Adding rate limiting
  • Setting up monitoring and alerting

🧪 Testing

Manual Testing

  1. Start the server: ./mcp_cli.sh start
  2. Test each tool: ./mcp_cli.sh run <tool_name>
  3. Test Gemini integration: ./mcp_cli.sh gemini "test prompt"
  4. Check logs: ./mcp_cli.sh logs
  5. Verify health: ./mcp_cli.sh health

API Testing

Use the Swagger UI at http://localhost:5000/docs to test API endpoints directly.

📊 Sample Data

The project includes sample_data.json with:

  • 5 sample tasks with different statuses and priorities
  • 4 user profiles with roles and departments
  • 2 project definitions with team assignments

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes
  4. Test thoroughly
  5. Commit your changes: git commit -m "Add feature"
  6. Push to the branch: git push origin feature-name
  7. Submit a pull request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Troubleshooting

Common Issues

  1. Server won't start

    • Check if port 5000 is available
    • Verify virtual environment is activated
    • Check server.log for error details
  2. Gemini CLI not found

    • Install Gemini CLI: pip install google-generativeai
    • Configure API key: gemini config set api_key YOUR_KEY
  3. Permission denied on mcp_cli.sh

    • Make executable: chmod +x mcp_cli.sh
  4. Data file errors

    • Check file permissions
    • Verify JSON format in sample_data.json

Getting Help

  • Check the logs: ./mcp_cli.sh logs
  • Review server logs: tail -f server.log
  • Test server health: ./mcp_cli.sh health
  • Check API documentation: http://localhost:5000/docs

🎯 Roadmap

  • [ ] Add user authentication and authorization
  • [ ] Implement real-time notifications
  • [ ] Add more MCP tools (file processing, email, etc.)
  • [ ] Create web dashboard
  • [ ] Add unit and integration tests
  • [ ] Implement caching for better performance
  • [ ] Add Docker support
  • [ ] Create CI/CD pipeline

📞 Support

For support and questions:

  • Create an issue in the repository
  • Check the troubleshooting section
  • Review the API documentation

Built with ❤️ using FastAPI and Google Gemini

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选