This repo contains the Infinity XOS MCP server and the unified dashboards for Trading, Intelligence, and Predictions (SPA).
See the quick system index: INDEX.md
This section describes exactly how this mcp system operates and the locations of key artifacts.
- Services and how to run
- Gateway (FastAPI):
api_gateway.py— runs on port8000by default. - Dashboard API:
dashboard_api.py— port8001(UI content at/dashboard.html). - Intelligence API:
intelligence_api.py— port8002. - Local Proxy (landing pages):
local_proxy.py— port8080(mirrors landing pages and proxies admin routes).
Run example (PowerShell):
python api_gateway.py
python dashboard_api.py
python intelligence_api.py- Memory systems
- Local SQLite:
mcp_memory.db— local intelligence & job storage (seescripts/init_db.pyto initialize). - External memory services (optional): the platform can be configured to use external memory services via
SERVICESmap inapi_gateway.py.
- Environment variables and
.env.example
- Place credentials and configuration in environment variables or a
.envfile. Example file:.env.example(below).
- Credential and account locations (local)
- Google service account JSON: path referenced by
GOOGLE_SERVICE_ACCOUNT_JSONenv var (recommended location:credentials/service-account.json). - GitHub token:
GITHUB_TOKENenv var. - OAuth tokens:
GOOGLE_OAUTH_TOKENenv var. - Local secrets:
local_secrets/(gitignored). Use this folder for local credential files used during demos.
- Admin & Doc Evolution controls
- Admin UI:
http://localhost:8000/admin— Infinity-Monitor. - Doc Evolution endpoints:
POST /admin/doc/ingest{source, metadata}POST /admin/doc/evolve{doc_id, strategy}POST /admin/doc/sync{target}GET /admin/doc/mode— current modePOST /admin/doc/mode{mode, path_override} — set mode and optional path
- URLs and local endpoints
- Gateway UI:
http://localhost:8000/admin - Health:
http://localhost:8000/health - Dashboard:
http://localhost:8001/ - Intelligence:
http://localhost:8002/
- How to use the index
- The
INDEX.mdis the single-page quick index for demos. Use it for talking points in investor demos. - For developer operations, consult
docs/BLUEPRINT.md(architecture) anddocs/MANIFEST.yaml(component list).
- Safety and best practices
- Default:
DOC_EV_MODE=safe(no external writes). Change via Admin UI only after review. - Use
DOC_EV_PATH_OVERRIDEto point to external doc-evolution code if you want to test live mode — but do not enablelivewithout audit.
- Contact & Handoff
- Dev lead: see
DEVELOPER_HANDOFF.mdfor contact details and deployment notes.
Below is a minimal environment sample (see .env.example)
Prerequisites: Python 3.11+, PowerShell on Windows
Important: The database (mcp_memory.db) is excluded from Git due to size (472MB). You'll create it locally.
- Install dependencies:
pip install -r requirements.txt- Initialize the database schema (creates empty tables):
python -c "import sqlite3; conn = sqlite3.connect('mcp_memory.db'); conn.execute('CREATE TABLE IF NOT EXISTS memory (id INTEGER PRIMARY KEY, key TEXT, value TEXT)'); conn.execute('CREATE TABLE IF NOT EXISTS paper_accounts (id INTEGER PRIMARY KEY, account_name TEXT, account_type TEXT, starting_balance REAL, current_balance REAL, created_at TEXT, updated_at TEXT)'); conn.execute('CREATE TABLE IF NOT EXISTS paper_positions (id INTEGER PRIMARY KEY, account_id INTEGER, asset TEXT, asset_type TEXT, direction TEXT, entry_price REAL, position_size REAL, quantity REAL, opened_at TEXT, status TEXT, entry_reason TEXT)'); conn.execute('CREATE TABLE IF NOT EXISTS paper_trades (id INTEGER PRIMARY KEY)'); conn.execute('CREATE TABLE IF NOT EXISTS paper_snapshots (id INTEGER PRIMARY KEY)'); conn.execute('CREATE TABLE IF NOT EXISTS predictions (id INTEGER PRIMARY KEY)'); conn.execute('CREATE TABLE IF NOT EXISTS jobs (id INTEGER PRIMARY KEY)'); conn.commit(); conn.close(); print('Database initialized')"Or use the included script:
python scripts/init_db.py- (Optional) Seed intelligence memory with 1,271 crawled sources:
python scripts/analyze_intelligence.py- (Optional) Seed demo trading accounts:
python scripts/seed_accounts.py- Start Trading Dashboard API (port 8001):
python dashboard_api.py- Start Intelligence API (port 8002):
python intelligence_api.py- Or use the launcher (starts both and opens browser):
.\start_servers.ps1- Open the unified SPA:
- Trading Dashboard: http://localhost:8001/
- Intelligence Browser: http://localhost:8002/
- SPA file: command_center_spa.html
- Run the basic MCP server (stdio):
python main.py- Optional: set orchestrator endpoint
$env:ORCHESTRATOR_URL = "https://orchestrator-896380409704.us-east1.run.app/execute"
python main.pyThe basic MCP server exposes a single tool execute(command, payload) that forwards to the orchestrator.
The extended MCP creates an omni-directional AI hub connecting multiple systems for maximum autonomous capabilities.
- Run the Omni Hub:
$env:GITHUB_TOKEN = "your_github_token"
python main_extended.py- Test the hub:
python test_omni_hub.py15 Tools Across 4 Systems:
🔧 Orchestrator (1 tool)
execute- Forward commands to Infinity XOS cloud
🐙 GitHub (3 tools)
github_create_issue- Create issues in any repogithub_search_code- Search code across GitHubgithub_get_file_content- Fetch file contents
🐳 Docker (9 tools)
docker_list_containers- List all containersdocker_container_action- Start/stop/restart/removedocker_run_container- Launch new containersdocker_list_images- List Docker imagesdocker_pull_image- Pull from registrydocker_container_logs- View logsdocker_container_inspect- Inspect detailsdocker_list_networks- List networksdocker_list_volumes- List volumes
🧠 Local Intelligence (2 tools)
query_intelligence- Search 1,271 intelligence sourcesget_portfolio_status- Get trading portfolio stats
Prerequisites:
- Docker Desktop running (for Docker tools)
- mcp_memory.db initialized (for intelligence tools)
- GitHub token set (for GitHub tools)
Both MCP servers are safe to run side-by-side (use different names in MCP clients).
- The MCP HTTP Adapter exposes MCP tools over HTTP/OpenAPI for Custom GPT-style integrations.
- Adapter base path:
/mcp(e.g.http://<host>/mcp). - OpenAPI spec (attach-ready):
GET /mcp/openapiorGET /mcp/schema. - Discovery endpoints:
GET /mcp/health— adapter healthGET /mcp/tools— list available tools and metadataPOST /mcp/execute— execute a tool (body:{ "tool_name": "...", "arguments": {...} })POST /mcp/execute/{tool_name}— execute a specific tool by name
- Security: set
MCP_API_KEYenv var and provideX-MCP-KEYheader. DefaultSAFE_MODE=trueblocks unauthenticated calls. - Approval flow: critical operations may return
{ "approval_required": true }and persist a local memory entry underdata/for manual approval.
Deploy the adapter with python -m uvicorn omni_gateway:app --host 0.0.0.0 --port $PORT for Cloud Run compatibility. Ensure SAFE_MODE and MCP_API_KEY are set in the environment.