Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

tba-capability-mcp-authorization

TBA · Tigrbl Auth

tba-capability-mcp-authorization

MCP grant resolution, current scope authorization, and owned connection revocation.

pypi: tba-capability-mcp-authorization unpublished Source version: 0.4.0.dev1 Python: >=3.10,<3.16 Layer: 040-capabilities Lifecycle: active License: Apache-2.0 Notice: attribution

pypi downloads: tba-capability-mcp-authorization: unpublished README hits: tba-capability-mcp-authorization

README standards: CI gate Tests: example source Certification: not certified Governance: repository policy Evidence: source and CI

Overview · Installation · Quick Start · Usage · API · Contributing · Governance · License


Overview

Summary

Resolve current owner and bot permissions for an approved MCP connection.

Why This Package

A stored grant records consent. Each request still needs to check the account, acting identity, and resource at the time of use.

When to Use

Use it between OAuth validation and the product's MCP resource policy.

Features

  • Check browser consent against requested and currently held scopes.
  • Resolve a live principal from a grant bound to the client, resource, and tenant.
  • Require a tool's scopes and the application's own resource check.
  • Delegate owned connection revocation to the authoritative store.

Non-Goals

OAuth transport, token validation and issuance, transaction management, and application resource policy are provided by the host.


Getting Started

Prerequisites

Python 3.10 or later, an authenticated OAuth integration, and an application grant and identity store.

Installation

The package is pre-release. Build from the repository with its pinned dependency sources.

uv

tba-capability-mcp-authorization is not declared published. From the source checkout:

uv pip install .

pip

tba-capability-mcp-authorization is not declared published. From the source checkout:

python -m pip install .

Poetry

tba-capability-mcp-authorization is not declared published. From a separate Poetry project, replace the path with your checkout:

poetry add /path/to/tba-capability-mcp-authorization

Quick Start

Example

Source: docs/readme/quick_start.py.

from tba_capability_mcp_authorization import MCPGrantBinding

binding = MCPGrantBinding(
    grant_id="g-123",
    tenant_id="example-tenant",
    client_id="example-client",
    resource="https://example.com/mcp",
)
assert binding.tenant_id == "example-tenant"

Expected Result

The binding identifies one grant, client, tenant and MCP resource.


Usage

Common Workflows

Call approve after validating the browser principal and OAuth request. Persist consent and issue authorization codes through the product's transactional callback. Call resolve for live scope checks after OAuth validation, and authorize_tool to include the product's resource check.

Source: docs/readme/usage.py.

from collections.abc import Callable

from tba_capability_mcp_authorization import (
    MCPAuthorizationCapability,
    MCPGrantBinding,
    MCPResourceCheck,
    MCPPrincipal,
)


async def authorize_read(
    capability: MCPAuthorizationCapability,
    verified_binding: MCPGrantBinding,
    verified_token_scopes: frozenset[str],
    can_read_resource: MCPResourceCheck,
) -> MCPPrincipal | None:
    return await capability.authorize_tool(
        verified_binding,
        verified_token_scopes,
        required_scopes={"journal:read"},
        check_resource=can_read_resource,
    )


assert isinstance(authorize_read, Callable)

Configuration

Inject a scoped grant store, a current subject lookup, and an optional clock. Use an absolute Unix timestamp for grant expiry.

Error Handling

Invalid consent raises PermissionError or ValueError. An unavailable grant or failed tool check returns no principal. Infrastructure failures from injected operations propagate to the host.

Best Practices

Build the binding from verified OAuth metadata and the expected resource. Use live subject snapshots for each check. Require scoped, atomic revocation and authorization-code redemption at the storage boundary.


Package Boundary

What It Owns

Grant and subject binding comparison, current scope intersection, tool-scope enforcement, and orchestration of an owned revoke operation.

Public API and Import Surfaces

tba_capability_mcp_authorization exports MCPAuthorizationCapability, MCPGrantBinding, MCPGrant, MCPSubject, MCPPrincipal, and adapter types. Use resolve_mcp_grant if the host already loads the current grant within its own token transaction.

Entry Points

