Skip to main content
Glama
BugBounty Forum MCP

BugBounty Forum MCP

by Ximeeek
README.md
# BugBounty Forum MCP

[![CI](https://github.com/Ximeeek/bugbounty-forum-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/Ximeeek/bugbounty-forum-mcp/actions/workflows/ci.yml)
[![Node.js](https://img.shields.io/badge/Node.js-%3E%3D22-43853d)](https://nodejs.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

**Live bug-bounty discussions, structured for AI research.**

A read-only [Model Context Protocol](https://modelcontextprotocol.io/) server for public posts and conversations on [bugbounty.forum](https://bugbounty.forum/). Search posts **and comments**, retrieve nested reply context, inspect public author activity, and extract cited references without building a local copy of the forum.

**No account, API key, OAuth setup, browser automation, or content database required.** The server uses the anonymous read endpoints used by the site's frontend. This is an independent community integration, not an official or operator-supported API.

[Polski / Polish documentation](README.pl.md) · [Access research](docs/access-research.md) · [Feature research](docs/feature-research.md) · [Validation evidence](docs/validation.md)

## Why a dedicated MCP?

A normal HTTP request to a forum page returns a JavaScript application shell rather than the discussion. The useful material often lives several replies deep, where a search excerpt loses the context.

This adapter turns the frontend's public JSON responses into bounded, citable evidence:

- Search results distinguish posts from comments and link back to their source.
- Thread reads preserve parent IDs, depth, authors, original timestamps, and deletion markers.
- Coverage separates missing replies, output windows, text truncation, and counter disagreement.
- Poll choices and vote counts survive normalization; media remains link metadata.
- Native search quirks are reported explicitly rather than disguised as complete results.

Forum content remains untrusted research material. Popularity and badges are context, not technical verification.

## Quick start

Requirements: **Node.js 22+**, npm, and network access to the public forum backend.

```bash
git clone https://github.com/Ximeeek/bugbounty-forum-mcp.git
cd bugbounty-forum-mcp
npm ci
npm run build
node dist/cli.js doctor
node dist/cli.js check
```

- `doctor` prints local configuration without contacting the forum.
- `check` requires a real parsed public post to succeed and exits nonzero otherwise.
- `serve` starts MCP over stdio; it is also the default command.

The package is not currently published to npm. Install from this repository rather than assuming a similarly named npm package is this project.

## Connect an MCP client

Add the following entry to a client that supports local stdio MCP servers. **Replace the path with your checkout's absolute path.**

```json
{
  "mcpServers": {
    "bugbounty-forum": {
      "command": "node",
      "args": [
        "/absolute/path/to/bugbounty-forum-mcp/dist/cli.js",
        "serve"
      ],
      "env": {
        "BBF_REQUEST_INTERVAL_MS": "1000",
        "BBF_CACHE_TTL_MS": "30000"
      }
    }
  }
}
```

For Windows, use a path such as `C:/projects/bugbounty-forum-mcp/dist/cli.js`. A portable template is included in [mcp.example.json](mcp.example.json).

Use `node` directly in the client configuration: stdout belongs to MCP JSON-RPC. `npm start` is a terminal convenience and can print npm lifecycle messages. Client configuration is not changed automatically.

## Tools

All **12 tools** are read-only.

| Tool | Purpose | Main arguments |
| --- | --- | --- |
| `forum_status` | Verify real public access; inspect transport/cache controls and upstream limitations. | `fresh` |
| `list_posts` | Browse native feeds, keeping ordinary and lower-ranked posts separate. | `sort`, `page`, `pageSize`, `excludeFlairIds` |
| `search_forum` | Search posts, comments, or both with honest per-type pagination. | `query`, `searchType`, `page`, `pageSize`, `commentOffset`, `commentLimit` |
| `read_post` | Read one post, including poll options, without fetching replies. | `post` |
| `read_thread` | Read a post and a bounded reply-tree window with parent context and coverage. | `post`, `commentOffset`, `maxComments` |
| `read_comment` | Retrieve a comment, its ancestors, and direct reply IDs. | `post`, `comment` |
| `read_threads` | Compare up to three threads with independent outcomes and source metadata. | `posts`, `maxComments` |
| `list_flairs` | Discover native post formats and technical topic labels with IDs. | `fresh` |
| `user_profile` | Read pseudonymous public author metadata and nullable counts. | `user` |
| `user_activity` | Browse an author's public posts or comments. | `user`, `kind`, `page`, `pageSize` |
| `extract_references` | Extract HTTP(S) references and fenced Markdown code as inert text. | `post`, `maxItems`, `maxComments` |
| `research_plan` | Produce up to four curated query suggestions plus relevant primary references; no network calls. | `topic` |

`post` accepts a post UUID or canonical HTTPS forum URL. `user` accepts the public eight-character hexadecimal author ID or `https://bugbounty.forum/u/ID`, not a nickname. `comment` is a comment UUID.

Also available:

- Resource: `bbforum://research-guide`
- Prompt: `research_topic`, taking `topic`

### Example research session

The following are MCP `tools/call` parameters.

**1. Search both post bodies and comments.**

```json
{
  "name": "search_forum",
  "arguments": {
    "query": "xss",
    "searchType": "all",
    "sort": "new",
    "pageSize": 10,
    "commentLimit": 10
  }
}
```

**2. Read a promising discussion.** This is a real public AMA used in the live acceptance checks; its contents can change.

```json
{
  "name": "read_thread",
  "arguments": {
    "post": "0198fcf1-d3c6-4a79-a377-1fb90b28c21c",
    "maxComments": 20,
    "maxContentChars": 6000,
    "fresh": true
  }
}
```

**3. Continue using the returned offset.** If `coverage.nextOffset` is `20`, use:

```json
{
  "name": "read_thread",
  "arguments": {
    "post": "0198fcf1-d3c6-4a79-a377-1fb90b28c21c",
    "commentOffset": 20,
    "maxComments": 20,
    "fresh": false
  }
}
```

For comment-search continuation, use `commentCoverage.nextOffset` with `search_forum.commentOffset`. Increasing `page` only advances the post side.

A useful agent workflow is `research_plan` → `search_forum` → `read_thread` / `read_comment` → `extract_references` → independently verify relevant primary sources. Planning covers authorization/IDOR/BOLA, OAuth/sessions, browser security, SSRF, HTTP/cache/desync, recon/API, business logic, races, and reporting. These are curated query suggestions, not claimed findings or a complete forum taxonomy.

## Evidence and completeness

Successful tools return the same `{ "ok": true, "data": ... }` envelope in MCP `structuredContent` and text content. Failures return `isError: true` and `{ "ok": false, "error": { "code": "...", "message": "..." } }`. Error details omit raw response bodies.

Read the metadata before drawing conclusions:

| Field | Meaning |
| --- | --- |
| `source.endpoint` / `source.fetchedAt` | Exact public API read and original fetch time. |
| `source.cacheHit` | Whether a still-valid in-memory response was reused. |
| `url`, `createdAt`, `author` | Canonical citation, original publication date, and pseudonymous author context. |
| `coverage.completeAgainstReportedCount` | All returned nodes are included, the graph is intact, and visible nodes match the post counter. This is separate from text truncation. |
| `coverage.contentTruncated` | At least one returned content item exceeded its text budget. |
| `coverage.graphComplete` / `missingParentIds` | Whether reply relationships are intact in the returned upstream tree. |
| `coverage.nextOffset` | Next local reply window, or `null`. |
| `parentRelationshipKnown` | Search/activity records may not contain enough data to identify a comment's parent. |

Deleted content is redacted while its structural tombstone is retained. A deleted parent does not erase surviving replies. A comment-read failure produces an explicitly incomplete post-only result, not a fabricated empty discussion.

### Observed upstream quirks

These were measured on **December 6, 2026**; they are not a permanent API contract.

- **Hot/Rising can be empty while New contains posts.** New is the default. No fallback sort is silently substituted.
- **Comment search ignores upstream pagination.** The server slices the returned match set using `commentOffset` / `commentLimit`. An undiscovered upstream match cap remains possible.
- **Search `total` is not a comment-match count.** It describes posts: matching posts in combined searches, or site-wide posts in comments-only searches.
- **Post counters exclude deleted comment nodes.** Visible and deleted counts are tracked separately.
- **Profile counters can exclude tombstones that activity pages still return.** Pagination uses actual page results, not those counters.

The post and its comments are separate requests, not an atomic snapshot. Offset windows can shift when live content changes or a cache entry expires.

## Bounds and freshness

| Control | Default / supported range |
| --- | --- |
| Post/activity `pageSize` | 20; 1–100. Values above the observed backend maximum are rejected before a request. |
| Native `sort` | `new`; also `hot`, `rising`, `top`, `best`, `controversial`. |
| Thread `maxComments` | 50; 1–200, including deletion markers. |
| Search `commentLimit` | 20; 1–100. |
| `read_threads` | 1–3 threads, default 30 / maximum 50 comments per thread. |
| `maxContentChars` | 2,000 in lists/search/activity; 15,000 in direct reads; supported 100–80,000. |
| Shared content budget | 80,000 characters per read; poll labels use the same budget. |
| Reference extraction | Up to 200 reply nodes by default; 30 links/items by default; at most 20 code blocks, 4,000 characters each. |

`read_threads` caps `maxContentChars` at 5,000 per item. Extraction only recognizes fenced Markdown code, not every possible code representation.

Direct post/thread/comment reads, batches, extraction, and status default to `fresh: true`. Lists, search, flairs, profiles, and activity can reuse the memory cache. `fresh: true` skips stored cache entries but may share an identical in-flight request.

## Configuration

Set these in the process environment or your MCP client's `env` object. **`.env` files are not loaded automatically.** [.env.example](.env.example) lists the available settings.

| Variable | Default | Supported range |
| --- | --- | --- |
| `BBF_REQUEST_INTERVAL_MS` | 1,000 ms | 100–60,000 |
| `BBF_TIMEOUT_MS` | 20,000 ms per attempt | 1,000–120,000 |
| `BBF_CACHE_TTL_MS` | 30,000 ms | 0–300,000; zero disables caching |
| `BBF_MAX_RETRIES` | 2 | 0–3 retries after the initial attempt |
| `BBF_MAX_RESPONSE_BYTES` | 4 MiB | 64 KiB–16 MiB |
| `BBF_MAX_CACHE_ENTRIES` | 100 | 0–500; zero disables caching |
| `BBF_USER_AGENT` | `bugbounty-forum-mcp/0.1.0 (read-only public research)` | Up to 256 characters, no control characters |

The cache additionally has a fixed **32 MiB serialized UTF-8 payload budget**; JavaScript object overhead is additional. Cache, pacing, and cooldown are per process and disappear on restart. This is not a persistent content mirror.

Requests are serialized. The client respects `Retry-After` and the forum's typed 429 `detail.retry_after` field. Long requested pauses are returned promptly as errors and retained as a shared cooldown. Retries and queueing mean a whole tool call can exceed the per-attempt timeout.

**No guaranteed operator-published read quota was established.** Local pacing is a conservative client setting, not a rate entitlement.

## Development and validation

```bash
npm run check
npm test
npm run build
npm run test:live
```

The ordinary test suite is offline and includes a real child-process stdio handshake. Live tests are opt-in, contact the public backend, and can fail when the service changes or is unavailable. `npm run test:live -- --record` writes a dated metadata report for the checked fixture; it does not mirror forum content.

Initial validation on December 6, 2026 passed **80 automated tests and 16 live acceptance checks** across all 12 tools, the resource, and the prompt. See [validation notes](docs/validation.md) and the [recorded live results](docs/live-validation-2026-12-06.json). These are dated observations, not a guarantee of future service availability.

GitHub Actions checks Node.js 22 and 24 on Linux and Windows. A separate manually triggered live workflow keeps routine pull requests independent of forum availability.

### Code map

| Module | Responsibility |
| --- | --- |
| `src/http.ts` | Fixed-origin GET transport, pacing, retries/cooldown, bounded JSON reads, and LRU cache. |
| `src/schema.ts` | Public response validation, identifiers, safe normalization, text budgets, and tree integrity. |
| `src/forum.ts` | Forum-specific search, pagination, thread coverage, flairs, and author reads. |
| `src/server.ts` | MCP tools, resource, prompt, and bounded result envelopes. |
| `src/research.ts` | Pure query planning and agent research guidance. |
| `src/references.ts` | Inert reference and fenced-code extraction. |
| `src/cli.ts` | Stdio server, local diagnostics, and live access check. |

## Boundaries

The API host and read routes are fixed; arbitrary hosts, redirects, posting, voting, messages, cookie export, external downloads, and code execution are not exposed.

The frontend backend is **undocumented and unversioned**. It can change format, behavior, or access policy. Schema changes fail explicitly; the server does not silently replace live reads with an archive or another service.

This adapter does not turn community claims into verified findings. Keep source dates, prerequisites, contradictory replies, and coverage alongside any conclusions.

## Contributing, security, and license

See [CONTRIBUTING.md](CONTRIBUTING.md) for development and commit conventions and [SECURITY.md](SECURITY.md) for reporting security-sensitive issues.

Licensed under the [MIT License](LICENSE).