Skip to main content

The shared core of the Measure MCP ecosystem: domain models, enums, Health Score, OAuth/auth, config, logging, Google clients, permissions, cost control, MCP utilities, adapters and the `measure` CLI.

Project description

measure-sdk

The single shared library of the Measure MCP ecosystem.

Every Measure MCP product (measure-analytics-mcp, measure-paid-media-mcp, …) depends on this package and only this package. It carries the common domain model and infrastructure so the products never duplicate either.

from measure_sdk import AuditFinding, Report, HealthScore, CostEstimate, Severity
from measure_sdk.infra import PermissionPolicy, get_logger
from measure_sdk.mcp import build_server, ServerContext, tool_errors

Two layers

measure_sdk.domain — shared domain model

Canonical, reusable models and enums every MCP consumes instead of redefining:

Group Symbols
Findings & reports AuditFinding (alias Finding), Issue, Recommendation, Report (alias AuditReport)
Health HealthScore, HealthCheck, Grade, compute_health_score, score_from_findings, grade_for
Cost & validation CostEstimate, ValidationResult
Alerts Alert, AlertType, Comparator, Channel, ChannelType, Condition
Execution ExecutionPlan, PlannedChange, ChangeAction
Resources Connection, Entity, Metric, PlatformResource
Enums Severity, Priority, Category

The Health Score is a standard 0-100 measure (from_checks weighted average or from_findings penalty model) so platform health is comparable across MCPs.

measure_sdk.infra — shared infrastructure

Module Responsibility
infra.config Typed settings from env / .env (Pydantic Settings).
infra.logging Structured logging (console or JSON).
infra.errors Exception hierarchy mapped to MCP tool errors.
infra.auth OAuth-first credential resolution (ADC / service account / OAuth) + scopes, session, discovery.
infra.permissions Read-only-by-default policy and write-confirmation gating.
infra.cost_control Reusable cost-guardrail policy and byte humaniser.
infra.audit Append-only audit log of every privileged action.
infra.google Lazily-constructed, cached Google API clients.

Plus measure_sdk.mcp (build_server, ServerContext, tool_errors, and the shared auth tools measure_login / auth_status / auth_doctor every server inherits), measure_sdk.adapters (OpenAI / Gemini ↔ MCP translation) and measure_sdk.cli (the measure login / measure doctor command).

Nothing here ever persists credentials — secrets are resolved at runtime and held only in memory.

Authentication

Users sign in with their own Google account via the installed-app OAuth flow — from inside the assistant (measure_login) or the CLI (measure login). See docs/authentication.md for the full setup (create the OAuth client, consent screen, test users, scaling).

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

measure_sdk-0.2.0.tar.gz (57.1 kB view details)

Uploaded Source

Built Distribution

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

measure_sdk-0.2.0-py3-none-any.whl (61.7 kB view details)

Uploaded Python 3

File details

Details for the file measure_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: measure_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 57.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for measure_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ceed20fc058222d4d8615bd649cc05b2f1d40ca26ee3933b2cc01cdb6bb19bc6
MD5 22798d85462fc15586265eaea67b5573
BLAKE2b-256 6f1f7ae5c9400fb6b24b094a938282d12d249b5e325e1fb5eaabb4e6b1d66718

See more details on using hashes here.

Provenance

The following attestation bundles were made for measure_sdk-0.2.0.tar.gz:

Publisher: release.yml on measure-mcp/measure-sdk

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

File details

Details for the file measure_sdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: measure_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 61.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for measure_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 168fa814099ec171c7afe1c48b3a967d721742512d209d8f9b53b3559d415876
MD5 bdc9e11ef2021d52a8991164f337bbd6
BLAKE2b-256 818e136d2528070ea35f2af65125a0ac3971287c4170765d1dfaf7e168faa4e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for measure_sdk-0.2.0-py3-none-any.whl:

Publisher: release.yml on measure-mcp/measure-sdk

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

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