Skip to main content
Glama
titaniumtushar

burp-mcp-plus

search_history

Use a regex to search Burp proxy history and retrieve matching entries with their history indices for further processing in other tools.

Instructions

Search Burp proxy history with a regex; returns a compact list of matching entries with their history_index (0-based position in the returned page). Feed history_index into the other tools as history_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regexYes
countNo
offsetNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The actual tool handler for search_history. Defines the async function, accepts regex (str), count (int, default 50), offset (int, default 0), calls burp_client.call('get_proxy_http_history_regex', ...), normalizes results, summarizes entries, and returns JSON.
    @mcp.tool()
    async def search_history(regex: str, count: int = 50, offset: int = 0) -> str:
        """Search Burp proxy history with a regex; returns a compact list of
        matching entries with their `history_index` (0-based position in the
        returned page). Feed `history_index` into the other tools as `history_id`.
        """
        payload = await burp_client.call(
            "get_proxy_http_history_regex",
            {"regex": regex, "count": count, "offset": offset},
        )
        entries = _normalize_history(payload)
        summary: list[dict[str, Any]] = []
        for i, e in enumerate(entries):
            try:
                summary.append(_summarize_entry(e, i))
            except Exception as exc:
                summary.append({"history_index": i, "error": str(exc)})
        return json.dumps(summary, indent=2)
  • The @mcp.tool() decorator on line 496 registers search_history as an MCP tool via the FastMCP instance created on line 29.
    @mcp.tool()
    async def search_history(regex: str, count: int = 50, offset: int = 0) -> str:
  • _normalize_history — helper used by search_history to normalize the raw Burp history payload into a flat list of entry dicts.
    def _normalize_history(history_payload: Any) -> list[dict[str, Any]]:
        """Normalize whatever Burp's history tool returned into a flat list of entries.
    
        Burp's MCP returns one JSON object per entry (across multiple text content
        blocks), each shaped like {"request": "...", "response": "...", "notes": ""}.
        There is no `id` field and no target metadata — host/port/scheme must be
        derived from the parsed request itself.
    
        Burp also sometimes returns plain text status messages like
        "Reached end of items" instead of any entries — treat those as empty.
        """
        if isinstance(history_payload, list):
            return [e for e in history_payload if isinstance(e, dict)]
        if isinstance(history_payload, dict):
            for key in ("history", "items", "entries", "results"):
                v = history_payload.get(key)
                if isinstance(v, list):
                    return [e for e in v if isinstance(e, dict)]
            if "request" in history_payload:
                return [history_payload]
        if isinstance(history_payload, str):
            if history_payload.strip().lower().startswith(_EMPTY_MARKERS):
                return []
        raise RuntimeError(
            f"could not parse Burp history payload (type={type(history_payload).__name__})"
        )
  • _summarize_entry — helper used by search_history to produce a compact summary dict (history_index, method, url, status) for each history entry.
    def _summarize_entry(entry: dict[str, Any], index: int) -> dict[str, Any]:
        raw = _entry_raw_request(entry)
        parsed = parse_raw_request(raw)
        host, port, https = _derive_target(parsed, entry)
        scheme = "https" if https else "http"
        status: int | None = None
        resp = entry.get("response") or entry.get("rawResponse") or ""
        if isinstance(resp, str):
            m = _STATUS_RE.search(resp)
            if m:
                status = int(m.group(1))
        return {
            "history_index": index,
            "method": parsed.method,
            "url": f"{scheme}://{host}:{port}{parsed.path}",
            "status": status,
        }
  • _entry_raw_request — helper used by _summarize_entry to extract raw HTTP request string from a history entry.
    def _entry_raw_request(entry: dict[str, Any]) -> str:
        """Pull the raw HTTP/1.1 request bytes/string out of a history entry."""
        for key in ("request", "rawRequest", "requestBytes", "requestString"):
            v = entry.get(key)
            if isinstance(v, str) and v:
                return v
        raise RuntimeError(
            "history entry has no request field (looked for: request, rawRequest, requestBytes, requestString)"
        )
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description only states it searches and returns results. No disclosure of read-only nature, side effects, rate limits, or other behavioral traits. For a search tool with no annotations, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences: first defines action and output, second gives usage instructions. Perfectly front-loaded with no filler. Every sentence is valuable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a search tool with output schema (present, so return value details covered). Lacks parameter descriptions and pagination guidance, but covers the key integration point (history_index). Could be more complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage 0%; description only mentions regex (implied) and history_index (returned, not parameter). No explanation of count (pagination size) or offset (page offset). Adds minimal value beyond the schema's field names and defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states verb 'Search', resource 'Burp proxy history', and method 'with a regex'. Differentiates from siblings like list_history and inspect_history_entry by specifying regex search and returning compact list with history_index. Also explains how history_index feeds into other tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implies usage for regex-based searches and hints at integration with other tools via history_index. However, no explicit exclusions or when-not-to-use guidance compared to alternatives like inspect_history_entry or list_history.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/titaniumtushar/burp-mcp-plus'

If you have feedback or need assistance with the MCP directory API, please join our Discord server