Skip to content

feat(mcp): Phase 13 scoped auth preflight - #383

Merged
erishforG merged 2 commits into
release/1.0from
feat/auto-mcp-phase13-scoped-auth
Jul 10, 2026
Merged

feat(mcp): Phase 13 scoped auth preflight#383
erishforG merged 2 commits into
release/1.0from
feat/auto-mcp-phase13-scoped-auth

Conversation

@erishforG

Copy link
Copy Markdown
Owner

무엇

MCP delegated GitHub auth context에 선택적 scope metadata를 추가하고, 명시된 scope가 부족하면 handler dispatch 전에 INSUFFICIENT_SCOPE MCP error envelope를 반환합니다.

Refs #292. v1.0 MCP tool spec의 scope negotiation 계약을 실제 dispatcher preflight와 맞춥니다. pull_request:write가 parsec PR 작업의 pull_request:read를 만족한다는 규칙도 코드로 고정했습니다. @erishforG

변경

  • McpContextgithub_scopes metadata와 with_github_auth helper 추가
  • GitHub-backed tool preflight에서 scoped delegation이 있을 때 required/optional scopes 검증
  • 부족한 scope에 대해 INSUFFICIENT_SCOPE structured error 반환
  • spec 문서에 scoped metadata enforcement 및 legacy unscoped delegation 동작 명시
  • MCP tests 추가

다음 Phase 힌트

MCP host initialize/session metadata에서 delegated token scopes를 McpContext::with_github_auth로 연결하는 transport boundary를 추가할 수 있습니다.

리스크

Low. src/mcp/docs/mcp/만 변경하며, scope metadata가 없는 기존 delegated token은 legacy-compatible하게 허용합니다.

롤백

이 PR revert 시 scoped metadata enforcement만 제거되고 기존 token-required preflight는 유지됩니다.

Test plan

  • cargo test --quiet mcp::tests
  • cargo build --quiet
  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --quiet

Refs #292

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@erishforG erishforG added the auto-improvement Daily auto-generated improvement PR/issue label Jul 10, 2026
@erishforG
erishforG merged commit a8edf8b into release/1.0 Jul 10, 2026
12 checks passed
@erishforG
erishforG deleted the feat/auto-mcp-phase13-scoped-auth branch July 10, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-improvement Daily auto-generated improvement PR/issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant