Set up the Prebid Sales Agent for local development.
| Tool | Version | Install |
|---|---|---|
| Python | 3.12+ | python.org |
| Docker + Compose | Latest | docker.com |
| Git | Any | git-scm.com |
| uv | Latest | curl -LsSf https://astral.sh/uv/install.sh | sh |
| ast-grep | Latest | brew install ast-grep (macOS) or ast-grep.github.io |
Note:
ast-grepis a Rust CLI tool used by theast-grep-bdd-guardspre-commit hook for BDD step structural pattern detection. It cannot be installed viauv— it requires a separate system install. Without it, commits that touchtests/bdd/steps/will be blocked locally.
git clone https://github.com/prebid/salesagent.git
cd salesagent
make setupmake setup runs scripts/setup-dev.py, which handles everything:
- Verifies prerequisites (Python, Docker, uv, git)
- Installs Python dependencies (
uv sync) - Creates
.envfrom.env.template(preserves existing values) - Installs pre-commit hooks
- Checks for tox (optional, used by the test runner)
- Starts Docker services (
docker compose up -d) - Waits for database migrations to complete
- Verifies health check at
http://localhost:8000/health
When complete, services are running at http://localhost:8000:
| Service | URL |
|---|---|
| Admin UI | http://localhost:8000/admin/ |
| MCP Server | http://localhost:8000/mcp/ |
| A2A Server | http://localhost:8000/a2a |
| Health Check | http://localhost:8000/health |
Test login: Click "Log in to Dashboard" on the login page (password: test123).
If you prefer to run each step yourself:
# 1. Clone and enter the repository
git clone https://github.com/prebid/salesagent.git
cd salesagent
# 2. Install Python dependencies
uv sync
# 3. Create .env (optional — defaults work for development)
cp .env.template .env
# 4. Install pre-commit hooks
uvx pre-commit install
# 5. Start Docker services
docker compose up -d
# 6. Verify health
curl http://localhost:8000/healthMigrations run automatically on startup via the db-init container. Docker Compose builds from local source, so code changes are reflected immediately.
make qualityRuns: formatting check, linting, type checking, and unit tests.
Install tox first (one-time):
uv tool install tox --with tox-uvThen run all five test suites (unit, integration, integration_v2, e2e, ui) in parallel via Docker:
./run_all_tests.shThis starts Docker, runs tox, tears down Docker, and saves JSON reports to test-results/. See Testing Patterns for the full reference.
tox -e unit # Unit tests only (no Docker)
tox -e integration -- -k test_name # Specific integration test
./run_all_tests.sh quick # No Docker: unit + integration + integration_v2
./run_all_tests.sh ci tests/integration/test_file.py -k test_namedocker compose logs -f # All services
docker compose logs -f adcp-server # Just the app serverdocker compose down # Stop services
docker compose up -d # Start again
docker compose down -v # Stop and reset databasedocker compose build && docker compose up -d# Locally
uv run python scripts/ops/migrate.py
# Inside Docker
docker compose exec adcp-server python scripts/ops/migrate.py
# Create a new migration
uv run alembic revision -m "description"uvx adcp http://localhost:8000/mcp/ --auth test-token list_tools
uvx adcp http://localhost:8000/mcp/ --auth test-token get_products '{"brief":"video"}'uv run mypy src/core/your_file.py --config-file=mypy.inimake lint-fixConductor is a Mac app that runs multiple development workspaces in parallel, each in its own git worktree with an isolated Docker environment. To set up a workspace, run the setup script from inside it:
./scripts/setup/setup_conductor_workspace.shThe script copies .env from the Conductor root directory (create it there
first — see Environment Configuration),
assigns the workspace a unique port, and starts the Docker stack. When you
archive a workspace, release its Docker resources:
./scripts/setup/cleanup_conductor_workspace.shThe .env file is created from .env.template during setup. Key variables:
| Variable | Default | Purpose |
|---|---|---|
ADCP_AUTH_TEST_MODE |
true |
Enables test login (disable for production) |
CREATE_DEMO_TENANT |
false |
Creates sample data on first startup |
ENVIRONMENT |
development |
development = strict validation, production = lenient |
CONDUCTOR_PORT |
8000 |
Nginx proxy port |
For OAuth, GAM integration, and other production settings, see the comments in .env.template or Environment Variables.
- Architecture — system design and component overview
- Engineering standards — the standards every change is held to
- Creating an ad server adapter — the adapter base-class contract
- Structural Guards — automated architecture enforcement
- Troubleshooting — common development issues