Skip to main content

Login CLI and MCP server for the Data Platform API.

Project description

Marketing Data Platform

Python package for local agents and MCP clients that need to access the Data Platform API.

It provides two commands:

  • data-platform-login: login with Google and save a local Data Platform API session.
  • data-platform-mcp: start the MCP server that exposes mart access tools.

The MCP server does not connect to BigQuery directly. It calls the Data Platform API, and the API owns BigQuery credentials, authorization, and tenant access control.

Install

For local development:

uv run --package marketing-data-platform data-platform-login --help
uv run --package marketing-data-platform data-platform-mcp

After publishing to PyPI:

uvx --from marketing-data-platform data-platform-login --help
uvx --from marketing-data-platform data-platform-mcp

Login

The Data Platform API must be running and configured with Google OAuth.

uvx --from marketing-data-platform data-platform-login \
  --api-base-url https://data-platform-api.example.com

The CLI fetches the Google OAuth client ID from the Data Platform API. User machines do not need DATA_PLATFORM_GOOGLE_OAUTH_CLIENT_ID or DATA_PLATFORM_GOOGLE_OAUTH_CLIENT_SECRET.

By default, the command writes the MCP session file to:

~/.config/data-platform/mcp.env

The session token is saved locally with file mode 600 and is not printed.

MCP Config

For a published package:

[mcp_servers.data-platform-mart]
command = "uvx"
args = ["--from", "marketing-data-platform", "data-platform-mcp"]
startup_timeout_sec = 120

For this monorepo during development:

[mcp_servers.data-platform-mart]
command = "uv"
args = [
  "run",
  "--directory",
  "/path/to/data-platform",
  "--package",
  "marketing-data-platform",
  "data-platform-mcp",
]
startup_timeout_sec = 120

MCP Tools

  • get_daily_ad_performance

Environment Variables

Name Required Description
DATA_PLATFORM_API_BASE_URL optional Data Platform API base URL. Default: http://127.0.0.1:8002
DATA_PLATFORM_API_SESSION_TOKEN optional Session JWT issued by login. Usually read from the session file.
DATA_PLATFORM_MCP_SESSION_FILE optional Session env file. Default: ~/.config/data-platform/mcp.env
DATA_PLATFORM_MCP_DEFAULT_LIMIT optional Default row limit. Default: 100
DATA_PLATFORM_MCP_MAX_LIMIT optional Max row limit. Default: 1000

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

marketing_data_platform-0.1.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

marketing_data_platform-0.1.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for marketing_data_platform-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e8a1a474d4b41026fc11df69ad2810c149c1f20c91e57b3a661e639c9bf866c1
MD5 2721dddfa0697f101d5b6020bca263b6
BLAKE2b-256 e9b3eba3d9fee25f39b5c8ca37e334dcc80027dfcb443e7d7395a4c7a85848b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marketing_data_platform-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11b486e7209a3c665afbc551fcf0097adba2e621f9d7e049bdb9655fe6233674
MD5 376e9034234c5a2b6905a75a98812210
BLAKE2b-256 52eb751518eab492492d572bb6f629c5e1e30bc042d580ab0e946a5d88f44116

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