Files
Flypaper/docs/mcp.md
T
TomandClaude Sonnet 5.5 7c11bf211e
Build and deploy / build (push) Successful in 1m36s
Release / image (push) Successful in 1m59s
Build and deploy / deploy (push) Successful in 31s
Release / release (push) Successful in 7s
Show the bots held in the trap right now
Dashboard table "Gerade in der Falle" and MCP tool list_active, backed by an
in-memory registry of running traps. Changelog prepared for 0.8.0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 01:59:07 +01:00

3.2 KiB
Raw Blame History

MCP access for AI assistants

Flypaper includes a Model Context Protocol server, so AI assistants such as Claude can query your catches: "Which countries hit the trap most this week?", "What do we know about 203.0.113.9?". All tools only read; nothing can be changed or deleted over MCP.

  • Endpoint: http://<host>:8081/mcp (Streamable HTTP, dashboard port only; on the trap port 8080 the path is just another trap)
  • Authentication: Authorization: Bearer <token>; without a valid token the answer is 401

LAN only. The MCP endpoint lives on the dashboard port and must stay as internal as the dashboard: never forward port 8081 from your public proxy.

Create a token

Dashboard → Einstellungen → MCP-Zugriff: enter a name (e.g. Claude Code) and create the token. It is shown exactly once, so copy it right away; Flypaper stores only its SHA-256 hash. The list shows each token's name, creation date and last use, and lets you revoke it.

Alternatively, set a fixed token with the environment variable Flypaper__Mcp__Token (useful for automated setups). It works in addition to the tokens created in the dashboard.

Connect Claude Code

claude mcp add --transport http flypaper http://192.168.1.10:8081/mcp \
  --header "Authorization: Bearer fpm_your_token"

Connect Claude Desktop

Claude Desktop's custom connectors are reached from Anthropic's cloud and can't see your LAN. Use the local mcp-remote bridge instead (needs Node.js), in claude_desktop_config.json:

{
  "mcpServers": {
    "flypaper": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://192.168.1.10:8081/mcp",
        "--allow-http",
        "--header",
        "Authorization: Bearer ${FLYPAPER_TOKEN}"
      ],
      "env": { "FLYPAPER_TOKEN": "fpm_your_token" }
    }
  }
}

--allow-http is needed because the dashboard port speaks plain HTTP.

Tools

All tools return structured JSON (with an output schema); times are ISO 8601 UTC, durations in seconds. A period is a number with m, h, d or w (e.g. 1h, 24h, 7d) or all.

Tool Parameters Returns
list_active – Bots held in the trap right now with origin, URL, user agent, strategy, time held and bytes sent (memory only)
get_stats period (default 24h) Catches, rejected connections, unique IPs, total and average hold time, traps active now, longest catch
list_catches since, until (ISO 8601), country (ISO code), provider (AS4134 or part of the name), ip, target_contains, limit (default 50, max 500) Events, newest first, including rejected ones
top dimension (ips, countries, providers, targets, user_agents), period (default 24h), limit (default 10) Most frequent values by number of catches, with total hold time
longest_catches period (default 7d), limit (default 10) Catches that held a bot the longest
lookup_ip ip Origin, provider, totals, first and last seen, and its events (newest first, at most 500); local data only

Catches from private networks appear only if they are stored, i.e. if the setting Fänge aus privaten Netzen nicht speichern is off.