Sign inSign up

jsoprych/elko-market-mcp

By jsoprych

•Updated 4 months ago

Financial data MCP server for AI agents — stocks, SEC, Treasury, BLS, FDIC & World Bank.

Image
Machine learning & AI
Developer tools
1

3.6K

jsoprych/elko-market-mcp repository overview

⁠elko-market-mcp

šŸš€ FREE to test, run locally, or deploy wherever containers run. Your AI assistant gets live market data in under 60 seconds. Just pull and go.

docker pull jsoprych/elko-market-mcp:latest

A self-hosted financial data server that exposes free market data via MCP (Model Context Protocol), REST API, and a web dashboard.

Connect your AI assistant (Claude, Cursor, etc.) and ask: "What's the current price of AAPL?" or "Show me the 10-year Treasury yield."

Data sources: Yahoo Finance, EDGAR (SEC), Treasury, BLS, FDIC, World Bank, FRED.

elko-market dashboard — yahoo_history chart for AAPL

šŸ“– Full documentation & examples → github.com/jsoprych/elko-docs⁠

🐳 Docker Hub → hub.docker.com/r/jsoprych/elko-market-mcp⁠

docker pull jsoprych/elko-market-mcp:latest

⁠Quick Start

Assuming Docker is installed — cut and paste into your terminal:

docker run -d \
  --name elko-market \
  -p 8082:8082 \
  -v elko-market-data:/data \
  jsoprych/elko-market-mcp:latest

Once running, open the dashboard: http://localhost:8082⁠

API keys (FRED required for FRED tools): You can set them from the dashboard — click the šŸ”‘ Keys button in the status bar — no restart needed. Keys are persisted to the volume automatically. Alternatively, pass them at startup:

docker run -d \
  --name elko-market \
  -p 8082:8082 \
  -v elko-market-data:/data \
  -e FRED_API_KEY=your_fred_key \
  -e SEC_USER_AGENT="YourName [email protected]" \
  -e BLS_API_KEY=your_bls_key \
  jsoprych/elko-market-mcp:latest

To stop, restart, or remove the container:

docker stop elko-market                          # stop
docker start elko-market                         # restart
docker rm elko-market                            # remove container (data volume kept)
docker rm elko-market && docker volume rm elko-market-data  # full removal (container + data)

Connect to Claude Code, Cursor, or ChatGPT:

curl -s localhost:8082/mcp.json > .mcp.json

⁠Docker Compose

services:
  elko-market:
    image: ghcr.io/jsoprych/elko-market-mcp:latest
    ports:
      - "8082:8082"
    volumes:
      - elko-market-data:/data
    restart: unless-stopped
    # Optional — keys can also be set from the dashboard after first run
    environment:
      - FRED_API_KEY=your_key

volumes:
  elko-market-data:

⁠Environment Variables

VariableDefaultDescription
ELKO_EASY_KEYbundled keyRate-limit token (91-day demo; override with your own)
ELKO_KEY_SECRET—Enable pro-key HMAC validation (optional)
ELKO_REVOCATION_URL—Pro-key revocation list URL (requires ELKO_KEY_SECRET)
FRED_API_KEY—Required for FRED tools — free at fred.stlouisfed.org
SEC_USER_AGENT—Recommended for EDGAR: "Company Name [email protected]"
BLS_API_KEY—Optional — lifts BLS daily cap from 25 to 500 requests

Tip: FRED, BLS, and SEC keys can be set or updated directly from the dashboard šŸ”‘ Keys panel without restarting the container. Keys are saved to the data volume.

The bundled easy key expires ~91 days after each release. Override or disable:

# Override
docker run -e ELKO_EASY_KEY=your_key ...

# Disable rate limiting entirely
docker run -e ELKO_EASY_KEY="" ...

⁠MCP Setup

HTTP transport (recommended):

curl -s localhost:8082/mcp.json > .mcp.json

Claude Desktop / Cursor stdio transport:

{
  "mcpServers": {
    "elko-market": {
      "command": "docker",
      "args": ["run", "--rm", "-i",
               "-v", "elko-market-data:/data",
               "jsoprych/elko-market-mcp:latest",
               "mcp"]

    }
  }
}

Python / LangChain / any HTTP client (JSON-RPC 2.0):

import requests

r = requests.post("http://localhost:8082/mcp", json={
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
        "name": "yahoo_quote",
        "arguments": {"symbol": "AAPL"}
    }
})
print(r.json())
# curl equivalent
curl -s -X POST http://localhost:8082/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"yahoo_quote","arguments":{"symbol":"AAPL"}}}'

