✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more

📊 📈 Stock & Crypto MCP Server with Local AI Agent

A modular, agent-based system for real-time stock prices, cryptocurrency news, and financial analysis using MCP (Multi-Component Protocol) servers, LangGraph agents, and LLMs (Ollama + Qwen3).


📌 Features

  • 🔍 Stock Price Retrieval — Query real-time stock data (e.g., AAPL, TSLA) using a custom Yahoo Finance MCP server.
  • 📰 Crypto News Aggregation — Stream cryptocurrency news headlines using a separate microservice.
  • 🤖 LangGraph Agent Execution — A ReAct-style agent powered by LangGraph makes decisions about which tools to call based on context.
  • 🧩 Tool Integration via MCP — Add more tools easily with the MCP protocol. Tools are separate microservices that expose LangChain-compatible interfaces.
  • 🧠 LLM Backend with Ollama — Uses Qwen 1.7B running locally through Ollama for fast, local reasoning and tool selection.

🏗️ Architecture

  • Agent Framework: LangGraph
  • LLM Provider: Ollama (qwen3:1.7b)
  • Tool Communication Layer: LangChain MCP Adapter
  • Tool Servers: Custom Python servers (e.g., crypto_news.py, stock_news.py)

🚀 Getting Started

1. Clone the repository

git clone https://github.com/ChabchoubMedAziz/mcp-crypto-stock-news.git
cd mcp-crypto-stock-news

2. Install dependencies

pip install -r requirements.txt

“2”. Get Your API Key and Set Environment

  • Create a .env file with your credentials:
AUTH_KEY=your_auth_key

Sign up on https://cryptopanic.com/developers/api/ and get your own Auth keys.

4. Start the MCP tool servers manually

python client.py

The system will:

  • Spin up MCP clients

  • Load tool definitions

  • Use the agent to respond to a prompt like: “Give me AAPL stock price”

🛠️ Tools

The follwing tool is exposed to MCP clients:

income_statement()

-> This tool returns the quarterly income statement for a given stock ticker.

stock_info

->This tool returns information about a given stock given it’s ticker.

stock_price

->This tool returns the last known price for a given stock ticker.

get_crypto_news()

->Fetch the latest cryptocurrency news from CryptoPanic API

5. Extending the System

Adding a new tool is easy:

Write a microservice tool using LangChain’s MCP decorators.

Add the new server config in main.py.

Restart the system.

Example client.py config:

server_configs = {
  "weather_tool": {
    "command": "uv",
    "args": ["run", "weather.py"],
    "transport": "stdio"
  }
}

📝 License

  • This project is licensed under the MIT License. See the LICENSE file for details.
  • Built with Model Context Protocol

Featured Templates

View More
Customer service
Multi-language AI Translator
136 921
AI Characters
Your Speaking Avatar
169 928
Customer service
Service ERP
126 1188
AI Assistants
AI Chatbot Starter Kit v0.1
140 913

Start your free trial

Build your solution today. No credit card required.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.