๐Ÿš€ DevAssist MCP Server

A production-ready Python MCP Server for GitHub & Competitive Programming

PythonMCPLicenseDocker

๐Ÿ“– Overview

DevAssist MCP is a Model Context Protocol (MCP) server that bridges the gap between AI assistants and developer resources. It exposes two powerful tools โ€” GitHub Assistant and Competitive Programming Assistant โ€” that any MCP-compatible AI agent (Claude Desktop, Cursor, VS Code Copilot) can use to fetch real-time data.

โœจ Key Features

Feature Description
๐Ÿ™ GitHub Integration User profiles, repo info, commits, PRs, issues, statistics
๐Ÿ† Codeforces Integration Profiles, contest history, rating tracking, submissions
๐Ÿง  Weak Topic Analysis AI-powered identification of competitive programming weak areas
๐Ÿ’ก Smart Recommendations Personalized problem suggestions based on skill gaps
โšก Async Architecture Non-blocking I/O with httpx for maximum performance
๐Ÿ”’ Production Ready Logging, error handling, type safety, comprehensive tests

๐Ÿ—๏ธ Architecture

graph TD
    A["๐Ÿค– AI Agent<br/>(Claude / Cursor / VS Code)"] -->|MCP Protocol| B["โš™๏ธ DevAssist MCP Server"]
    B --> C["๐Ÿ™ github_assistant"]
    B --> D["๐Ÿ† cp_assistant"]
    C --> E["GitHub Service Layer"]
    D --> F["Codeforces Service Layer"]
    E -->|httpx async| G["GitHub REST API v3"]
    F -->|httpx async| H["Codeforces API"]
    
    style A fill:#4A90D9,stroke:#2C5F99,color:#fff
    style B fill:#6C3483,stroke:#4A235A,color:#fff
    style C fill:#27AE60,stroke:#1E8449,color:#fff
    style D fill:#E67E22,stroke:#CA6F1E,color:#fff

๐Ÿ“‹ Prerequisites

  • Python 3.12+
  • GitHub Personal Access Token (Generate here) โ€” for higher API rate limits
  • pip or uv package manager

๐Ÿ’ป Installation

Option 1: Using uv (Recommended)

# Clone the repository
git clone https://github.com/your-username/devassist-mcp.git
cd devassist-mcp

# Create virtual environment and install dependencies
uv venv
uv pip install -r requirements.txt

Option 2: Using pip

# Clone the repository
git clone https://github.com/your-username/devassist-mcp.git
cd devassist-mcp

# Create virtual environment
python -m venv venv

# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

โš™๏ธ Configuration

  1. Copy the environment template:

    cp .env.example .env
    
  2. Edit .env with your settings:

    GITHUB_TOKEN=ghp_your_personal_access_token_here
    LOG_LEVEL=INFO
    

Note: The GitHub token is optional but recommended. Without it, you're limited to 60 API requests/hour. With a token, you get 5,000 requests/hour.

