Skip to main content

within-sdk (Python)

Within usage capture for Python MCP servers — official FastMCP, community FastMCP v2/v3, and low-level mcp servers.

from mcp.server.fastmcp import FastMCP
from within_sdk import track, WithinOptions, UserIdentity

server = FastMCP("acme")

track(server, "acme", WithinOptions(
    api_key=os.environ["WITHIN_SDK_API_KEY"],
    identify=lambda request, extra: UserIdentity(
        user_id=current_user_uuid(extra), user_name=None, user_data=None
    ),
))

The user identifier is hashed locally (SHA-256, byte-identical to the TypeScript SDK and the outcomes connector) before anything leaves the process; raw identifiers never go on the wire. Events publish to https://api.getwith.in/v1/ingest/events (override with WITHIN_SDK_INGEST_BASE_URL).

Forked from mcpcat-python-sdk (MIT).

Download files

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

Source Distribution

within_sdk-0.1.1.tar.gz (74.0 kB view details)

Uploaded Source

Built Distribution

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

within_sdk-0.1.1-py3-none-any.whl (83.3 kB view details)

Uploaded Python 3

File details

Details for the file within_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: within_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 74.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.4

File hashes

Hashes for within_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e22b59336b6e058e5b2350c32ec898e8a46f497f441f88dce54d854aeae2051c
MD5 e57318ed4ec183be53813e914e50d0c4
BLAKE2b-256 01f31c3c3ce73d359580e22ecb05e74305e69d3e23bf10daea65f0b434c2da31

See more details on using hashes here.

File details

Details for the file within_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: within_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 83.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.4

File hashes

Hashes for within_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 12ca265a154e4799120f1cd2cd6ae7ad0933cb478c84ad2716ab155d63ec814f
MD5 17f665b1efb666ee62f8a32509ce62fa
BLAKE2b-256 8fc0b6899c7088012802df6415e1582e1eacf11777bff8177bd98fa3c82afc77

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

This release

0.1.1 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