Skip to main content

Agent-side ES256 key enrollment and DPoP proof-of-possession (RFC 9449) for MCP broker authentication.

Project description

dpop-broker-auth

Agent-side ES256 key enrollment and DPoP proof-of-possession (RFC 9449) for MCP broker authentication.

Endpoints are discovered automatically from the broker's discovery document — no hardcoded paths.

Install

pip install dpop-broker-auth

Usage

from broker_auth import BrokerAuthClient

client = BrokerAuthClient(
    "https://your-broker.example.com",
    "<gateway-token>",
    keystore_path="broker_keypair.json",
)

# One-time enrollment (discovers endpoints, generates keypair, registers with broker)
if not client.is_enrolled:
    client.enroll()

# All requests include DPoP proof automatically
response = client.make_request(
    "POST",
    "https://your-broker.example.com/your/endpoint",
    json={...},
)

How it works

  1. On first run, enroll() discovers registration endpoints from the broker
  2. Generates an ES256 keypair and registers the public key
  3. Confirms ownership via challenge-response
  4. Saves the keypair to disk so the agent only enrolls once
  5. make_request() attaches a signed DPoP proof JWT to every request and handles nonce retry

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dpop_broker_auth-0.3.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dpop_broker_auth-0.3.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file dpop_broker_auth-0.3.0.tar.gz.

File metadata

  • Download URL: dpop_broker_auth-0.3.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for dpop_broker_auth-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5d352d16a692d85d739ee8183d0dbfd08ff72c0282c38c499dedb6b5f51d267f
MD5 5b2aaf25085c53a8573db350d78d7faa
BLAKE2b-256 68f12ad0fc26e547e9f78f068d6aa23d1a79626c7f5ddc96231fb4995503486c

See more details on using hashes here.

File details

Details for the file dpop_broker_auth-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dpop_broker_auth-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a74f4bfa85b6341882613326165b2f70afde3e72daed1e4e9d621cc3d99ea70
MD5 2358f34264cf75d46cefc5c8e4fa023a
BLAKE2b-256 ba16e0a99eed74def04b946d0e630a67d3b6ba352618841f9b010c60e423d762

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page