This package declares no command-line, GUI, or plugin entry points in its manifest.

Injected Dependencies

MCPGrantStore loads a bound grant and revokes it with owner and binding checks inside the write. The subject lookup returns the currently active account or the owner's bot.

Protocol Consumers

Use with a server-side MCP OAuth integration. Refresh adapters can use live scope resolution before calling the token rotation operation.

Extensions

Use tba-concrete-mcp-delegation for the browser consent permission matrix. Product adapters supply tool-specific resource checks and response projection.


Operations and Readiness

Operational Requirements

OAuth and storage adapters enforce token validity, transactional issuance, current grant state and any product-specific mutation invariants.

Health and Observability

The host owns adapter health, token lifecycles, audit events, and transport error responses.

Security and Resource Limits

Only trusted callers construct the grant binding. Keep the mutation and its resource check consistent with the host transaction. Validate OAuth before delegating to this package.

Compatibility

Scope and identifier strings are opaque to this package. Resource bindings are matched exactly. Adapters retain the product's existing credential and HTTP formats.


Verification

Tests

The package tests exercise journal and forum scope fixtures, live status changes, grant expiry and scoped revocation. The README examples are runnable.

Certification Status

Consumer integration and certification are pending.

Evidence

Unit tests verify the capability's decision boundary. Application tests cover routing, token storage and grant transaction guarantees.


FAQ

Why

Applications share the owner/bot scope intersection and enforce their own article, forum, or other resource rules.

How

Pass the verified OAuth grant binding and scopes into the capability and supply the product's resource check before invoking a tool.

When

Resolve current authorization at refresh, discovery, and tool invocation.


More Documentation

The example files demonstrate grant binding and a tool authorization adapter.

tba-concrete-mcp-delegation, tba-durability-delegation, and tba-capability-token-issuance.


Contributing

How to Contribute

Add fixtures for shared authorization semantics and verify the relevant application adapters.

Development Setup

Use the repository's uv environment and package test suite.

Notes for Maintainers

Keep the package free of product-specific roles and resource identifiers.


Governance

Ownership and Decision Making

Tigrbl Auth owns the shared decision boundary. Consumer maintainers own storage adapters and resource policy.

Standards and Policies

Use the existing OAuth and delegation contracts when composing an integration.

Lifecycle and Migration

Adopt behind the current application routes and storage contracts first.


License and Attribution

License

Licensed under Apache-2.0. See LICENSE.

Notices

See NOTICE for attribution.

Metadata

Release files for tba-capability-mcp-authorization 0.4.0.dev1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tba-capability-mcp-authorization 0.4.0.dev1
File Size Uploaded Provenance Actions
tba_capability_mcp_authorization-0.4.0.dev1.tar.gz 11.1 kB Without provenance Details for tba_capability_mcp_authorization-0.4.0.dev1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tba-capability-mcp-authorization 0.4.0.dev1
File Interpreter ABI Platform Actions
tba_capability_mcp_authorization-0.4.0.dev1-py3-none-any.whl Python 3 none any Details for tba_capability_mcp_authorization-0.4.0.dev1-py3-none-any.whl

Total release size: 23.6 kB

Release files / tba_capability_mcp_authorization-0.4.0.dev1.tar.gz

Download URL tba_capability_mcp_authorization-0.4.0.dev1.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4adcbc325ca9f0630a1b79e2195d12a126f96a4cc73aaa9925a2307f45fe5eda
BLAKE2b-256 checksum
How to use checksums
4abb66da9c10b712a2bb53ac758bf1bdffeb0f24b69fb514e68ddd731540ed45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / tba_capability_mcp_authorization-0.4.0.dev1-py3-none-any.whl

Download URL tba_capability_mcp_authorization-0.4.0.dev1-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d59e9478a14bea053af649b24348981daba849b49fbbc2c3ca37ad3be257469
BLAKE2b-256 checksum
How to use checksums
11fe1f781003b031bb3b5f9bb2f889fb0dbe59daf6bccf11acd09fd5ea97ba9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for tba-capability-mcp-authorization 0.4.0.dev1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page