Connect your engine
TradingAgents is a Python system that runs on your own machine. A small bridge exposes it to this dashboard, so nothing about your API keys or data leaves your computer.
Connect an AI assistant with MCP
Add this Streamable HTTP address to ChatGPT, Claude, Cursor, or another MCP client. It uses the same engine, queue, reports, and charts as this dashboard.
https://www.myfinance5051.com/api/mcpPublic access: anyone who can reach this address can read analyses, start paid AI runs, and cancel active runs without signing in.
Tools cover run creation and cancellation, history, progress, decisions, reports, chart data, market snapshots, earnings, and configured AI models.
MCP client guideAI provider and credit
Checks the key saved in your engine and, where the provider publishes it, how much credit is left. DeepSeek and OpenRouter report a balance; the others only confirm the key works.
Only providers with a key already saved in your settings file are listed. Switching rewrites the settings file — restart the engine afterwards.
Available AI models
Tick the providers you want offered in the New Analysis form. Only providers with a key saved in the engine can be used; the rest need their key added to .env.
Single-file bridge (alternative)
If you do not want the full engine repository, this one Python file wraps TradingAgentsGraph and streams progress to this dashboard.
Setup steps
- 1
Get the engine code and create an environment
Clone your backend repository, then create and activate a Python virtual environment inside it.
git clone https://github.com/tsekennykl1/myTradingAgentsBackend.git cd myTradingAgentsBackend python3 -m venv .venv source .venv/bin/activate
- 2
Install the dependencies
This installs FastAPI, the worker, and the TradingAgents engine requirements.
pip install -r requirements.txt
- 3
Create your settings file
Build it with the form further down this page, then save it as .env in the engine folder. Or start from the example file and edit it by hand.
cp .env.example .env open .env # or: nano .env
- 4
Run the guided configurator
initialSetup.py is the safest way to create .env. It asks one question at a time — which AI provider you use, its key, which deep-thinking and quick-thinking models to run, how many debate rounds, the temperature, and where to keep the cache and memory log. Press Enter at any prompt to accept the suggested value; it reads your existing .env first, so re-running it only changes what you retype, and keys are shown masked. Model names are checked against the engine's own list and friendly names are converted automatically ("DeepSeek Pro" becomes deepseek-v4-pro), so a typo is caught before anything is saved. Data keys for FRED and Alpha Vantage are your own free keys — create them on the FRED and Alpha Vantage sites and paste them in when asked. Nothing is written until every value passes validation; then it writes .env, refreshes .env.example, and creates sample_run_payload.json you can use to test the engine with one curl command.
python initialSetup.py
- 5
Or configure it unattended
For servers and deployments, skip the questions entirely: put the same answers in a JSON file and run with --non-interactive. Point it at the file with --config, or set CONFIG_JSON instead — a local path, an http(s) address, an s3:// object, or the JSON itself all work. Keys named the friendly way (llm_provider, deep_think_llm, research_depth) are translated for you, and anything under "env" is written to .env exactly as typed. The same validation runs, so a bad model name or a missing provider key stops the deployment instead of failing mid-analysis.
cat > config.json <<'JSON' { "llm_provider": "deepseek", "deep_think_llm": "deepseek-v4-pro", "quick_think_llm": "deepseek-v4-flash", "research_depth": 1, "temperature": 0.0, "env": { "DEEPSEEK_API_KEY": "sk-your-key", "PUBLIC_BASE_URL": "http://127.0.0.1:8000", "FRONTEND_ORIGINS": "http://localhost:8080" } } JSON python initialSetup.py --non-interactive --config config.json # or: CONFIG_JSON=s3://my-bucket/config/config.json python initialSetup.py --non-interactive - 6
Choose where the dashboard may call from
PUBLIC_BASE_URL is the address the engine is reached at; FRONTEND_ORIGINS lists the dashboards allowed to talk to it. Without your dashboard address here, the browser blocks every request.
PUBLIC_BASE_URL=http://127.0.0.1:8000 FRONTEND_ORIGINS=http://localhost:8080,https://trading-agent-companion.lovable.app
- 7
Start the engine
Keep this terminal open while you use the dashboard.
source .venv/bin/activate uvicorn app.main:app --host 127.0.0.1 --port 8000
- 8
Point the dashboard at it
Enter the address above (default http://127.0.0.1:8000) in the box at the top of this page and test the connection.
Build your .env
Pick your AI provider, paste its key, and copy the finished file. Model names come straight from the engine's own list, so they are always valid. Add your own free FRED and Alpha Vantage keys for market and economic data.
Paste your own free key from alphavantage.co.
Paste your own free key from fredaccount.stlouisfed.org.
Your .env file
# TradingAgents engine settings — generated by the dashboard setup page # --- Where the engine runs and who may call it --- PUBLIC_BASE_URL=https://www.myfinance5051.com/api FRONTEND_ORIGINS=http://localhost:8080,https://trading-agent-companion.lovable.app,https://www.myfinance5051.com # --- AI provider --- LLM_PROVIDER=deepseek DEEP_THINK_LLM=deepseek-v4-pro QUICK_THINK_LLM=deepseek-v4-flash DEEPSEEK_API_KEY="" # --- Market and economic data --- ALPHA_VANTAGE_API_KEY="" FRED_API_KEY="" # --- Performance --- TRADINGAGENTS_PARALLEL_ANALYSTS=1 TRADINGAGENTS_DATA_CACHE=1 TRADINGAGENTS_DATA_CACHE_TTL=21600 RUN_WORKER_COUNT=2
Nothing here leaves your browser. Save the file as .env in the engine folder, then run python initialSetup.py and press Enter at each prompt to accept these values.
How to Generate the Large Language Model API_KEY?
Open the provider you want to use, sign in, create an API key, then copy it into your .env file under the variable name shown below. One provider is enough — pick that provider in the New Analysis form afterwards.
DEEPSEEK_API_KEY="sk-…" # or OPENAI_API_KEY="sk-…" / GOOGLE_API_KEY="…" / ANTHROPIC_API_KEY="sk-ant-…"
Market and economic data keys
Both are free. Alpha Vantage supplies price and fundamentals data; FRED supplies US economic series used by the fundamentals and macro write-ups.
Alpha Vantage
Open alphavantage.co/support/#api-key, enter your email, and the key appears on screen immediately. Free tier is rate limited, so keep the engine's data cache switched on.
ALPHA_VANTAGE_API_KEY="your-key"
FRED (Federal Reserve Economic Data)
Create a free account at fredaccount.stlouisfed.org/apikeys, then request an API key. It is issued right away.
FRED_API_KEY="your-key"
After editing .env, stop the engine (Ctrl+C) and start it again so the new keys are picked up.
If the browser blocks the connection
Add this dashboard's address to FRONTEND_ORIGINS in .env and restart the engine. If it still refuses, run the engine with --host 0.0.0.0 and use your machine's local IP address instead of 127.0.0.1.