Token导航 LogoToken导航TokenDH.com
Ad Campaign Agent logo
AI代理stdio官方级别未说明来源级核验

Ad Campaign Agent

MCP Server

一个使用Google ADK / Gemini 3 Pro作为协调器,基于FastAPI的微服务架构的广告活动AI代理系统,支持传统人类渠道和AI代理营销平台的双通道广告活动。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
PythonAI代理工作流自动化

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

xingbo778

提供方

xingbo778

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python -m venv venv

详细介绍

Ad Campaign AI Agent System

A production-ready scaffold for an ad-campaign AI agent system using Google ADK / Gemini 3 Pro as the orchestrator and multiple MCP-style microservices implemented as FastAPI apps.

Supports dual-channel campaigns: traditional human channels (Meta/Facebook/Instagram) and the Agent Marketing Platform (AMP) for reaching AI agents.

Architecture

  • Orchestrator Agent: Built with Google ADK / Gemini 3 Pro, coordinates all MCP services
  • MCP Microservices: FastAPI-based services for different campaign functions

- product_service: Product selection and grouping - creative_service: Ad creative generation (human + agent creatives) - strategy_service: Campaign strategy development (dual-channel: human + agent) - meta_service: Meta platform campaign creation (human channel) - amp_service: Agent Marketing Platform publishing (agent channel) - logs_service: Event logging and audit trails - schema_validator_service: Data validation - optimizer_service: Campaign optimization analysis (human + agent metrics)

Dual-Channel Concept

                    creative_service
                    ├── /generate_creatives        → Human creatives (text/image/video)
                    └── /generate_agent_creatives   → Agent creatives (structured schemas)
                              │
                    strategy_service (include_agent_channel=true)
                    ├── Human channels: 75% budget  → Facebook/Instagram/Meta
                    └── Agent channel: 25% budget   → AMP marketplace
                              │
               ┌──────────────┴──────────────┐
               ▼                             ▼
        meta_service                   amp_service
        (Meta Ads)                     (AMP marketplace)
               │                             │
               ▼                             ▼
          Human users                   AI Agents → Users

Project Structure

ad-campaign-agent/
├── app/
│   ├── common/
│   │   ├── config.py          # Configuration management
│   │   └── http_client.py     # HTTP client utilities
│   ├── orchestrator/
│   │   ├── agent_prompt.md    # Orchestrator agent prompt
│   │   ├── agent_config.yaml  # ADK agent configuration (9 tools)
│   │   └── clients/           # MCP service clients
│   └── services/
│       ├── product_service/
│       ├── creative_service/   # Extended: +agent creative generation
│       ├── strategy_service/   # Extended: +agent channel strategy
│       ├── meta_service/
│       ├── amp_service/        # NEW: Agent Marketing Platform
│       ├── logs_service/
│       ├── schema_validator_service/
│       └── optimizer_service/  # Extended: +agent channel metrics
├── requirements.txt
├── docker-compose.yml
├── Dockerfile
└── .env.example

Setup

Prerequisites

  • Python 3.11+
  • Docker and Docker Compose (optional)

Installation

  1. Clone the repository and navigate to the project directory:
cd ad-campaign-agent
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Copy .env.example to .env and configure:
cp .env.example .env
# Edit .env with your settings

Running Services

Option 1: Docker Compose (Recommended)

Start all services:

docker-compose up -d

Stop all services:

docker-compose down

Option 2: Individual Services

Run each service individually:

# Product Service
uvicorn app.services.product_service.main:app --host 0.0.0.0 --port 8001

# Creative Service
uvicorn app.services.creative_service.main:app --host 0.0.0.0 --port 8002

# Strategy Service
uvicorn app.services.strategy_service.main:app --host 0.0.0.0 --port 8003

# Meta Service
uvicorn app.services.meta_service.main:app --host 0.0.0.0 --port 8004

# Logs Service
uvicorn app.services.logs_service.main:app --host 0.0.0.0 --port 8005

# Schema Validator Service
uvicorn app.services.schema_validator_service.main:app --host 0.0.0.0 --port 8006

# Optimizer Service
uvicorn app.services.optimizer_service.main:app --host 0.0.0.0 --port 8007

# AMP Service (Agent Marketing Platform)
uvicorn app.services.amp_service.main:app --host 0.0.0.0 --port 8008

Service Endpoints

All services expose:

  • Main endpoint: POST /{service_endpoint}
  • Health check: GET /health
  • API docs: GET /docs (FastAPI auto-generated)

Example API Calls

Product Service:

curl -X POST http://localhost:8001/select_products \
  -H "Content-Type: application/json" \
  -d '{
    "campaign_objective": "conversions",
    "target_audience": {
      "demographics": {"age": [25, 45]},
      "interests": ["technology", "gadgets"]
    }
  }'

Creative Service (Human):

curl -X POST http://localhost:8002/generate_creatives \
  -H "Content-Type: application/json" \
  -d '{
    "products": [{"product_id": "prod_001", "name": "Widget", "category": "Electronics", "price": 99.99}],
    "campaign_objective": "awareness",
    "platform": "facebook"
  }'

Creative Service (Agent):

curl -X POST http://localhost:8002/generate_agent_creatives \
  -H "Content-Type: application/json" \
  -d '{
    "products": [{"product_id": "prod_001", "name": "Widget", "category": "Electronics", "price": 99.99}],
    "campaign_objective": "conversions",
    "target_agent_categories": ["shopping_assistant", "price_comparison"]
  }'

AMP Service:

curl -X POST http://localhost:8008/publish_to_amp \
  -H "Content-Type: application/json" \
  -d '{
    "agent_creatives": [{"creative_id": "ac_1", "product_id": "prod_001", "product_schema": {"name": "Widget", "category": "Electronics", "price": {"amount": 99.99, "currency": "USD"}}, "tags": ["electronics"]}],
    "budget": 2500.0,
    "bidding_strategy": "cost_per_recommendation"
  }'

Current Status

⚠️ All services currently return MOCK data.

Each service includes TODO comments indicating where real implementations should be added:

  • Database connections
  • External API integrations
  • ML model inference
  • Business logic

Next Steps

  1. Replace Mock Implementations:

- Add database connections (PostgreSQL, MongoDB, etc.) - Integrate with Meta Marketing API - Add Gemini API calls for creative generation - Implement real validation logic - Build AMP marketplace API integration - Implement real product schema generation from raw product data - Integrate third-party verification APIs (Vanta, UptimeRobot, G2)

  1. Orchestrator Integration:

- Configure Google ADK with agent_config.yaml - Wire up orchestrator to use MCP clients - Test end-to-end dual-channel campaign creation flow

  1. AMP Channel Development:

- Build real AMP marketplace backend - Implement product schema validation against AMP standards - Build sandbox API provisioning system - Implement agent bidding engine (CPR/CPQ/CPA) - Build agent query and recommendation tracking

  1. Production Readiness:

- Add authentication/authorization - Implement rate limiting - Add monitoring and observability - Set up CI/CD pipelines

Development

Code Structure

Each service follows the same pattern:

  • main.py: FastAPI application with endpoints
  • schemas.py: Pydantic models for request/response
  • mock_data.py: Mock data generators

Adding New Services

  1. Create service directory under app/services/
  2. Add main.py, schemas.py, mock_data.py
  3. Add service client in app/orchestrator/clients/
  4. Update docker-compose.yml and .env.example
  5. Add service URL to app/common/config.py

License

[Add your license here]

目录标签

目录标签

PythonAI代理工作流自动化广告活动管理本地部署微服务架构双通道广告营销自动化

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP