Skip to main content

mcpbundles-mcp-connect

Python client library for MCP Connect Auth on MCPBundles.

  • connect_auth_callback_identity() — canonical get-user-info JSON from a verified FastMCP token
  • McpbundlesConnectProvider — FastMCP auth (interim package export until upstream FastMCP merge)
  • mcpbundles_fastmcp() — one-line FastMCP setup (auth + optional origin handshake telemetry)
  • complete_federation() — finish OAuth federation after your sign-in flow
  • McpbundlesHandshakeMiddleware — origin initialize cohort ingest when telemetry is enabled

Identity in tool callbacks

Connect Auth separates who signed in (sub, optional organization_id, email, roles) from which MCP client is calling (client_id). Pass email and roles in federation complete to mint them on access tokens.

In FastMCP tools, use connect_auth_callback_identity(get_access_token()) for the same JSON shape as the mcp-use get-user-info example. See Tool callback identity.

Path B — bundle URL only

Publish with MCP Connect Auth, set your federation sign-in URL, and have clients connect via https://mcp.mcpbundles.com/bundle/{slug}. No pip install required on your MCP server.

Path A — vendor origin (FastMCP)

from mcpbundles_mcp_connect import connect_auth_callback_identity, mcpbundles_fastmcp
from fastmcp.server.dependencies import get_access_token

mcp = mcpbundles_fastmcp(
    "My App",
    listing_slug="my-listing",
    base_url="https://mcp.example.com",
)

@mcp.tool
def get_user_info() -> dict:
    token = get_access_token()
    if token is None:
        return {"error": "Not authenticated"}
    return connect_auth_callback_identity(token)

After sign-in on your web app, complete federation server-side:

from mcpbundles_mcp_connect import complete_federation

await complete_federation(
    listing_slug="my-listing",
    federation_secret=os.environ["MCPBUNDLES_FEDERATION_SECRET"],
    state=state_from_redirect,
    subject=user_id,
    organization_id=organization_id,
    email=user_email,
    roles=user_roles,
)

Full setup guide: https://www.mcpbundles.com/docs/integrations/mcp-connect-auth

pip install mcpbundles-mcp-connect

Download files

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

Source Distribution

mcpbundles_mcp_connect-0.1.2.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

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

mcpbundles_mcp_connect-0.1.2-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file mcpbundles_mcp_connect-0.1.2.tar.gz.

File metadata

  • Download URL: mcpbundles_mcp_connect-0.1.2.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mcpbundles_mcp_connect-0.1.2.tar.gz
Algorithm Hash digest
SHA256 68a828fed05cc7c0801f4e1d491c2ff9d476adec791b1879596f70f4902ae69a
MD5 b21234b45432e7e41fca6423782c927f
BLAKE2b-256 4da707a0cd5e72f374cb3d8dbf87c6a15d0497a5e7107805d5c2799fddc1683d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpbundles_mcp_connect-0.1.2.tar.gz:

Publisher: release.yml on thinkchainai/mcpbundles-mcp-connect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcpbundles_mcp_connect-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mcpbundles_mcp_connect-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5d8555c4ee0c038cb9e3e595070b06ecf2c0a907830b317dab3d88bee33fb8a4
MD5 8ab7bc827d853d7b432f27f3781c6bc7
BLAKE2b-256 05b5e2c361f3f901e67473acb871ff5e247e01738b2cf65c538af52114ec99f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpbundles_mcp_connect-0.1.2-py3-none-any.whl:

Publisher: release.yml on thinkchainai/mcpbundles-mcp-connect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.3

2 files

This release

0.1.2 This release

2 files

0.1.0

2 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