Skip to main content

mcs-permission

Consent / permission decorator for the Model Context Standard (MCS).

Provides PermissionDecorator -- a BaseDecorator that gates tool execution behind a consent callback. Before execute_tool runs, the decorator asks the client whether the pending tool call (name + arguments) is allowed; on denial it returns a structured permission_denied result instead of executing.

Installation

pip install mcs-permission

Usage

from mcs.permission.decorator import PermissionDecorator

def ask_user(tool_name, arguments) -> bool:
    return input(f"Run {tool_name}? [y/N] ").strip().lower() == "y"

guarded = PermissionDecorator(MyToolDriver(...), consent=ask_user)
orchestrator.add_driver(guarded, label="mail")

It wraps the ToolDriver layer, so the surrounding orchestrator keeps its process_llm_response loop and calls execute_tool -- the decorator -- beneath it. Decorators stack: PermissionDecorator(AuthDecorator(RealToolDriver)) checks consent first and handles auth challenges deeper down.

Advertises the "consent" capability and is reachable via DriverMeta.resolve_capability(driver, SupportsConsent).

License

Apache-2.0

Metadata

Release files for mcs-permission 0.1.0

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

Source distribution (sdist)

Source distribution for mcs-permission 0.1.0
File Size Uploaded
mcs_permission-0.1.0.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcs-permission 0.1.0
File Interpreter ABI Platform
mcs_permission-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.2 kB

Release files / mcs_permission-0.1.0.tar.gz

Download URL mcs_permission-0.1.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7c23fd7ecbbf09bd29e68199b216e1d94a43a46b88949eb41880915a0ce0d8bb
BLAKE2b-256 checksum
How to use checksums
f2ee7e6d80c386bdeaf0312034bfc58ace74cbeaa4489f85f891f764c668d2ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / mcs_permission-0.1.0-py3-none-any.whl

Download URL mcs_permission-0.1.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
01c85e6f840f40eaae9fdf1245b9d74582c22d28d2a3485c3b83a4ecb0a1d091
BLAKE2b-256 checksum
How to use checksums
06b2bd9f2ddd54e14735d2762704405fbe6c3141e4bf87d47ea668029ccc327e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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