Add MCP surface fuzz pass to CI by Agent-Hellboy · Pull Request #675 · stackql/stackql · GitHub
Skip to content

Add MCP surface fuzz pass to CI#675

Open
Agent-Hellboy wants to merge 1 commit into
stackql:mainfrom
Agent-Hellboy:feat/mcp-surface-fuzz-ci
Open

Add MCP surface fuzz pass to CI#675
Agent-Hellboy wants to merge 1 commit into
stackql:mainfrom
Agent-Hellboy:feat/mcp-surface-fuzz-ci

Conversation

@Agent-Hellboy

@Agent-Hellboy Agent-Hellboy commented Jun 19, 2026

Copy link
Copy Markdown

Summary

  • Add bash scripts/fuzz-mcp-surface.sh to boot a streamable HTTP MCP fixture and run mcp-fuzzer against the canonical StackQL tool surface
  • Fixture in scripts/fuzz_mcp_fixture/ uses pkg/mcp_server in read_only mode with representative tool responses (no cloud credentials)
  • Add mcp-fuzz workflow that uploads fuzz-output/ and pins princekrroshan01/mcp-fuzzer:v0.4.0
  • Document usage in docs/mcp-fuzz.md

The pass exercises MCP tool registration, query-tool argument handling, and streamable HTTP transport in pkg/mcp_server. It is a smoke-level check, not a replacement for robot tests against a full stackql mcp deployment with provider mocks.

Evidence

Local verification (2026-06-19):

  • go build ./scripts/fuzz_mcp_fixture/ — OK
  • docker pull princekrroshan01/mcp-fuzzer:v0.4.0 — OK
  • MCP_FUZZ_RUNS=2 MCP_FUZZ_TIMEOUT=25 bash scripts/fuzz-mcp-surface.sh — OK
  • Endpoint: http://127.0.0.1:19992 (streamable HTTP)
  • All 11 canonical MCP tools discovered and fuzzed (--fail-if-no-tools passed)
  • Report artifact: fuzz-output/findings.json

Test plan

  • Fixture builds and fuzz script completes locally
  • CI mcp-fuzz job green on this PR

Checklist variations

  • Robot tests not added: this is optional security smoke tooling layered on pkg/mcp_server, not a change to query execution behavior covered by existing robot suites.

Co-authored-by: Cursor <cursoragent@cursor.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd720107fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make the mounted report directory writable

On the GitHub Linux runner this directory is created by the runner user with normal 0755 permissions, then mounted into princekrroshan01/mcp-fuzzer:v0.4.0; I checked that image's upstream Dockerfile and its runtime stage uses USER nonroot, while the fuzzer writes under --output-dir /output. That UID cannot create /output/sessions/..., so report generation logs errors and the Upload fuzz report step has no useful artifacts even when fuzzing ran. Make the host dir writable for the container, or run the container with the runner UID.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Agent-Hellboy took this for a spin against the real stackql/stackql-mcp image over streamable HTTP (not just the fixture) and it ran clean on the categories that matter - no crash, auth_bypass, injection_reflection, or error_leakage. Nice work.

One question on coverage: the published artifact (Docker, npm, PyPI, the Claude Desktop bundle) all run --mcp.server.type=stdio, so that's the transport almost everyone actually uses, and it's also where your memory_growth detection kicks in since the fuzzer supervises the spawned process there. The PR only exercises streamable HTTP. Do you plan to add a stdio pass? For a Go server that's the more interesting transport to fuzz, and it would line the PR up with how the server actually ships.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants