Skip to main content
Glama

Financial Data MCP Server

Tutorial MCP + LangGraph

Este projeto demonstra como integrar o Model Context Protocol (MCP) com LangGraph para criar um agente ReAct inteligente que pode acessar dados financeiros em tempo real.

Objetivo

  • Como criar um servidor MCP com ferramentas personalizadas
  • Como conectar um agente LangGraph ao servidor MCP
  • Como implementar memoria de conversacao persistente
  • Como usar ferramentas de analise financeira via MCP

Pre-requisitos

  • Python 3.13+
  • Chaves de API do OpenAI e/ou Groq
  • FastMCP
  • LangGraph MCP Adapter

Instalacao

1. Instalar UV (Gerenciador de Pacotes Python)

Windows:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

macOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

2. Clonar e Configurar o Projeto

# Clone o repositorio git clone https://github.com/gustavo-sacchi/tutorial_mcp_langgraph.git cd tutorial_mcp_langgraph # Instale as dependencias e crie o ambiente virtual uv sync # Configure as variaveis de ambiente cp .env.exemple .env

3. Configurar Chaves de API

Edite o arquivo .env e adicione suas chaves:

OPENAI_API_KEY=sua-chave-openai-aqui GROQ_API_KEY=sua-chave-groq-aqui

Como Usar

1. Iniciar o Servidor MCP

Em um terminal:

uv run server_mcp.py

O servidor estara disponivel em http://localhost:4200

2. Executar o Cliente (Agente)

Em outro terminal:

uv run client_mcp.py

3. Interagir com o Agente

Agora voce pode fazer perguntas sobre financas:

User: Qual e o preco atual da acao da Apple? User: Me de um resumo completo da VALE3.SA User: Pesquise noticias recentes sobre investimentos em IA

Testando o MCP

Para testar a interface MCP diretamente:

npx @modelcontextprotocol/inspector uv run server_mcp.py

Arquitetura

┌─────────────────┐ HTTP ┌─────────────────┐ │ Client │◄──────────►│ MCP Server │ │ (LangGraph) │ │ (FastMCP) │ │ │ │ │ │ • ChatOpenAI │ │ • YFinance │ │ • ReAct Agent │ │ • DuckDuckGo │ │ • Memory │ │ • Web Scraping │ └─────────────────┘ └─────────────────┘

Ferramentas Disponiveis

O servidor MCP fornece estas ferramentas financeiras:

  • Resumo de Acoes: Preco, volume e data
  • Estimativas de Analistas: Precos-alvo
  • Recomendacoes: Buy/Hold/Sell
  • Dividendos: Historico de pagamentos
  • Setor/Industria: Classificacao da empresa
  • Demonstracoes Financeiras: Balanco, DRE, Fluxo de Caixa
  • Pesquisa Web: Noticias e conteudo relevante

Video Tutorial

Este projeto foi criado para acompanhar o tutorial no YouTube. Assista ao video completo para entender todos os detalhes da implementacao:

📺 Assistir no YouTube

Personalizacao

  • Modelos: Altere entre OpenAI e Groq no client_mcp.py
  • Transporte: Configure HTTP ou stdio no server_mcp.py
  • Ferramentas: Adicione novas ferramentas MCP no servidor
  • Prompts: Customize os prompts disponiveis
-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

A Model Context Protocol server that provides financial tools for retrieving real-time stock data, analyst recommendations, financial statements, and web search capabilities for a LangGraph-powered ReAct agent.

  1. Objetivo
    1. Pre-requisitos
      1. Instalacao
        1. 1. Instalar UV (Gerenciador de Pacotes Python)
        2. 2. Clonar e Configurar o Projeto
        3. 3. Configurar Chaves de API
      2. Como Usar
        1. 1. Iniciar o Servidor MCP
        2. 2. Executar o Cliente (Agente)
        3. 3. Interagir com o Agente
      3. Testando o MCP
        1. Arquitetura
          1. Ferramentas Disponiveis
            1. Video Tutorial
              1. Personalizacao

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  A Model Context Protocol server that enables interaction with Yahoo Finance to retrieve stock pricing, company information, and historical financial data through natural language queries.
                  Last updated -
                  9
                  12
                  Python
                  MIT License
                • A
                  security
                  A
                  license
                  A
                  quality
                  A Model Context Protocol server providing tools for querying A-share stock market data, including historical prices, financial reports, market indices, and macroeconomic indicators.
                  Last updated -
                  28
                  328
                  Python
                  MIT License
                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server built with FastMCP that provides financial data tools for AI agents, enabling them to access and analyze stock market information from Yahoo Finance through natural language queries.
                  Last updated -
                  2
                  Python
                • -
                  security
                  F
                  license
                  -
                  quality
                  A custom Model Context Protocol server that provides real-time financial analysis tools including stock monitoring, portfolio management, market summaries, and automated price alerts with Telegram notifications.
                  Last updated -
                  Python

                View all related MCP servers

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/gustavo-sacchi/tutorial_mcp_langgraph'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server