| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Sample code demonstrating how to connect AI agents to the Predactiv MCP server (https://mcp.predactiv.com) from Python.
The Predactiv Data Platform is exposed as a set of tools over the Model Context Protocol (MCP). These samples show how to authenticate, discover those tools at runtime, and let a large language model use them to work with your audiences, datasets, datasources, destinations, and more.
Predactiv MCP server (https://mcp.predactiv.com) turns the Predactiv Data Platform into an AI agent-native toolset over MCP, letting an LLM go from raw data to modeled, deliverable audiences without leaving the conversation. The toolset spans a few broad areas (and grows over time):
Tools are discovered dynamically at runtime (tools/list), so agents always see the latest capabilities, and every call is OAuth2 bearer-authenticated — see oauth-token-lib.
Each directory is a self-contained sample built on a different framework, plus a shared authentication helper:
| Directory | What it shows | LLM (for demo) |
|---|---|---|
| langchain/ | Agent built with LangChain + langchain-mcp-adapters, client-side tool-calling loop | OpenAI |
| claude/ | Agent using Anthropic Claude via the native server-side MCP connector | Anthropic Claude |
| openai/ | Agent using OpenAI GPT via the native server-side MCP connector | OpenAI |
| mcp-sdk/ | Direct use of the MCP Python SDK, client-side tool-calling loop with no framework | OpenAI |
| oauth-token-lib/ | Shared OAuth2 authentication helper used by all samples | — |
The LLM column is just what each sample happens to use for demonstration — not a requirement. The framework-based samples are model-agnostic: langchain/ and mcp-sdk/ can run on any LLM that supports tool calling (OpenAI, Anthropic, or others) by swapping the client and the *_MODEL constant at the top of agent.py. The two connector samples are tied to their provider by design — claude/ demonstrates Anthropic's native MCP connector and openai/ demonstrates OpenAI's, so each only makes sense with that provider. Predactiv MCP itself is LLM-agnostic; the choice of model is entirely yours.
Every sample follows the same three steps:
The claude/ and openai/ samples are a variation on steps 2–3: instead of fetching tools and running the loop client-side, they hand the MCP server definition to the provider's API (Anthropic's Messages API / OpenAI's Responses API), and the provider connects to the server and runs the tool-calling loop server-side. See each sample's README for details.
cd langchain
# (recommended) create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # on Windows: .venv\Scripts\activate
pip install -r requirements.txt
export CLIENT_ID=your-predactiv-client-id
export CLIENT_SECRET=your-predactiv-client-secret
python agent.pyPython 3.9+ (the mcp-sdk/ sample requires Python 3.10+, per the MCP Python SDK)
Predactiv OAuth2 API credentials (CLIENT_ID / CLIENT_SECRET)
An LLM provider API key, depending on the sample:
See each sample's README for details.
See LICENSE.
| Back | FazBrowse Home | New Git URL |