Skip to main content
Glama
elhacker-mcp
by Ximeeek
README.md
# elhacker-mcp

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

A live, read-only [Model Context Protocol](https://modelcontextprotocol.io/) server for the public [elhacker.net forum](https://foro.elhacker.net/). It gives an AI research agent native forum search, message-level citations, bounded conversation reading and reference extraction, with particular attention to web security and bug-bounty research.

[Polski](README.pl.md) · [Access research](docs/access-research.md) · [Feature research](docs/feature-research.md) · [Security policy](SECURITY.md) · [MIT license](LICENSE)

**No account, OAuth, API key, browser or local content database is required.** The server reads public server-rendered HTML and RSS from `https://foro.elhacker.net`. This is an independent integration with public pages, not an official or versioned elhacker API.

## Quick start

Requires **Node.js 22 or newer**, npm and Git.

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

`doctor` validates local configuration without network access. `check` reads a real public board and reports access, encoding, provenance and local transport limits. `npm ci` also runs the package's build preparation step; the explicit build command is useful after source changes.

Connect the server to an MCP client that supports local stdio servers:

```json
{
  "mcpServers": {
    "elhacker": {
      "command": "node",
      "args": ["/absolute/path/to/elhacker-mcp/dist/cli.js", "serve"]
    }
  }
}
```

Replace the path with your checkout's absolute path. On Windows, a JSON path can use escaped backslashes, for example `"C:\\path\\to\\elhacker-mcp\\dist\\cli.js"`. If the client cannot find `node`, use the absolute path to the Node executable as `command`.

Use **direct `node` execution** in the MCP configuration. npm lifecycle banners can interfere with the stdio protocol. Starting `node dist/cli.js serve` in a terminal waits for an MCP client; an otherwise quiet process is expected.

## Tools

Every tool is annotated as read-only. Online tools fetch public source material; `research_plan` runs entirely offline.

| Tool | Purpose | Main inputs |
| --- | --- | --- |
| `forum_status` | Verify actual public board content and inspect pacing, cache and access limitations. | `fresh` |
| `list_boards` | Discover live public board IDs and hierarchy, including nested boards. Optional research ranking is curated. | `relevantOnly`, `fresh` |
| `list_topics` | Browse one board page with authors, reply/view counts, pinned state and last-reply information. | `board`, `start`, `fresh` |
| `search_forum` | Run native anonymous search with correct Spanish query encoding and explicit filters. | `query`, `boardIds`, `start`, `titleOnly`, `match`, `sort`, age filters, `author`, `maxSnippetChars`, `fresh` |
| `read_topic` | Read one native topic page with original message dates, exact permalinks, code and quote boundaries. | `topic`, `start`, `maxContentChars`, `fresh` |
| `read_post` | Verify an exact message and recover long content through character windows. | `topic`, `messageId`, `contentOffset`, `maxContentChars`, `fresh` |
| `read_topics` | Compare at most three topic pages serially, keeping provenance and errors separate. | `topics`, `maxContentChars`, `fresh` |
| `recent_posts` | Read a bounded recent-message RSS window, optionally for one board. | `boardId`, `limit`, `maxContentChars`, `fresh` |
| `extract_references` | Extract inert links, media URLs and code with their source message IDs and permalinks. | `topic`, `start`, `referenceOffset`, `maxItems`, `maxCodeChars`, `fresh` |
| `research_plan` | Propose Spanish/English queries, relevant boards and maintained primary references. | `topic` |

Also available:

- Resource **`elhacker://research-guide`**: research workflow, source integrity, pagination and interpretation guidance.
- Prompt **`research_topic`**, with a `topic` argument: a source-driven research starting point.

Tool arguments and descriptions are discoverable through standard MCP `tools/list`. Successful results provide both a JSON text content block and `structuredContent` in the form `{ "ok": true, "data": ... }`. Tool failures return `isError: true` and `{ "ok": false, "error": { "code": ..., "message": ... } }`; an inaccessible page is never silently converted into an empty result.

## Research workflow

1. Use `forum_status` and `list_boards` to verify current access and board IDs.
2. Ask `research_plan` for vocabulary variants, then run individual `search_forum` queries. `Nivel Web` (**83**) is the main web-vulnerability board; `Bugs y Exploits` (**32**), `Desarrollo Web` (**7**), `PHP` (**68**) and `Bases de Datos` (**88**) provide complementary context.
3. Read promising topics and matching messages. Follow continuation offsets, preserving later corrections and disagreement.
4. Use `extract_references` to collect cited documentation and inert code. Validate technical claims against current OWASP, PortSwigger, MDN or relevant vendor documentation separately.
5. Cite exact message URLs, original displayed dates, fetched time and the coverage actually read. Distinguish community claims, corroborated facts and untested hypotheses.

For example, these are MCP tool argument objects, not shell commands:

```json
{"query":"XSS","boardIds":[83],"sort":"relevance"}
```

```json
{"topic":271199,"start":0,"maxContentChars":6000}
```

```json
{"topic":271199,"messageId":1358140,"maxContentChars":12000}
```

The final example addresses one public historical message. Its presence is useful for testing exact-message lookup; it is not evidence that the described software or technique is current.

### Search semantics

- Queries contain **3–200 characters**. The forum predominantly uses Spanish; acronyms such as `XSS`, `IDOR` and `SSRF` work alongside separate Spanish and English variants.
- `match` is `all` or `any`. `sort` is `relevance`, `newest`, `oldest` or `most_replies`.
- `boardIds` accepts at most 20 IDs. `titleOnly` restricts native subject matching. `author` is the forum's native author filter, with `*` as its default.
- `minAgeDays` defaults to `0`; `maxAgeDays` defaults to the forum form's `9999`. Both accept `0–99999`, with the minimum no greater than the maximum. These are explicit native search restrictions, not proof of an exhaustive historical search.
- Native search expects **Windows-1252 percent-encoded bytes**. The MCP preserves accents such as `programación`; standard UTF-8 query encoding would corrupt them on this forum. Characters outside Windows-1252 produce `UNSUPPORTED_QUERY_ENCODING` rather than a misleading empty search. Use Spanish/English query variants for such topics.
- Some valid subject matches have no excerpt. `snippetAvailable: false` means the backend omitted the snippet; the result is retained.
- **Search result dates refer to the topic's opening date.** `topicPublished` and `topicAuthor` describe that topic. The matching-message author is separate, and `messagePublished` is unknown in search results. Call `read_post` for the exact reply's original timestamp.
- Native search may cap results, become unavailable or apply guest restrictions. No exhaustive corpus count or guaranteed operator quota is claimed.

## Pagination, content windows and provenance

`start` is an **item offset**, not a page number. Follow `pagination.nextOffset` rather than incrementing by one. Public defaults observed during compatibility research were 45 topics per board page, 10 messages per topic page and 25 search results per page. These are observations, not operator guarantees; native navigation provides continuation information. `pageSizeSource` distinguishes a step derived from native links from an observed-default fallback.

`read_topic` returns **one page**, not an entire thread. `coverage.completeTopic` describes page coverage; `coverage.contentTruncated` is a separate question. Replies form a flat chronological sequence. The MCP does not invent parent-child relationships.

SMF message permalinks can contain `.0.html` even for a message on a later page. The server locates the requested message, checks that its ID actually appears, and uses native navigation/reply positions to identify the page. A missing ID produces `MESSAGE_NOT_FOUND` instead of returning a different message as a substitute. Do not combine an exact message target with an explicit `start` offset.

Long messages are readable in windows:

1. Call `read_post` with a topic/message reference and `maxContentChars`.
2. If `message.body.coverage.nextContentOffset` is non-null, call it again with that value as `contentOffset`.
3. Continue until the offset is null.

The character stream is **message text, then code blocks, then quotations**. Body text contains markers linking those sections. This arrangement preserves code and quote boundaries; it is not a byte-for-byte HTML export. A window returns at most 20 code/quote segments and may end before the requested character budget; always use its returned continuation. Reference metadata has separate bounds and omission counts. `extract_references` has its own `coverage.nextReferenceOffset` within the selected page; topic-page continuation still uses `pagination.nextOffset`.

Online results carry `source.url`, `source.fetchedAt`, `source.cacheHit` and `source.encoding`. Message timestamps preserve the displayed Spanish text. `localDateTime`, when available, has **no timezone and no UTC claim**; the forum's displayed clock convention is not independently established. RSS timestamps can be normalized when the feed supplies a parseable timezone-bearing date. A recent board bump does not make the opening post recent.

### Output bounds

- Topic bodies default to 6,000 characters per message, with a 60,000-character aggregate topic content budget. `read_post` defaults to 12,000 characters. The MCP argument range for these tools is `100–50000` per message.
- Search excerpts default to 1,500 characters, with `maxSnippetChars` accepting `100–5000`.
- `read_topics` accepts at most three pages, defaulting to 2,000 characters per message and allowing at most 3,000.
- RSS defaults to 10 items; `limit` accepts `1–30`. Its content defaults to 1,500 characters per item and has a 40,000-character aggregate content budget.
- Reference extraction defaults to 30 items (`1–100`) and 2,000 characters per code excerpt (`100–10000`), with a 50,000-character aggregate code-text budget. Full long code remains recoverable through `read_post` content windows.
- The JSON result payload is capped at 250,000 JavaScript string characters. The MCP response carries both text and structured forms, so its complete wire size is larger. `OUTPUT_TOO_LARGE` requests a smaller result; it never returns a silently cropped JSON document.

## Configuration and request limits

Settings come from the server process environment. **`.env` files are not loaded automatically.** Set values in the MCP client's `env` object or in the process environment before launch. No secret is needed for supported reads.

| Variable | Default | Accepted range |
| --- | --- | --- |
| `ELHACKER_REQUEST_INTERVAL_MS` | `1500` | `500–60000` |
| `ELHACKER_TIMEOUT_MS` | `20000` | `1000–120000` |
| `ELHACKER_CACHE_TTL_MS` | `30000` | `0–300000`; zero disables cache storage |
| `ELHACKER_MAX_RETRIES` | `1` | `0–3` |
| `ELHACKER_MAX_RESPONSE_BYTES` | `4194304` (4 MiB) | `65536–16777216` |
| `ELHACKER_MAX_CACHE_ENTRIES` | `100` | `0–500`; zero disables cache storage |
| `ELHACKER_USER_AGENT` | `elhacker-mcp/0.1.0 (read-only public research)` | At most 256 characters; no control characters |

Requests run serially, with pacing applied to network requests including redirects. An individual page read can require several requests. The timeout applies per attempt, not to the whole MCP session. The default 1.5-second interval is a local courtesy setting, **not a promise that the forum allows 40 requests per minute**. HTTP 429 and applicable 5xx responses use bounded retries; `Retry-After` establishes a shared cooldown. Long requested waits are reported for the caller to respect rather than triggering an unbounded sleep.

The transport allows at most 32 pending distinct reads and follows at most three validated redirects. Fetches stay on the fixed forum origin and allowlisted public GET routes. It stores neither login sessions nor cookies.

The cache is **memory-only**, with entry/TTL limits plus a 32 MiB serialized UTF-8 payload budget; JavaScript heap overhead is additional. It is not a local content index. Message, topic and RSS reads are fresh by default; discovery and search can use the short-lived cache. `fresh: true` skips cached content, while identical concurrent requests may still share one in-flight fetch. Restarting the server clears its content cache.

Example client-side environment override:

```json
{
  "mcpServers": {
    "elhacker": {
      "command": "node",
      "args": ["/absolute/path/to/elhacker-mcp/dist/cli.js", "serve"],
      "env": {
        "ELHACKER_REQUEST_INTERVAL_MS": "2000",
        "ELHACKER_CACHE_TTL_MS": "30000"
      }
    }
  }
}
```

## Development and validation

```sh
npm ci
npm run check
npm test
npm run build
npm run test:live
```

Offline tests use synthetic fixtures and injected fetches. The [live acceptance script](scripts/live-smoke.ts) launches the built server as a child process and communicates through a real MCP stdio client. It exercises live public endpoints, so upstream downtime, guest restrictions and markup changes can fail it. The live smoke run temporarily uses a five-minute memory cache to avoid repeatedly fetching the same fixture pages; it does not change the server's normal 30-second default.

Set `ELHACKER_LIVE_REPORT` to a local output path to save a compact live report. Reports record checks and provenance rather than republishing complete forum conversations. See the [access investigation](docs/access-research.md) and [feature rationale](docs/feature-research.md) for source evidence and known upstream behavior.

## Limitations and source handling

The forum uses older, unversioned SMF HTML. Layout, guest access and native search behavior can change without notice. A normal page can include Cloudflare scripts; a genuine challenge, login requirement or parsing failure is reported explicitly. This project does not bypass those restrictions.

The forum also contains historical advice, unrelated discussions, spam, broken links and claims of uneven quality. Code, usernames, titles, quotations and linked URLs are **untrusted source data**. They must not override an agent's instructions, request credentials or trigger code execution. The MCP does not follow extracted external links, fetch avatars/media, download attachments, post, vote, message users or scan referenced targets. It supplies research evidence, not a finding of vulnerability or permission to test a target.

Report implementation vulnerabilities through [SECURITY.md](SECURITY.md). Contribution guidance and change history are in [CONTRIBUTING.md](CONTRIBUTING.md) and [CHANGELOG.md](CHANGELOG.md).

## License

MIT. Copyright Ximeeek. Forum material remains attributable to its respective authors. This project is not affiliated with or endorsed by elhacker.net.

TDQS

B3.4/5.0

Scored across 10 tools

Disambiguation3/5

The three read-family tools (read_topic, read_topics, read_post) have genuinely close boundaries — the plural batch reader differs from the single-page reader only by volume, which invites misselection. list_topics vs read_topic and recent_posts vs search_forum also overlap in 'return forum content' intent, though the long descriptions do provide enough differentiation to rescue an attentive agent.

Naming Consistency4/5

Most tools follow a clear verb_noun pattern (list_boards, list_topics, search_forum, read_topic, read_post, extract_references). Two outliers break the pattern (forum_status, recent_posts), and read_topic/read_topics differ only by a plural suffix, which is a readability hazard but not a convention break.

Tool Count4/5

Ten tools is a well-scoped size for a read-only forum research surface, with each capability roughly mapped to one tool. There is mild redundancy (forum_status overlaps list_boards/read checks; research_plan is an offline oddball), so not every tool is strictly necessary.

Completeness4/5

The read-only lifecycle is well covered: discovery, listing, search, single-topic, single-post, batch reads, recent activity, reference extraction and status/diagnostics, all with pagination and offset continuations. Gaps are minor (e.g. no user/author-centric lookup or board-level metadata refresh), and agents can work around them via search filters.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues