Labsco
extrawest logo

Financial AI Agent

โ˜… 1

from extrawest

An AI agent providing unified access to financial market data and news articles.

๐Ÿ”ฅ๐Ÿ”ฅFreeNeeds API keys

๐Ÿ“ˆ Model Context Protocol(MCP) Agent App

Maintenance Maintainer Ask Me Anything ! License Version

A TypeScript-based Ai agent with MCP integration. This project provides a unified interface to access financial market information and relevant news articles through MCP servers with tool calling.

DEMO

Terminal

https://github.com/user-attachments/assets/47150b98-0663-43f6-927e-f09abb796fe6

Cursor

https://github.com/user-attachments/assets/72210b49-dc23-4bef-b7ee-6d289ede59e1

โœจ Features

  • ๐Ÿ“Š Stock Market Data:
    • Company Information
    • Quarterly Financials
    • Annual Financial Reports
  • ๐Ÿ“ฐ News Integration:
    • Real-time News Articles
    • Query-based News Search
  • ๐Ÿ› ๏ธ Architecture Components:
    • Client-Server Architecture
    • TypeScript Implementation
    • Modular Design Pattern
    • LangChain agent

๐Ÿ—๏ธ Project Structure

src/
โ”œโ”€โ”€ agent/
โ”‚   โ””โ”€โ”€ agent.ts         # Agent implementation
โ”œโ”€โ”€ client/
โ”‚   โ””โ”€โ”€ client.ts        # API client implementation
โ”œโ”€โ”€ config/
โ”‚   โ””โ”€โ”€ configs.ts       # Configuration management
โ”œโ”€โ”€ logger/
โ”‚   โ””โ”€โ”€ logger.ts        # Logging functionality
โ”œโ”€โ”€ server/
โ”‚   โ”œโ”€โ”€ news-server.ts   # News API server
โ”‚   โ””โ”€โ”€ stocks-server.ts # Stock market API server
โ”œโ”€โ”€ types/
โ”‚   โ””โ”€โ”€ newsapi.d.ts     # Type definitions
โ””โ”€โ”€ index.ts             # Application entry point

๐Ÿ“ฆ Core Components

Stock Server

Handles all stock market related operations:

  • Company information retrieval
  • Financial reports access
  • Market data processing

News Server

Manages news-related functionality:

  • Article search and retrieval
  • Query processing
  • News data formatting

Client

Provides a unified interface to interact with both servers:

  • API request handling
  • Response processing
  • Error management

Start an app

In separate terminal tabs run

# Start Stocks server
 npm run stocks:built

 # Start News server
 npm npm run news:built

  # Run agent
 npm run agent:built

Add mcp to Cursor IDE

  • Open Cursor IDE, go to Settings -> Cursor Settings
  • Go to Tools & Integrations section
  • Find MCP tools, click New MCP Server
  • Add this to mcp.json file
{
    "mcpServers": {
        "stocks-mcp-server": {
            "url": "http://127.0.0.1:3000/sse"
        },
        "news-mcp-server": {
            "url": "http://127.0.0.1:3001/sse"
        }
    }
}
  • Run commands in separte terminal tabs
# Start Stocks server
 npm run stocks:built

 # Start News server
 npm npm run news:built

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


Created by Oleksandr Samoilenko
Extrawest.com, 2025