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.2.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.2-py3-none-any.whl (83.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: within_sdk-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 9847ef46546be4e88635a64a86eac80e6e271cfa745c774713c6a1b49784710c
MD5 0ac54ea1ea2de996f5501d2a40075974
BLAKE2b-256 ed3a522c9302f252bbf73e4b8a04df38471a0cce0c3896a1a988afc81d3f32bf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: within_sdk-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2e11b630ac4e7f180a44fb535a1385440d3ae51174416cd163310453d484b598
MD5 3f4e1a13661dc389ed76776953266edb
BLAKE2b-256 092d9d1123661d4207dc9d6ca4492eaed2c569cd4ed5722ccc7b40a15136f940

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

This release

0.1.2 This release

2 files

0.1.1

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