portfolio-agent
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
portfolio-agent
Portfolio tracker with an analysis agent and MCP access. FastAPI, Postgres (Neon), WorkOS AuthKit (GitHub or Google), Claude.
Local setup
Requires Python 3.12. Use the project virtualenv at .venv (not a base Anaconda env).
cd portfolio-agent
python3.12 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements-dev.txt
cp .env.example .env
# Fill in every value in .env (see below)
alembic upgrade head
uvicorn app.main:app --host localhost --port 8000Run tests (calculation tests always; isolation tests need TEST_DATABASE_URL):
pytestOn startup the process prints:
WorkOS redirect URI— register this under WorkOS → RedirectsMCP resource URL— register this under WorkOS Connect → Resource Indicators (and set as default)
Open http://localhost:8000.
Related MCP server: auth0-whoami-mcp-template
Environment variables
Name | Purpose |
| Public origin, no trailing slash. Local: |
| Comma-separated browser origins allowed to call |
| Neon pooled Postgres URL ( |
| Neon direct URL for Alembic ( |
| WorkOS API key |
| WorkOS client id |
| Fernet key, min 32 chars: |
| e.g. |
| Finnhub API key (free plan; sent as |
Market data
Provider: Finnhub /quote for US equities.
Verified against Finnhub docs on 2026-11-11 (Quote API, rate limit notes in the Finnhub docs and free-plan reports):
/quotereturnsc(current price),d/dp(change),h/l/o/pc(session stats), andt(UNIX timestamp of the quote).An unknown symbol returns an all-zero payload (including
c=0andt=0). This app treats that as not found, never as a price of zero.Free plan: 60 API calls per minute. Over the limit returns HTTP 429.
/stock/candleis not available on the free plan (returns access denied). Price history is built from our own daily snapshots instead.
Caching and status
Successful fetches are stored in
quotes. If a ticker was fetched in the last 5 minutes, the dashboard reuses that row and does not call Finnhub.Status labels (America/New_York times):
Live: market open and the quote
as_ofis within the last 20 minutes.Market closed, as of …: market closed; showing the last trade or close time.
Delayed: showing last saved price from …: provider failed or the quote is older than 20 minutes while the market is open.
Price unavailable: no provider price and nothing stored.
US market hours are weekdays 9:30 to 16:00 ET. Holidays are not modeled.
Daily snapshot job
Render cron
portfolio-price-snapshotrunspython -m app.jobs.snapshot_priceson weekdays at30 22 * * 1-5UTC (after the US close).One row per ticker per New York trading day (
snapshot_date), for distinct tickers from lots and favorites. Re-runs the same day do not create duplicates.The job loads
JobSettings(DATABASE_URL+FINNHUB_API_KEYonly). It does not need WorkOS variables.
WorkOS checklist (short)
Enable AuthKit; enable both GitHub and Google as sign-in methods.
Redirect URI = printed
WorkOS redirect URI(/callback).Sign-out URI =
BASE_URL(or/).Initiate login URI =
BASE_URL/login.Connect → enable CIMD and DCR; add MCP resource URL; set as default.
Render
Live URL: https://portfolio-agent-nt7v.onrender.com
See render.yaml. Start command runs migrations then Uvicorn on $PORT. Set the same env vars in the Render dashboard; BASE_URL must be the public HTTPS URL. Render assigned a suffixed hostname; BASE_URL and ALLOWED_ORIGINS must match it exactly.
Health
GET /healthz — plain liveness (not the MCP endpoint).
MCP
Streamable HTTP at /mcp, protected by WorkOS AuthKit (AuthKitProvider). Tool available today: whoami.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Minimal streamable HTTP MCP server used for owned-account registry connectivity tests.
Remote MCP server exposing SMI Aware tools, resources, and skills over Streamable HTTP.
Remote MCP for A2A caller identity, scope policy, verdict receipts, and audit history.
An authenticated remote MCP server for user-owned devices and one-shot capability invocation.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables MCP client interaction via streamable HTTP, providing example tools (echo, getPostsByUser) and resources (posts, users) with pluggable authentication providers.6MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that exposes an authenticated Streamable HTTP endpoint with a whoami tool returning safe claims for the current Auth0 user.MIT
- AlicenseNot gradedqualityCmaintenanceEnables end-to-end testing of OAuth authorization for an MCP server, exposing scoped tools like whoami and echo over streamable HTTP.ISC
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to authenticate through Convex OAuth Provider, verifying access tokens and exposing a whoami tool for retrieving the authenticated user's identity and scopes.1MIT