$ man ctfbase

Documentation

Everything you need to search CTF writeups via API or connect your AI assistant via MCP.

$ cat quick-start/README.md

1.Sign in with GitHub

Click Sign in in the navbar. Free account gives you unlimited search and writeup previews.

2.Search writeups

Use the search page or call the API directly:

bash
curl "https://api.ctfbase.com/api/v1/search?q=sql+injection"

3.Connect your AI assistant

Add CTF Base as an MCP server to Claude, Cursor, or any MCP-compatible client:

bash
claude mcp add ctfbase https://mcp.ctfbase.com/mcp

$ man api

Base URL: https://api.ctfbase.com/api/v1

GET/search

Hybrid AI search (full-text + vector similarity). If q is omitted, browse all writeups in a category. At least one of q or category is required.

Parameters:

qstringSearch query (optional if category is provided)
categorystringFilter by category (web, crypto, pwn, ...). Use alone to browse all writeups in a category.
limitintResults per page (default: 10, max: 50)
offsetintPagination offset (default: 0)

Example:

bash
curl "https://api.ctfbase.com/api/v1/search?q=buffer+overflow&category=pwn&limit=5"
# Browse all writeups in a category:
curl "https://api.ctfbase.com/api/v1/search?category=web&limit=10"

Response:

json
{
  "results": [
    {
      "id": "picoctf2024_heap_overflow",
      "title": "Heap Overflow — PicoCTF 2024",
      "category": "pwn",
      "difficulty": "medium",
      "event": "PicoCTF 2024",
      "description": "Task: Exploit a heap overflow...",
      "tags": ["heap", "overflow", "glibc"],
      "techniques": ["heap-overflow", "use-after-free"]
    }
  ],
  "total": 42,
  "limit": 5,
  "offset": 0,
  "query_time_ms": 823.5
}
GET/categories

List all categories with writeup counts.

Example:

bash
curl "https://api.ctfbase.com/api/v1/categories"

Response:

json
{
  "categories": [
    { "category": "web", "count": 297 },
    { "category": "crypto", "count": 197 },
    { "category": "reverse", "count": 134 }
  ]
}
GET/writeups/{id}

Writeup preview: metadata, tags, techniques. No full content or flag.

Parameters:

idstringrequiredWriteup ID (path parameter)

Example:

bash
curl "https://api.ctfbase.com/api/v1/writeups/picoctf2024_heap_overflow"

Response:

json
{
  "id": "picoctf2024_heap_overflow",
  "title": "Heap Overflow — PicoCTF 2024",
  "category": "pwn",
  "difficulty": "medium",
  "event": "PicoCTF 2024",
  "description": "Task: Exploit a heap overflow...",
  "tags": ["heap", "overflow", "glibc"],
  "techniques": ["heap-overflow", "use-after-free"]
}
GET/writeups/{id}/fullpro+

Full writeup content (markdown). Requires Pro tier or higher.

Parameters:

idstringrequiredWriteup ID (path parameter)

Example:

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.ctfbase.com/api/v1/writeups/picoctf2024_heap_overflow/full"

Response:

json
{
  "id": "picoctf2024_heap_overflow",
  "title": "Heap Overflow — PicoCTF 2024",
  "content": "## Analysis\n\nThe binary has a heap overflow...",
  "tools": ["gdb", "pwntools", "ghidra"],
  "indicators": ["CVE-2024-XXXX"]
}
GET/writeups/{id}/flagpro+

Returns the flag for a writeup. Requires Pro tier or higher.

Parameters:

idstringrequiredWriteup ID (path parameter)

Example:

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.ctfbase.com/api/v1/writeups/picoctf2024_heap_overflow/flag"

Response:

json
{
  "id": "picoctf2024_heap_overflow",
  "flag": "picoCTF{h34p_0v3rfl0w_m4st3r}"
}

$ man mcp

CTF Base exposes an MCP server at mcp.ctfbase.com/mcp. Connect your AI assistant to search writeups directly from chat.

mcp-tools

$ mcp tools/list

search

Search CTF writeups by query and optional category.

params: query: string, category?: string, limit?: int

get_writeup

Get full writeup content by ID. Returns markdown with solution.

params: writeup_id: string

get_flag

Get the flag for a specific writeup.

params: writeup_id: string

Claude Code

bash
claude mcp add ctfbase \
  --transport streamable-http \
  --url "https://mcp.ctfbase.com/mcp" \
  --header "Authorization: Bearer YOUR_MCP_KEY"

Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json

json
{
  "mcpServers": {
    "ctfbase": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote",
        "https://mcp.ctfbase.com/mcp",
        "--header",
        "Authorization: Bearer YOUR_MCP_KEY"
      ]
    }
  }
}

Cursor

.cursor/mcp.json

json
{
  "mcpServers": {
    "ctfbase": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote",
        "https://mcp.ctfbase.com/mcp",
        "--header",
        "Authorization: Bearer YOUR_MCP_KEY"
      ]
    }
  }
}
mcp-example

You: How do I exploit a format string vulnerability in a CTF?

[MCP] calling ctfbase.search("format string vulnerability exploit")

[MCP] found 23 results, reading top match...

AI: Based on 23 real CTF writeups, the most common approach is...

$ man auth

Public endpoints

/search, /suggest, /stats, /categories, /writeups/{id} require no authentication.

Protected endpoints

/writeups/{id}/full and /writeups/{id}/flag require Pro tier or higher.

Authenticate via API key in the Authorization header:

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.ctfbase.com/api/v1/writeups/example/full"

Getting an API key

Sign in with GitHub, upgrade to Pro, then generate an API key from your dashboard. API key management is coming soon.

$ cat rate-limits.conf

rate-limits
tierrequests/dayapi_keysfull_access
freesearch only0no
pro1001yes
team1,0005yes

Public endpoints (search, suggest, stats, categories) are not rate-limited per user. Server-wide rate limit: 30 req/s via Nginx.

$ cat errors.log

error-codes
400Bad RequestInvalid query parameters or malformed request.
401UnauthorizedMissing or invalid API key / session.
403ForbiddenValid auth but insufficient tier (e.g. free user accessing /full).
404Not FoundWriteup ID does not exist.
429Too Many RequestsDaily rate limit exceeded. Resets at midnight UTC.
500Internal Server ErrorSomething went wrong. Try again or report the issue.

Error response format:

json
{
  "detail": "Rate limit exceeded. Upgrade to Pro for 100 req/day."
}