Skip to main content
Glama
toannguyen3107

Bug Bounty Platform MCP Server

README.md
# Bug Bounty Platform MCP Server

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![MCP](https://img.shields.io/badge/Protocol-MCP-green.svg)](https://modelcontextprotocol.io/)

A unified **Model Context Protocol (MCP)** server enabling AI coding assistants and autonomous agents (**DeepSeek Harness**, **Claude Desktop / Claude Code**, **Cursor**, **Windsurf**, **Antigravity**) to interact with major bug bounty platforms using personal researcher API keys and access tokens.

Supported platforms:
- **HackerOne** (Hacker API v1)
- **YesWeHack** (Researcher API)
- **Intigriti** (Researcher External API v1)

---

## 🌟 Key Features

1. **Unified Multi-Platform Tools**: Single point of interaction to browse programs, read policies, and fetch structured scopes across HackerOne, YesWeHack, and Intigriti.
2. **Intelligent Scope Matcher**: Check if an IP, CIDR block, domain, wildcard (`*.example.com`), or URL prefix belongs to an active program scope.
3. **Graceful Fallback**: Missing API keys for any platform will not crash the server. Only unconfigured platforms are disabled with helpful reminders.
4. **Token-Efficient & Normalized**: All vendor-specific schemas (JSON:API, OpenAPI, REST) are parsed and normalized into compact, standardized Pydantic models.
5. **Live & Stateless**: Direct API calls ensure real-time accuracy without stale local caches.

---

## πŸ— Architecture

```
[ AI Assistant / Agent (DeepSeek Harness, Claude, Cursor) ]
                          β”‚ (JSON-RPC over stdio)
                          β–Ό
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚   Bounty Platform MCP Serverβ”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β–Ό                  β–Ό                  β–Ό
[HackerOne Client] [YesWeHack Client] [Intigriti Client]
 (Basic Auth)        (Bearer Token)     (Bearer Token)
        β”‚                  β”‚                  β”‚
        β–Ό                  β–Ό                  β–Ό
 api.hackerone.com  api.yeswehack.com  api.intigriti.com
```

---

## πŸš€ Quick Start

### 1. Installation

Clone the repository:
```bash
git clone https://github.com/toannguyen3107/bounty_platform_mcp.git
cd bounty_platform_mcp
```

Create a virtual environment and install dependencies using `uv` (recommended) or `pip`:

Using `uv`:
```bash
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -e .
```

Using `pip`:
```bash
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -e .
```

### 2. Configure Credentials

Copy `.env.example` to `.env`:
```bash
cp .env.example .env
```

Edit `.env` with your API credentials:
```env
# HackerOne API Credentials (Basic Auth)
# Generate from HackerOne: Settings -> API Tokens
H1_USERNAME=your_hackerone_username
H1_API_KEY=your_hackerone_api_token

# YesWeHack API Token (Bearer Auth)
# Generate from YesWeHack: Profile -> My YesWeHack Tools -> Personal Access Tokens
YWH_API_TOKEN=your_yeswehack_token

# Intigriti Researcher API Token (Bearer Auth)
# Generate from Intigriti: Settings -> API
INTIGRITI_API_TOKEN=your_intigriti_token
```

> **Note**: You only need to configure the platforms you use. Any platform without credentials will be gracefully skipped.

---

## πŸ”Œ Connecting to AI Agents

### 1. DeepSeek Harness (`dsh`)

Add the MCP server to your DeepSeek Harness configuration (e.g. `~/.dsh/settings.yaml` or harness plugin configuration):

```yaml
mcpServers:
  bounty:
    command: "python"
    args:
      - "C:/Toan/Tools/bounty_platform_mcp/run_server.py"
    env:
      H1_USERNAME: "your_hackerone_username"
      H1_API_KEY: "your_hackerone_api_token"
      YWH_API_TOKEN: "your_yeswehack_token"
      INTIGRITI_API_TOKEN: "your_intigriti_token"
```

### 2. Claude Desktop (`claude_desktop_config.json`)

On Windows: `%APPDATA%\Claude\claude_desktop_config.json`  
On macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`

```json
{
  "mcpServers": {
    "bounty-platform": {
      "command": "C:\\Toan\\Tools\\bounty_platform_mcp\\.venv\\Scripts\\python.exe",
      "args": [
        "C:\\Toan\\Tools\\bounty_platform_mcp\\run_server.py"
      ],
      "env": {
        "H1_USERNAME": "your_hackerone_username",
        "H1_API_KEY": "your_hackerone_api_token",
        "YWH_API_TOKEN": "your_yeswehack_token",
        "INTIGRITI_API_TOKEN": "your_intigriti_token"
      }
    }
  }
}
```

### 3. Cursor (`.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "bounty-platform": {
      "command": "python",
      "args": ["C:/Toan/Tools/bounty_platform_mcp/run_server.py"],
      "env": {
        "H1_USERNAME": "your_hackerone_username",
        "H1_API_KEY": "your_hackerone_api_token",
        "YWH_API_TOKEN": "your_yeswehack_token",
        "INTIGRITI_API_TOKEN": "your_intigriti_token"
      }
    }
  }
}
```

---

## πŸ›  Available MCP Tools

| Tool | Parameters | Description |
| :--- | :--- | :--- |
| `bounty_get_platforms_status` | *(none)* | Inspect which platforms are configured and see any missing environment variables. |
| `bounty_search_programs` | `query`, `platform`, `bbp_only`, `public_only` | Search bug bounty programs across one or all platforms (`all`, `hackerone`, `yeswehack`, `intigriti`). |
| `bounty_get_program` | `platform`, `identifier` | Fetch detailed program specifications, policies, testing restrictions, and maximum bounties. |
| `bounty_get_scope` | `platform`, `identifier`, `include_oos` | Retrieve all structured in-scope and out-of-scope targets (domains, CIDRs, mobile packages, etc.). |
| `bounty_check_target` | `target`, `platform` | Determine if an asset (`api.target.com`, `10.0.0.1`, `https://target.com/v1`) matches any program scope. |

