agent/php/Mcp
Snider 599544010e feat(agent/mcp): McpContext::getScopes() + hasScope() (HIGH)
McpContext exposes the authenticated session's authorisation scopes
via getScopes(): array and hasScope(string): bool.

Resolution order:
1. Explicit scope source passed to constructor
2. Session-like object linked to an API key
3. Authenticated Laravel request context (mcp_workspace_context,
   agent_api_key, api_key)
4. Empty array (default) — never null

Dedupes scope strings, normalises separators in hasScope() matching.

Closes the OFM MCP tool gap where scope-gated tools currently return
empty/incorrect handling. No call-site stubs found needing update in
this worktree — call sites pick up the new method directly.

Pest covers: session scopes returned, hasScope present/missing, empty
session defaults to [], request-context regression against real MCP
auth shape.

Co-authored-by: Codex <noreply@openai.com>
Closes tasks.lthn.sh/view.php?id=1014
2026-04-25 19:04:35 +01:00
..
Console feat(mcp): implement §8 Console Commands (3 commands) (#853) 2026-04-25 05:27:48 +01:00
Data feat(mcp): implement §3 Services (ToolRegistry + McpQuotaService + QueryAuditService + ToolDependencyService) (#851) 2026-04-25 05:14:15 +01:00
Prompts revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Resources feat(mcp): implement extended RFC services + transport (#842) 2026-04-25 05:50:16 +01:00
Servers revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Services feat(mcp): implement extended RFC services + transport (#842) 2026-04-25 05:50:16 +01:00
Tools/Agent fix(agent/brain): batch — org maxLength + retry semantics + forget index cleanup 2026-04-25 14:55:40 +01:00
Transport feat(agent/mcp): McpContext::getScopes() + hasScope() (HIGH) 2026-04-25 19:04:35 +01:00
.DS_Store revert fcb9c189e5 2026-04-23 12:32:57 +01:00