๐Ÿš€ Usage

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "devassist-mcp": {
      "command": "python",
      "args": ["C:/path/to/devassist-mcp/server.py"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

Cursor

Add to your Cursor MCP settings (.cursor/mcp.json):

{
  "mcpServers": {
    "devassist-mcp": {
      "command": "python",
      "args": ["C:/path/to/devassist-mcp/server.py"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

VS Code (with Copilot)

Add to your VS Code settings:

{
  "mcp": {
    "servers": {
      "devassist-mcp": {
        "command": "python",
        "args": ["C:/path/to/devassist-mcp/server.py"],
        "env": {
          "GITHUB_TOKEN": "ghp_your_token_here"
        }
      }
    }
  }
}

Running Standalone

python server.py

๐Ÿ› ๏ธ Tool Documentation

Tool 1: github_assistant

Action Description Requires repository
get_user_profile Get GitHub user profile โŒ
get_user_repos List all public repositories owned by a user โŒ
get_user_activity Get recent user activity (commits, PRs, stars) โŒ
get_repo_info Get repository details โœ…
get_latest_commits Get recent commits โœ…
get_repo_stats Get repository statistics โœ…
get_repo_languages Detailed programming language percentage breakdown โœ…
get_repo_contributors Top code contributors to a repository โœ…
get_latest_release Latest release version & release notes โœ…
get_pull_requests Get pull requests โœ…
get_issues Get repository issues โœ…

Example โ€” Get User Profile:

"Show me the GitHub profile of octocat"
{
  "login": "octocat",
  "name": "The Octocat",
  "public_repos": 42,
  "followers": 20000,
  "location": "San Francisco"
}

Example โ€” Get Repo Stats:

"What are the stats for octocat/Hello-World?"
{
  "repository": "octocat/Hello-World",
  "stars": 2500,
  "forks": 450,
  "language": "Python",
  "open_issues": 12
}

Tool 2: cp_assistant

Action Description
get_user_profile Get Codeforces rating and rank
get_contest_history Past contest participation
get_recent_submissions Recent problem submissions
get_rating_history Rating changes over time
analyze_weak_topics Identify weak problem areas
recommend_problems Personalized problem suggestions

Example โ€” Analyze Weak Topics:

"Analyze the weak topics for Codeforces user tourist"
[
  {
    "tag": "geometry",
    "total_attempts": 15,
    "successful": 5,
    "failed": 10,
    "success_rate": 33.3
  }
]

Example โ€” Get Recommendations:

"Recommend practice problems for my Codeforces handle"
[
  {
    "name": "Theatre Square",
    "rating": 1000,
    "tags": ["math"],
    "url": "https://codeforces.com/problemset/problem/1/A"
  }
]

๐Ÿงช Testing

# Run all tests
pytest tests/ -v

# Run with coverage
pytest tests/ -v --cov=. --cov-report=term-missing

# Run specific test file
pytest tests/test_github_service.py -v

# Run specific test
pytest tests/test_codeforces_service.py::test_analyze_weak_topics -v

๐Ÿ“ Project Structure

devassist-mcp/
โ”œโ”€โ”€ server.py                          # MCP server entry point
โ”œโ”€โ”€ config.py                          # Pydantic settings
โ”œโ”€โ”€ .env.example                       # Environment template
โ”œโ”€โ”€ requirements.txt                   # Dependencies
โ”œโ”€โ”€ pyproject.toml                     # Project metadata & tool configs
โ”œโ”€โ”€ Dockerfile                         # Multi-stage Docker build
โ”œโ”€โ”€ .dockerignore                      # Docker build exclusions
โ”œโ”€โ”€ .gitignore                         # Git exclusions
โ”œโ”€โ”€ README.md                          # This file
โ”œโ”€โ”€ tools/
โ”‚   โ”œโ”€โ”€ github.py                      # GitHub MCP tool
โ”‚   โ””โ”€โ”€ cp.py                          # Codeforces MCP tool
โ”œโ”€โ”€ services/
โ”‚   โ”œโ”€โ”€ github_service.py              # GitHub API client
โ”‚   โ””โ”€โ”€ codeforces_service.py          # Codeforces API client
โ”œโ”€โ”€ models/
โ”‚   โ”œโ”€โ”€ github_models.py               # GitHub Pydantic models
โ”‚   โ””โ”€โ”€ cp_models.py                   # Codeforces Pydantic models
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ logger.py                      # Structured logging
โ”‚   โ””โ”€โ”€ exceptions.py                  # Custom exception hierarchy
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ conftest.py                    # Shared test fixtures
โ”‚   โ”œโ”€โ”€ test_github_service.py         # GitHub service tests
โ”‚   โ”œโ”€โ”€ test_codeforces_service.py     # Codeforces service tests
โ”‚   โ”œโ”€โ”€ test_github_tool.py            # GitHub tool tests
โ”‚   โ””โ”€โ”€ test_cp_tool.py               # Codeforces tool tests
โ””โ”€โ”€ logs/                              # Log files (auto-created)

๐Ÿณ Deployment

Docker

# Build the image
docker build -t devassist-mcp .

# Run the container
docker run -e GITHUB_TOKEN=ghp_your_token devassist-mcp

Railway

  1. Connect your GitHub repository
  2. Set environment variable: GITHUB_TOKEN
  3. Deploy โ€” Railway auto-detects the Dockerfile

Render

  1. Create a new Background Worker
  2. Connect your repository
  3. Set build command: pip install -r requirements.txt
  4. Set start command: python server.py
  5. Add environment variable: GITHUB_TOKEN

๐Ÿ”ฎ Future Enhancements

  • ๐ŸŸก LeetCode integration
  • ๐ŸŸ  CodeChef integration
  • ๐Ÿ”ต Response caching with TTL
  • ๐ŸŸข Request history tracking
  • ๐ŸŸฃ WebSocket support for live updates
  • โšช Multi-language support

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Code Quality

# Format code
black .

# Lint
ruff check .

# Type check
mypy .

๐Ÿ“„ License

This project is licensed under the MIT License. See LICENSE for details.

Built with โค๏ธ using Python, FastMCP, and httpx

MCP Server ยท Populars

MCP Server ยท New

    laurentvv

    Web Crawler MCP

    Web crawling tool that integrates with AI assistants via the MCP

    Community laurentvv
    anypost

    emailmd

    Render markdown into email-safe HTML

    Community anypost
    dinglebear-ai

    Unraid MCP

    Query, monitor, and manage Unraid servers via GraphQL API through MCP tools. Supports system info, Docker, VMs, array/parity, notifications, plugins, rclone, and live telemetry.

    Community dinglebear-ai
    superbasedapp

    SuperBased Observer

    Local-first control plane for AI coding agents โ€” launch browser terminals, run and remotely control sessions, and track files, tokens & cost across Claude Code, Codex, Cursor, Gemini CLI and 20+ more. 100% local, no telemetry.

    Community superbasedapp
    OpenMarkdown-dev

    OpenMarkdown

    Feather-light. Light-speed.

    Community OpenMarkdown-dev