---

## πŸ§ͺ Testing & Verification

Run the comprehensive unit test suite:

```bash
pytest -v
```

Output:
```text
tests/test_config_models.py ................. [ 10%]
tests/test_matcher.py ....................... [ 28%]
tests/test_http_client.py ................... [ 39%]
tests/test_hackerone.py ..................... [ 53%]
tests/test_yeswehack.py ..................... [ 67%]
tests/test_intigriti.py ..................... [ 82%]
tests/test_manager.py ....................... [ 92%]
tests/test_server.py ........................ [100%]
============================= 28 passed in 1.74s ==============================
```

---

## πŸ“„ License

MIT License. See [LICENSE](LICENSE) for details.

TDQS

A3.9/5.0

Scored across 5 tools

Disambiguation4/5

Each tool targets a distinct action (search, get details, get scope, check target, platform status), but there is minor overlap between bounty_get_program (which includes scope) and bounty_get_scope (structured scope only). The descriptions clarify the difference, so agents can reliably choose correctly.

Naming Consistency5/5

All tool names share the 'bounty_' prefix and follow a consistent verb_noun pattern: search_programs, get_program, get_scope, check_target, get_platforms_status. This makes the API predictable and easy to navigate.

Tool Count5/5

Five tools is well-scoped for this read-only bug bounty program intelligence server. Each tool has a clearly necessary roleβ€”searching, retrieving program details, fetching structured scope, verifying targets, and checking platform connectivityβ€”no unnecessary bloat or missing critical operations.

Completeness4/5

The core workflows of discovering and assessing bug bounty programs are well covered: searching programs, reading full policies, inspecting scope, checking target eligibility, and monitoring platform status. Minor gaps include the lack of a dedicated 'list all programs' endpoint, though this can be achieved via an empty search query, and the server intentionally omits submission or hunting features, which appear outside its scope.

Maintenance

ActivityMaintained
ResponsivenessNo issues