Skip to content

fix(mcp): make Search Console site_url optional so tenant auto-resolve works (H1) - #447

Merged
hyoshi merged 1 commit into
mainfrom
fix/sc-site-url-optional
Jul 18, 2026
Merged

fix(mcp): make Search Console site_url optional so tenant auto-resolve works (H1)#447
hyoshi merged 1 commit into
mainfrom
fix/sc-site-url-optional

Conversation

@hyoshi

@hyoshi hyoshi commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes review finding H1, which slipped through un-applied in #441 (a dispatch miss — I reported it fixed when it wasn't; the docs audit surfaced it).

The bug

Every Search Console tool declared site_url in its inputSchema required, so server.handle_call_tool rejected an omitted site_url at _validate_tool_input before the handler ran — making _resolve_site_url's single-property auto-resolution (for a tenant-scoped multi-account client) unreachable. Fail-safe (rejects), so no security impact — but the documented feature was dead. The existing tenant-scope tests call handlers directly, bypassing the schema, so they never caught it.

The fix

Drop site_url from required on all Search Console tools; it stays an optional property. Enforcement is unchanged and lives in _resolve_site_url:

  • Standalone OSS (not tenant-scoped): still _requires site_url — omitting it errors from the handler.
  • Multi-account: bound to the active client's allow-listed property — single → auto-resolve, multiple → refuse (no silent fallback), out-of-scope → refuse, unconfigured → fail-closed.

Verification

  • Security review verified end-to-end via server.handle_call_tool that no cross-tenant path opens (sibling property refused, single auto-resolves to the tenant's own property only, empty allow-list fail-closed, whitespace/non-string handled). 越境不可を確認.
  • New schema-path regression test (test_search_console_site_url_optional.py) — fails before the fix, passes after. Updated test_required_fields expectations. Synced docs/mcp-server.md required columns.
  • pytest -k search_console → 83 passed; ruff check mureo/ / black --check mureo/ / mypy clean.

https://claude.ai/code/session_01X3WKmku93ucAR8DsatzLpG

…e works (H1)

Every Search Console tool declared `site_url` in its inputSchema `required`, so
`server.handle_call_tool` rejected an omitted `site_url` at `_validate_tool_input`
before the handler ran — making `_resolve_site_url`'s single-property
auto-resolution (for a tenant-scoped multi-account client) unreachable. This was
review finding H1, which slipped through un-applied in #441.

Drop `site_url` from `required` on all Search Console tools (it stays an optional
property). Enforcement is unchanged: `_resolve_site_url` still `_require`s it in
standalone use and binds it to the active client's allow-listed property under a
multi-account backend (single → auto-resolve, multiple/out-of-scope/unconfigured
→ refuse, fail-closed). Verified end-to-end via `server.handle_call_tool` that no
cross-tenant path opens.

Adds a schema-path regression test (the existing tenant-scope tests call handlers
directly, bypassing the schema that was the actual bug), updates the
`test_required_fields` expectations, and syncs the docs/mcp-server.md required
columns.

Claude-Session: https://claude.ai/code/session_01X3WKmku93ucAR8DsatzLpG
@hyoshi
hyoshi merged commit 5678dd8 into main Jul 18, 2026
9 checks passed
@hyoshi
hyoshi deleted the fix/sc-site-url-optional branch July 18, 2026 23:10
@hyoshi hyoshi mentioned this pull request Jul 18, 2026
hyoshi added a commit that referenced this pull request Jul 18, 2026
Bump 0.10.28 -> 0.10.29 (pyproject, __init__, plugin.json,
gemini-extension.json, 51 SKILL.md frontmatters) and cut the CHANGELOG for the
Search Console site_url schema fix (#447/H1) and the full documentation refresh
(#446) merged since 0.10.28.

Claude-Session: https://claude.ai/code/session_01X3WKmku93ucAR8DsatzLpG
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