Files
schwab-mcp-custom/compose.yaml
b3nw 27d1e2be10
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m4s
fix: resolve report_url=None for blob-URL tickers and fix dataclass serialization
When Schwab uses modern blob URLs (increasingly common), find_report()
returns __CLICK_TO_OPEN__ and the scraper skips storing a report_url
even though the PDF downloads and parses successfully. This caused
agents to see report_url=None for tickers like PEP/BR/DPZ/MSCI/BMI.

Changes:
- Fix serialize() to use dataclasses.asdict() instead of str() for
  dataclass payloads, producing proper JSON objects instead of Python
  repr strings
- Add /reports/{ticker}/pdf endpoint to serve cached Morningstar PDFs
- Enrich report_url with the MCP's own PDF endpoint when blob URLs
  were used and the report was successfully downloaded
- Add SCHWAB_MCP_BASE_URL env var to compose for self-referential URLs
2026-05-21 14:46:08 +00:00

45 lines
1.1 KiB
YAML

include:
- ../deploy/base.yaml
services:
schwab-mcp:
<<: *mcp-service
image: gitea.ext.ben.io/b3nw/schwab-mcp-custom:latest
container_name: schwab-mcp
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
deploy:
resources:
limits:
memory: 512M
cpus: '1.0'
reservations:
memory: 128M
cpus: '0.1'
environment:
- SCHWAB_PLAYWRIGHT_URL=ws://browser.local.ben.io:3000/playwright/chromium?timeout=300000
- SCHWAB_MCP_BASE_URL=https://schwab-mcp.ext.ben.io
- PORT=8000
volumes:
- ./cookies.json:/app/cookies.json
- ./config.json:/app/config.json
ports:
- "${PORT:-8160}:8000"
depends_on:
schwab-browser:
condition: service_started
schwab-browser:
image: ghcr.io/browserless/chromium:latest
container_name: schwab-browser
restart: unless-stopped
environment:
- TIMEOUT=300000
- MAX_CONCURRENT_SESSIONS=2
- PREBOOT_CHROME=true
shm_size: "1gb"