How nicknochnack/mcpin10 works
Project type and purpose
• This is a lightweight microservice-style Python application (“MCP Server”) whose goal is to ingest and serve financial ticker data (e.g. from Yahoo Finance) and to integrate with an LLM workflow via Ollama and Langflow.
• The two runtime components are:
• server.py – the “inspector” or API server that exposes endpoints for managing and querying ticker data.
• agent.py – the background agent that fetches raw ticker data from external sources and writes it into the local ticker_db.
File structure
• Top‐level files:
• pyproject.toml – dependency manifest (Uvicorn, FastAPI or similar, ticker‐db driver).
• server.py – starts the MCP API.
• agent.py – polling/fetching service.
• Directory ticker_db/ holds persistent storage:
• A per‐ticker GUID folder with binary data files (data_level0.bin, header.bin, etc.) and a pickled index.
• chroma.sqlite3 – an embedded vector‐index database for similarity search (used by your LLM workflows).
• .python-version, .gitignore, uv.lock, .venv – environment and tooling files for uv (your CLI wrapper).
README for additional insights
• Steps call out two processes (mcp dev server.py and agent.py) plus a separate Langflow UI that plugs into Ollama.
• External requirement: an Ollama LLM daemon must be running to process embeddings or LLM calls.
Components and interactions
a. Main components:
• API Server (server.py + Uvicorn/FastAPI)
• Agent Worker (agent.py)
• Persistent storage:
– Ticker_DB (binary files + index)
– Chroma SQLite vector DB
• External Data Source: Yahoo Finance (or any other data provider)
• LLM Service: Ollama (local LLM runtime)
• Orchestration/UI: Langflow (optional front‐end that talks to the API server or directly to LLM)
b. Relationships & data flows:
1. Agent → External Data Source: fetch latest ticker quotes.
2. Agent → Ticker_DB: write raw binary data + update index.
3. API Server ←→ Ticker_DB & Chroma DB:
– Read requests for historical/similarity queries.
4. API Server → Ollama: for any LLM/embedding requests (via vector index or prompt).
5. Langflow UI → API Server or Ollama directly: for user‐driven LLM workflows.
c. Architectural patterns & design principles:
• Separation of concerns: ingestion agent vs. API server.
• Event‐driven or polling model in the agent.
• Repository pattern encapsulated by ticker_db folder and chroma.sqlite3.
• Microservice‐like processes communicating via REST or RPC.
d. Key technologies/frameworks/libraries:
• Python 3.x, Uvicorn (CLI “uv run”), FastAPI or similar.
• Custom binary ticker_db format + pickle metadata.
• SQLite (Chroma vector store) for similarity search.
• Ollama for LLM runtime; Langflow for GUI orchestration.
• uv (poetry/pipenv‐like CLI wrapper) for environment management.