Skip to content

docs(gti): document configuring the remote GTI Agentic MCP server - #341

Draft
dandye wants to merge 7 commits into
google:mainfrom
dandye:docs__gti-agentic-mcp
Draft

dandye wants to merge 7 commits into
google:mainfrom
dandye:docs__gti-agentic-mcp

Conversation

@dandye

@dandye dandye commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Documents how to configure and verify the managed Remote MCP Server for Google Threat Intelligence (https://www.virustotal.com/api/v3/agentspace/mcp/, documented upstream at Agentic MCP Server Configuration) and the VirusTotal AI Hosted MCP (https://ai.virustotal.com/mcp, documented at Install VirusTotal for your agent), and wires remote Streamable HTTP MCP support into run-with-google-adk and the Google SecOps Extension skills.

  • Adds docs/gti_remote_server.md mirroring docs/remote_server.md for Google SecOps:
    • 3-way comparison table and self-contained dark-slate SVG architecture diagram (docs/img/gti_remote/gti_remote_vs_local.svg generated by docs/img/gti_remote/render_diagrams.py, 880x464 with #0f172a outer card, #1e293b inner cards, #94a3b8 borders, and >= 11.8:1 text contrast across both light and dark modes without relying on currentColor) comparing the 7-tool remote GTI Agentic server (gti-agentic), the 11-tool VirusTotal AI Hosted MCP (virustotal at https://ai.virustotal.com/mcp), and the 35+ tool local stdio gti-mcp package (gti), including running multiple servers side by side under distinct server keys.
    • Onboarding and Customer Data privacy guidance: Google Threat Intelligence Enterprise, Enterprise Plus, or active Proof-of-Concept (PoC) entitlement (no separate allowlist group required), locating your personal API key from the VirusTotal profile avatar menu, tenant-isolated Customer Data protection under Google Cloud Service Specific Terms and the Google SecOps Privacy Notice (Private Scanning for files submitted in Agentic sessions, never human-reviewed or used to train foundation models), share_session bearer share_token precautions, and portable bash/zsh printf + read -rs and curl -i --config - secret handling.
    • Verified stateless Streamable HTTP transport mechanics: per-request x-apikey with no Mcp-Session-Id transport header paired with application-layer session_id continuity across ask_gti_agent and continue_chat, mandatory trailing / to avoid cross-scheme HTTP 307 redirects, dual Accept: application/json, text/event-stream media types to avoid HTTP 406 Not Acceptable, and 300-second client timeouts for 45 to 180 second server-side specialist-agent investigations.
    • Verified per-client schemas and setup guides: Cursor ("mcpServers" + ${env:VT_APIKEY}), VS Code (.vscode/mcp.json top-level "servers" + "inputs" password promptString + "type": "http"), Cline (cline_mcp_settings.json "type": "streamableHttp", "timeout": 300, chmod 600), Gemini CLI ($GEMINI_CLI_VT_APIKEY prefix for header env sanitization + "type": "http" + "timeout": 300000), Antigravity (~/.gemini/config/mcp_config.json with "serverUrl", "timeoutSeconds": 300, chmod 600), Claude Code (single-quoted --header 'x-apikey: ${VT_APIKEY}' + persistent MCP_TOOL_TIMEOUT=300000), Claude Desktop (mcp-remote "x-apikey:${VT_APIKEY}", chmod 600 / --header-file, and 60-second SDK timeout session recovery via list_sessions / get_session_history), Codex CLI (~/.codex/config.toml env_http_headers + tool_timeout_sec = 300), Goose (~/.config/goose/config.yaml streamable_http + env_keys: [VT_APIKEY]), curl -i --config - verification, and Python Google Agent Development Kit (McpToolset + StreamableHTTPConnectionParams, noting MINIMAL_LOGGING=Y so ADK debug tracing does not log x-apikey).
    • Reference table for all 7 tools (ask_gti_agent, continue_chat, list_sessions, get_session_history, delete_session, share_session, copy_shared_session), multi-turn investigation examples (distinguishing standard YARA file rules from Chronicle YARA-L 2.0 UDM detection rules), VirusTotal AI Hosted MCP coverage (browser OAuth 2.1 with vt:reports:read / vt:submissions:write / vt:network-analysis:write and headless vtai_... Agent Token authentication, standalone unlinked VTAI account caveats, all 11 hosted tools including base64 submit_file and submit_attachment, 24 MB decoded upload limit and quotas, get_url_report URL privacy notes, Antigravity / Gemini CLI / Claude Code / Codex / Cursor / VS Code setup), and a troubleshooting matrix including HTTP 403 Invalid Agent Token and X-VTAI-Error: unexpanded_credential.
  • Wires remote Streamable HTTP MCP support into run-with-google-adk and updates docs/remote_server.md:
    • run-with-google-adk/pyproject.toml, run-with-google-adk/src/mcp_security_agent/config.py, toolsets.py, cli.py, server/routes.py, .env.example, README.md, and tests (test_config.py, test_toolsets.py, test_server.py): Implements GTI_MCP_URL (with automatic /api/v3/agentspace/mcp/ trailing-slash normalization, www.virustotal.com / ai.virustotal.com host-pinned x-apikey propagation, vtai_ token guard on ai.virustotal.com/mcp, follow_redirects=False client factory to block cross-origin and http:// redirect leaks across all mcp 1.x versions, and 300s timeouts), SECOPS_MCP_URL and SCC_MCP_URL (with https://*.googleapis.com and URL-userinfo validation plus an httpx.URL-normalized _GoogleCloudMcpAuth(httpx.Auth) client factory wrapping create_mcp_http_client so ADC / SECOPS_SA_PATH / impersonated credentials and x-goog-user-project attach on both get_tools(None) and get_tools(ctx), handle explicit :443 ports, fall back to ADC quota_project_id, and rotate expired or 401-rejected OAuth bearer tokens on a single pooled MCP session), and MINIMAL_LOGGING=Y logger/telemetry/span/SSE sanitization.
    • docs/remote_server.md: Standardizes Gemini CLI server key on "remote-mcp-secops" and "timeout": 60000, documents regional endpoints (https://<region>-chronicle.googleapis.com/mcp) for non-US Google SecOps tenants, adds roles/serviceusage.serviceUsageConsumer and Chronicle data role prerequisites, and updates the ADK Python snippet to use SecOpsGoogleAuth(httpx.Auth) + create_mcp_http_client with httpx.URL origin normalization, 1-shot 401 refresh, and follow_redirects=False.
  • Aligns Google SecOps Extension skills, tool mappings, and cross-repository documentation across 32 files:
    • extensions/google-secops/TOOL_MAPPING.md, docs/servers/gti_mcp.md, and server/gti/README.md: Reconciles local server/secops tool names (get_security_alerts, get_security_alert_by_id, do_update_security_alert, list_security_rules, search_security_rules, get_detection_rule, get_rule_detections, test_rule, get_stats), maps Remote UDM Stats / Aggregation to udm_search (stats.results), maps Remote Assign Case and Change Case Stage to update_case, fixes valid COLLECTION_RELATIONSHIPS (files, domains, ip_addresses, urls, etc.) and descriptors_only signatures across docs/servers/gti_mcp.md and server/gti/README.md, and maps 3-way GTI / VirusTotal capabilities.
    • gemini-extension.json, extensions/google-secops/GEMINI.md, extensions/google-secops/skills/hunt/SKILL.md, triage/SKILL.md, investigate/SKILL.md, setup-gemini-cli/SKILL.md, setup-antigravity/SKILL.md, setup-antigravity/mcp_config.template.json, docs/google_secops_extension.md, docs/personas/cti_researcher.md, docs/personas/threat_hunter.md, README.md, docs/index.md, docs/toc.md, and docs/usage_guide.md: Unifies "remote-mcp-secops" across Gemini CLI docs and gemini-extension.json, adds 60s timeouts across Gemini CLI and Antigravity (remote-secops-investigate / remote-secops-admin) configs, fixes gemini extensions install . root path and regional endpoint derivation, fixes get_entities_related_to_a_collection relationship arguments and UDM hash/IP fields in secops-hunt, wires optional GTI / VirusTotal IoC enrichment (with URL token privacy, submission confirmation, and session batching guards) into secops-triage, secops-investigate, and cti_researcher.md, and adds gti-agentic to the Threat Hunter and CTI Researcher persona guides.

Related PRs

Verification

  • Verified live tools/list and tool execution via ADK build_mcp_toolsets against both https://www.virustotal.com/api/v3/agentspace/mcp (7 tools, stateless response with no Mcp-Session-Id header, list_sessions(limit=1) isError=False) and Google SecOps Remote MCP (https://us-chronicle.googleapis.com/mcp and https://chronicle.us.rep.googleapis.com:443/mcp, get_tools(None)=74, get_tools(ctx)=74 on 1 pooled session, SIEM list_rules isError=False, SOAR list_cases isError=False, and SOAR list_integrations isError=False), plus cross-scheme HTTP 307 trailing-slash redirect behavior, HTTP 406 Accept header validation, and ai.virustotal.com/mcp HTTP 403 Invalid Agent Token behavior.
  • Ran run-with-google-adk hermetic unit and loopback HTTP test suite (pytest tests/): 54 passed across both latest dependencies (google-adk 2.14.1, mcp 1.30.0, Python 3.12) and --resolution=lowest-direct floor dependencies (google-adk==2.0.0, google-auth[requests]==2.48.1, google-genai==1.72.0, httpx==0.28.1, mcp==1.24.0, typer==0.16.0, Python 3.11), including mutation-verified origin-pinning, host-allowlist, no-redirect, :443 port normalization, 1-shot 401 token refresh, and MINIMAL_LOGGING=Y SSE tests.
  • Built HTML documentation cleanly with Sphinx + Furo + MyST (sphinx-build -b html -E docs ...) with zero myst.xref_missing or syntax warnings introduced across modified pages, and verified self-contained SVG contrast (>= 5.7:1 border contrast and >= 11.8:1 text contrast across light and dark backgrounds).
  • Parsed all JSON, YAML, TOML, and Python code blocks across docs/gti_remote_server.md, docs/remote_server.md, run-with-google-adk/README.md, docs/google_secops_extension.md, gemini-extension.json, and mcp_config.template.json, AST-verified every local tool and relationship name against server/gti, server/secops, and server/secops-soar, and passed git diff --check.

Add a setup and troubleshooting guide (docs/gti_remote_server.md) for the Google Threat Intelligence Agentic Streamable HTTP MCP server at https://www.virustotal.com/api/v3/agentspace/mcp/, alongside a theme-neutral SVG architecture comparison diagram and cross-links from README.md, docs/index.md, docs/toc.md, docs/usage_guide.md, docs/servers/gti_mcp.md, and server/gti/README.md.
…tool mappings

- Wire GTI_MCP_URL and SECOPS_MCP_URL to StreamableHTTPConnectionParams in run-with-google-adk (trailing slash normalization, thread-safe ADC header_provider refresh, 49 unit tests)
- Clarify VTAI Hosted MCP OAuth 2.1 scopes vs vtai_... Agent Tokens, standalone VTAI account caveats, Gemini CLI extension setup, portable bash/zsh API key prompt, and 403 Invalid Agent Token troubleshooting
- Fix local gti-mcp COLLECTION_RELATIONSHIPS and descriptors_only signatures in hunt/SKILL.md and docs/servers/gti_mcp.md, reconcile local server/secops tool names in TOOL_MAPPING.md, and wire optional GTI/VT enrichment in triage/investigate skills
…and extension configs

- Replace McpToolset header_provider with origin-pinned _GoogleCloudMcpAuth(httpx.Auth) client factory wrapping create_mcp_http_client for SECOPS_MCP_URL and SCC_MCP_URL so ADC credentials attach on get_tools(None) and rotate expired OAuth tokens on a single pooled session

- Wire MINIMAL_LOGGING=Y in bootstrap_environment() and SSE routes, add remote URL scheme/origin validation, wire SECOPS_SOAR_MCP_URL, and expand hermetic + loopback HTTP test suite to 52 passing tests

- Align remote-mcp-secops server key, 60s timeouts, regional <region>-chronicle.googleapis.com/mcp endpoints, and TOOL_MAPPING / skill contracts across docs and extensions
…ten remote MCP tests

- Normalize origin pins via httpx.URL so explicit :443 endpoints attach Authorization and x-goog-user-project, add ADC quota_project_id fallback and 1-shot 401 refresh, and reject embedded URL userinfo

- Force follow_redirects=False in MCP HTTP client factories across Google Cloud and GTI toolsets so x-apikey and x-goog-user-project never follow cross-origin or http:// 307 redirects even on mcp 1.24.0

- Auto-enable SCC_MCP_URL, preserve local SOAR stdio when SECOPS_SOAR_MCP_URL is set, set ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS=false under MINIMAL_LOGGING=Y, align lowest-direct floors, and expand tests to 54 passing

This branch has not been deployed

No deployments
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.

1 participant