The /mcp endpoint is a standard MCP JSON-RPC 2.0 HTTP endpoint — compatible with any client that supports the MCP spec, including LangChain (langchain-mcp-adapters), custom Python scripts, or direct HTTP calls.


⁠MCP Tools

ToolSourceDescription
yahoo_quoteYahoo FinanceReal-time quote for any ticker
yahoo_historyYahoo FinanceHistorical OHLCV price data
yahoo_dividendsYahoo FinanceDividend history
treasury_yieldsTreasury.govCurrent yield curve
edgar_company_infoSEC EDGARCompany filings and info
edgar_financialsSEC EDGARIncome statement, balance sheet
edgar_insider_tradesSEC EDGARForm 4 insider transactions
bls_seriesBLSCPI, unemployment, PPI series
fdic_bank_searchFDICBank search and lookup
fdic_bank_financialsFDICBank financial data
worldbank_indicatorWorld BankGlobal economic indicators
fred_seriesFREDFederal Reserve economic data time series
fred_searchFREDSearch FRED series by keyword

SQL Procedures — saved queries that register as additional MCP tools automatically. Three starter procedures are included (top_tools, recent_calls, yield_curve_snapshot). Create your own via POST /v1/procedures.


⁠REST API

MethodPathAuthDescription
GET/healthpublicStatus + tool count
GET/v1/key-statuspublicCurrent key mode and rate-limit info
GET/v1/cataloguepublicList all available tools
GET/v1/keyspublicAPI key status (env/config/unset per key)
GET/mcp.jsonpublicReady-to-use .mcp.json for this server
GET/openapi.jsonpublicOpenAPI 3.0 spec for ChatGPT Custom GPT
POST/mcppublicMCP JSON-RPC 2.0 HTTP endpoint
POST/v1/call/{tool}keyInvoke a tool directly
GET/v1/logskeyRecent tool call log (requires --db)
PUT/v1/api-keys/{env}keySave an API key — persisted to volume
DELETE/v1/api-keys/{env}keyClear a saved API key
GET/v1/procedureskeyList SQL procedures
POST/v1/procedureskeyCreate or update a SQL procedure
GET/v1/procedures/{name}keyGet a single procedure
DELETE/v1/procedures/{name}keyDelete a procedure

⁠SQL Procedures

Define named SQL queries that auto-register as live MCP tools:

# Create a procedure
curl -s -X POST http://localhost:8082/v1/procedures \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my_query",
    "description": "Recent call log for a tool",
    "sql": "SELECT datetime(ts, '\''unixepoch'\'') as time, duration_ms FROM call_log WHERE tool = '\''{{tool}}'\'' ORDER BY ts DESC LIMIT {{limit}}",
    "parameters": [
      {"name": "tool",  "type": "string",  "description": "Tool name", "required": true},
      {"name": "limit", "type": "integer", "description": "Max rows",  "required": false, "default": 10}
    ]
  }'

The procedure is immediately callable as an MCP tool and via POST /v1/call/my_query. Queries must be SELECT or WITH statements. Template substitution via {{param}}.


⁠Persistent Data

Named volume at /data inside the container:

# Named volume (recommended)
docker run -v elko-market-data:/data ...

# Host path
docker run -v /path/on/host:/data ...

The SQLite database stores:

TableContents
cacheHTTP response cache (TTL-based, avoids redundant API calls)
call_logTool call audit trail — powering the Logs tab
_configPersisted API keys set from the dashboard
proceduresSaved SQL procedures registered as MCP tools
price_historyStructured OHLCV data (Yahoo Finance)
financialsEDGAR XBRL financial statement rows
yield_curveTreasury yield curve daily snapshots
macro_seriesBLS / World Bank / FRED time series
bank_financialsFDIC bank financials

⁠Ports

PortDescription
8082REST API + MCP HTTP + web dashboard

Port conflicts: The elko server family uses staggered defaults — elko-news-mcp on 8081, elko-market-mcp on 8082 — so both can run simultaneously. If another service occupies a port, override it:

docker run -p 9082:8082 ... jsoprych/elko-market-mcp:latest

⁠Source & Support

Support on Ko-fi

Tag summary

Content type

Image

Digest

sha256:d94ca6bc6…

Size

5 MB

Last updated

4 months ago

docker pull jsoprych/elko-market-mcp