Shift data aggregation from Ollama pipeline to MCP host (Claude)#65
Merged
Shift data aggregation from Ollama pipeline to MCP host (Claude)#65
Conversation
…n directly The MCP host (Claude Code, Claude Desktop, ChatGPT) is dramatically more capable than llama3.1:8b at parsing, deduplication, and synthesis. This change eliminates 2-5 minutes of Ollama latency per scan by having the MCP host structure raw tool outputs directly. Changes: - Add aggregate_results and get_payload_schema tools to blhackbox MCP server - Move all Ollama services (ollama, ollama-mcp, 3 agents) to --profile ollama - Core stack reduced from 9 to 4 containers (kali, wire, screenshot, portainer) - RAM requirement reduced from 16GB to 8GB for core stack - Update all 11 prompt templates to use direct aggregation - Update playbook, entrypoint, Makefile, .env.example, README, CLAUDE.md - Keep Ollama pipeline as optional fallback (make up-ollama) https://claude.ai/code/session_01MXWTGUUSheo3EkgHrzRmjy
- Add aggregate_results and get_payload_schema to expected tool sets - Update tool counts from 11 to 13 in test_mcp_server and test_screenshot_mcp - Update test_prompts to check for aggregation pipeline instead of Ollama https://claude.ai/code/session_01MXWTGUUSheo3EkgHrzRmjy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fundamentally restructures how blhackbox processes pentest data. Instead of sending raw tool outputs to a 3-agent Ollama preprocessing pipeline (Ingestion → Processing → Synthesis), the MCP host (Claude Code, Claude Desktop, or ChatGPT) now handles parsing, deduplication, correlation, and structuring directly. The Ollama pipeline is moved to an optional legacy fallback (
--profile ollama).Key Changes
Core Architecture
--profile ollamaMCP Server Changes (
blhackbox/mcp/server.py)aggregate_results(payload)— validates and persists theAggregatedPayloadJSON, stores to disk, optionally syncs to Neo4jget_payload_schema()— returns theAggregatedPayloadJSON schema so Claude knows the expected structureget_templatedescription to reflect that Claude handles aggregation directlyprocess_scan_results()(Ollama pipeline method)Data Model Updates (
blhackbox/models/aggregated_payload.py)AggregatedPayloadis now produced by the MCP host, not the Ollama pipelinemodelfield toAggregatedMetadatato track which model performed aggregation (Claude, Ollama, etc.)ollama_modelfield for backward compatibility but marked as deprecatedWorkflow Documentation
claude_playbook.md: Phase 4 renamed from "Process" to "Aggregate"; Claude now does the work directlyprocess_scan_results(), replaced withget_payload_schema()+aggregate_results()patternDocker & Deployment
docker-compose.yml: Ollama services moved to--profile ollama; MCP Gateway now only depends on core 3 MCP servers (removed ollama-mcp dependency)Makefile: addedup-ollamatarget; updated container counts in help text; updateddownandcleanto include--profile ollama.env.example: commented out all Ollama-related settings; noted they're only needed for--profile ollamablhackbox-mcp-catalog.yaml: commented out ollama-mcp registry entry (can be uncommented if using legacy pipeline)docker/claude-code-entrypoint.sh: Ollama Pipeline check now warns instead of failing if not runningEntrypoint & Startup
Implementation Details
aggregate_results()validates the payload against the Pydantic schema, persists toresults_dir/session-{session_id}.json, and attempts Neo4j storage (best-effort, doesn't fail if Neo4j unavailable)get_payload_schema()returns the full JSON schema fromAggregatedPayload.model_json_schema()for Claude to referenceget_payload_schema()→ parse/deduplicate/correlate → callaggregate_results()→ callgenerate_report()https://claude.ai/code/session_01MXWTGUUSheo3EkgHrzRmjy