Skip to content

docs: separate tool discovery and execution authorization - #3647

Closed
starsstreaming wants to merge 1 commit into
modelcontextprotocol:mainfrom
starsstreaming:docs/separate-tool-authorization
Closed

starsstreaming wants to merge 1 commit into
modelcontextprotocol:mainfrom
starsstreaming:docs/separate-tool-authorization

Conversation

@starsstreaming

Copy link
Copy Markdown

Authenticated callers need permission for both the operation and the target data.
Add an authorization-guide example that separates token verification, tool
discovery, operation scopes, and tenant ownership without changing SDK APIs.

Motivation and Context

The existing guide explains token verification and caller identity, but does not
show a complete per-tool and per-resource policy. The new example has two tools:
notes_read(note_id) and notes_update(note_id, text).

A read-only caller sees only notes_read; guessing notes_update still results in
denial before its handler runs. A writer can update its own tenant's note but
cannot access another tenant's note. Scope rules are shared between discovery and
execution, and handlers enforce scopes independently of provisional middleware.
Tenant identity comes from trusted token claims, never tool arguments.

The guide explains generic RPC denials, demo-only tokens, caller-specific
discovery, and atomic ownership checks for persistent data. Missing and foreign
notes receive the same error without resource details.

Issue linkage: no assigned issue is currently linked to this documentation
contribution. The assignment checklist below is intentionally unchecked.

How Has This Been Tested?

  • 24 authorization documentation tests pass through the public client and an
    in-process HTTP transport, including authentication rejection, guessed and
    unconfigured tools, shared-server discovery across callers, tenant isolation,
    denied-write preservation, and handler enforcement without middleware.
  • Full local test suite: 6,115 passed, 8 skipped, 1 existing xfailed; 100% line and
    branch coverage; strict-no-cover passes.
  • Repository-wide Ruff lint/format, Pyright, and README snippet checks pass.
  • English documentation build and render-order checks pass with external
    inventory failures allowed because downloads were restricted in the environment.

Breaking Changes

None. This adds documentation, an example, and tests only.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I am assigned to the linked issue (or it is labeled help wanted, or I'm a maintainer)
  • I have disclosed any AI assistance and can explain the change in my own words
  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

AI assistance disclosure: This contribution was prepared with Codex assistance
and reviewed by the contributor before submission.

@github-actions github-actions Bot added the missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md) label Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

This PR has been closed automatically. This repo only keeps pull requests open when they come from a maintainer, or from a contributor a maintainer has assigned to the linked issue, and this PR doesn't link an open issue yet.

  • If you're already assigned to an issue for this, add Fixes #<n> to the description and the PR will reopen on its own.
  • If there's no issue yet, please open one instead: what you ran into, why it matters for your use case, and a minimal reproduction. That context is super important to us and is what we use to decide what to prioritise.
  • If there's an issue but you're not assigned, add Fixes #<n> anyway so they're linked, then engage on the issue itself by confirming the repro or describing the approach you'd take. Assignment is a maintainer call based on capacity; comments that only ask to be assigned don't factor in. If you are assigned, this PR reopens automatically.

You're welcome to keep pushing commits here (just avoid force-pushing, since GitHub can't reopen a rewritten branch), but that on its own won't get the PR reviewed or the issue assigned, and realistically most auto-closed PRs stay closed. There's no need to open a new PR either way.

CONTRIBUTING.md has the full reasoning, but in short:

  • We're a small team with very little capacity to review community PRs right now.
  • Many recent PRs are AI-generated with little human review, and reviewing one carefully still costs a maintainer as much time as it ever did. A well-described issue is usually more useful to us than the code.

Maintainers: reopen, remove missing-issue-link, or add bypass-issue-check to override.

@github-actions github-actions Bot closed this Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants