Athena MCP Server

Athena MCP Server

A comprehensive MCP server integrating OpenAI GPT models for AI-powered tasks like code analysis, generation, and translation, along with system utilities, Docker management, network diagnostics, and web tools.

Category
访问服务器

README

Athena MCP Server

A comprehensive Model Context Protocol (MCP) server that provides AI-powered tools and system utilities. This server integrates with OpenAI GPT models to deliver intelligent responses and analysis capabilities.

Features

Core AI Tools (OpenAI GPT-powered)

  • ask_athena: Intelligent AI assistant for general queries and problem-solving
  • analyze_code: Advanced code analysis with optimization suggestions
  • generate_code: Intelligent code generation based on requirements
  • text_summarize: AI-powered text summarization with customizable length and style
  • translate_text: Multi-language translation using OpenAI models
  • image_generate: DALL-E powered image generation

System & Development Tools

  • get_system_stats: Real-time system monitoring (CPU, memory, disk usage)
  • file_operations: Comprehensive file and directory management
  • process_monitor: System process monitoring and management
  • docker_manage: Docker container and image management
  • network_tools: Network diagnostics (ping, port scan, DNS lookup, traceroute)

Web & API Tools

  • web_request: HTTP client for API testing and web scraping
  • weather_info: Real-time weather information using OpenWeatherMap API
  • github_operations: GitHub repository management and code search

📁 Project Structure

Athena MCP/
├── app.js                 # Backend entry point
├── mcp-server.js          # MCP server for Trae integration
├── mcp-config.json        # MCP configuration file
├── package.json           # Backend dependencies
├── .env                   # Environment variables
├── tools/                 # Custom tools directory
│   └── get_cpu_stats.js   # CPU statistics tool
├── frontend/              # React frontend
│   ├── package.json       # Frontend dependencies
│   ├── public/
│   └── src/
│       ├── App.js         # Main React component
│       ├── App.css        # Component styles
│       ├── index.js       # React entry point
│       └── index.css      # Global styles
├── docker-compose.yml     # Docker orchestration
├── Dockerfile.backend     # Backend Docker image
└── README.md             # This file

🔌 MCP Integration with Trae

Quick Setup for Trae

  1. Install dependencies:

    npm install
    
  2. Start MCP server:

    npm run mcp
    
  3. Add to Trae configuration: Add this to your Trae MCP configuration:

    {
      "mcpServers": {
        "athena": {
          "command": "node",
          "args": ["mcp-server.js"],
          "cwd": "d:\\Projects\\Athena MCP"
        }
      }
    }
    

Available MCP Tools

Tool Name Description
ask_athena Ask Athena AI assistant questions and get intelligent responses powered by OpenAI GPT
get_system_stats Get detailed system CPU, memory, and performance statistics
analyze_code Analyze code snippets with AI-powered review, explain, optimize, or debug modes
generate_code Generate code based on requirements and specifications using OpenAI

MCP Tool Examples

Ask Athena:

{
  "name": "ask_athena",
  "arguments": {
    "prompt": "How do I optimize React performance?",
    "context": "Working on a large React application with performance issues"
  }
}

Get System Stats:

{
  "name": "get_system_stats",
  "arguments": {
    "detailed": true
  }
}

Analyze Code:

{
  "name": "analyze_code",
  "arguments": {
    "code": "function fibonacci(n) { return n <= 1 ? n : fibonacci(n-1) + fibonacci(n-2); }",
    "language": "javascript",
    "analysis_type": "optimize"
  }
}

🛠️ Setup & Installation

Prerequisites

  • Node.js 18+ and npm
  • (Optional) Docker and Docker Compose

Method 1: Local Development

  1. Clone and setup backend:

    cd "d:\Projects\Athena MCP"
    npm install
    
  2. Setup frontend:

    cd frontend
    npm install
    
  3. Configure environment:

    • Edit .env file and add your OpenAI API key:
    PORT=4000
    OPENAI_API_KEY=your_actual_api_key_here
    
  4. Run the applications:

    Terminal 1 (Backend):

    npm start
    # Backend runs on http://localhost:4000
    

    Terminal 2 (Frontend):

    cd frontend
    npm start
    # Frontend runs on http://localhost:3000
    

Method 2: Docker Compose

  1. Set environment variables:

    # Create .env file with your API key
    echo "OPENAI_API_KEY=your_actual_api_key_here" > .env
    
  2. Run with Docker:

    docker-compose up --build
    

    This will start:

    • Backend on http://localhost:4000
    • Frontend on http://localhost:3000

🔌 API Endpoints

Backend API (Port 4000)

Method Endpoint Description
GET / API information and available endpoints
POST /ask Send a prompt to Athena AI
GET /cpu Get system CPU and memory statistics
GET /health Health check endpoint

Example API Usage

Ask Athena a question:

curl -X POST http://localhost:4000/ask \
  -H "Content-Type: application/json" \
  -d '{"prompt": "What is artificial intelligence?"}'

Get CPU statistics:

curl http://localhost:4000/cpu

🎨 Frontend Features

  • Modern UI: Clean, responsive design with gradient backgrounds
  • Real-time Interaction: Instant feedback and loading states
  • Error Handling: User-friendly error messages
  • Mobile Responsive: Works on all device sizes
  • System Monitoring: Visual display of CPU and memory stats

🔧 Development

Adding New Tools

  1. Create a new file in the tools/ directory:

    // tools/my_new_tool.js
    function myNewTool() {
      // Your tool logic here
      return { result: "Tool output" };
    }
    
    module.exports = { myNewTool };
    
  2. Import and use in app.js:

    const { myNewTool } = require('./tools/my_new_tool');
    
    app.get('/my-endpoint', (req, res) => {
      const result = myNewTool();
      res.json(result);
    });
    

Environment Variables

Variable Description Default
PORT Backend server port 4000
OPENAI_API_KEY OpenAI API key for AI features Required
NODE_ENV Environment mode development

🐳 Docker Commands

# Build and run
docker-compose up --build

# Run in background
docker-compose up -d

# Stop services
docker-compose down

# View logs
docker-compose logs -f

# Rebuild specific service
docker-compose build backend
docker-compose build frontend

🚀 Production Deployment

  1. Set production environment variables
  2. Build optimized frontend:
    cd frontend
    npm run build
    
  3. Use process manager like PM2:
    npm install -g pm2
    pm2 start app.js --name athena-backend
    

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

📝 License

MIT License - feel free to use this project for your own purposes.

🆘 Troubleshooting

Backend won't start:

  • Check if port 4000 is available
  • Verify Node.js version (18+)
  • Check .env file configuration

Frontend can't connect to backend:

  • Ensure backend is running on port 4000
  • Check CORS configuration
  • Verify API_BASE_URL in frontend

Docker issues:

  • Ensure Docker is running
  • Check port conflicts
  • Verify environment variables in docker-compose.yml

Happy coding! 🎉

推荐服务器

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

官方
精选