Skip to content

predictionguard/pg-demo-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prediction Guard × MCP Demo

A minimal CLI demo showing how to connect Prediction Guard's Responses API to a remote Model Context Protocol (MCP) server. The agent uses a mock / demo Salesforce MCP server as its tool backend and maintains a running conversation in the terminal.

What this shows

  • How to pass MCP servers as tools via the responses.create API
  • How to parse the Responses API output format (output[].content[].text)
  • How to maintain multi-turn conversation history with the Responses API

Prerequisites

  • Python 3.12+
  • uv (package manager)
  • A Prediction Guard API key

Setup

# 1. Clone the repo
git clone <repo-url>
cd pg-demo-mcp

# 2. Copy the env template and add your API key
cp .env_example .env
# Edit .env and set: PREDICTIONGUARD_API_KEY=<your key>

# 3. Install dependencies
uv sync

Run

uv run python main.py

You'll see an interactive prompt:

=== GTM Agent | PredictionGuard + Salesforce ===
Type 'quit' to exit.

You: What does our renewal pipeline look like?

Agent: Here's a summary of upcoming renewals...

Type quit or exit (or press Ctrl+C) to stop.

How it works

client.responses.create(
    model="gpt-oss-120b",
    input=conversation,       # full conversation history
    tools=sf_tools_json,      # MCP server config
)

The tools list declares the MCP server — its URL, label, and which tools the model is allowed to call. Prediction Guard handles the MCP protocol; your code only sees the final text response.

MCP tool config shape

{
    "type": "mcp",
    "server_url": "https://your-mcp-server/mcp",
    "server_label": "my-mcp-server",
    "allowed_tools": ["tool_one", "tool_two"],
    "server_description": "What this server does"
}

Project structure

main.py          # All demo logic
.env_example     # API key template
pyproject.toml   # Dependencies (managed by uv)

About

Minimal CLI demo showing how to connect Agent with PG Responses API to an MCP server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages