Stock-Market Research Assistant MCP Server
Provides tools for managing watchlists and saving/retrieving research notes and analysis reports in a PostgreSQL-backed database (Lakebase).
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Stock-Market Research Assistant MCP ServerGet the latest stock price and recent news for TSLA, then add it to my watchlist."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ง Stock-Market Research Assistant
Databricks AI Bootcamp Capstone โ Stock-Market Research Assistant
Implementaรงรฃo profissional do projeto final do treinamento DataExpert.io
๐ Conclusรฃo do Treinamento
Este repositรณrio contรฉm a entrega final do projeto do Databricks AI Bootcamp, desenvolvido como parte do treinamento oficial da DataExpert.io.
๐ Treinamento Original
Bootcamp: Rise of the AI Data Engineer
Repository: EcZachly/databricks-ai-bootcamp-capstone
NotebookLM: Databricks AI Boot Camp
Related MCP server: Financial Modeling Prep (FMP) MCP Server
๐ Project Highlights
Feature | Status | Description |
Pipeline Spark | โ | Ingestรฃo distribuรญda com Spark e Delta Lake |
API Externa | โ | Massive API para preรงos e notรญcias de aรงรตes |
Conteรบdo Nรฃo Estruturado | โ | HTML โ texto โ chunks com trafilatura |
Databricks App | โ | Main App + Dashboard separados |
Agente Leitura/Escrita | โ | MCP Server com tools de pesquisa e persistรชncia |
RAG com pgvector | โ | Embeddings e busca semรขntica HNSW |
Wiki Completa | โ | Documentaรงรฃo tรฉcnica e arquitetural |
๐๏ธ Architecture & Tech Stack
Camadas da Arquitetura
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Databricks Workspace โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Databricks App โ โ Databricks App โ โ
โ โ (Main App) โ โ (Dashboard) โ โ
โ โ โ โ โ โ
โ โ - Massive API โ โ - Read-only Flask โ โ
โ โ - Lakebase (PG) โ โ - Watchlist/Quotes โ โ
โ โ - Sync endpoint โ โ - News viewer โ โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Lakebase (Postgres) โ โ
โ โ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ watchlists โ โ ticker_news_ โ โ ticker_news_ โ โ โ
โ โ โ (ticker lists) โ โ documents โ โ embeddings โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโ โ (news articles) โ โ (title+description) โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ โ โ
โ โ โผ โ โ
โ โ โโโโโโโโโโโโโโโโโโ โ โ
โ โ โ pgvector HNSW โ โ โ
โ โ โ index (cosine) โ โ โ
โ โ โโโโโโโโโโโโโโโโโโ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ research_notes โ โ analysis_ โ โ โ
โ โ โ (agent writes) โ โ reports โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ MCP Server App โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ Massive Broker (stock data) โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ FastMCP Server (tools exposed to Agent Bricks) โ โ โ
โ โ โ - get_quote(symbol) โ โ โ
โ โ โ - search_news(symbol, query, limit) โ โ โ
โ โ โ - search_research_context(query, symbol) โ โ โ
โ โ โ - get_watchlist() โ โ โ
โ โ โ - add_to_watchlist(symbol) โ โ โ
โ โ โ - remove_from_watchlist(symbol) โ โ โ
โ โ โ - save_research_note(symbol, title, content) โ โ โ
โ โ โ - save_analysis_report(symbol, report, sources) โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโStack Tecnolรณgica
Camada | Tecnologia | Versรฃo | Uso |
Data Warehouse | Databricks Lakebase | Postgres | Banco transacional integrado |
Processing | Apache Spark | 3.5+ | Pipelines distribuรญdos |
Embeddings | sentence-transformers | all-MiniLM-L6-v2 | Similaridade semรขntica |
Vector Search | pgvector | 0.5+ | รndice HNSW cosine |
APIs | Massive.com | v2 | Preรงos e notรญcias de aรงรตes |
Agent Framework | FastMCP | 1.0+ | Ferramentas para agente |
Frontend | Flask | 2.0+ | API e Dashboard |
๐บ๏ธ Architecture Diagram
Pipeline de Dados
flowchart LR
subgraph "Ingestรฃo"
A[Watchlist Lakebase] -->|tickers| B[Massive API]
B -->|notรญcias| C[ticker_news_documents]
end
subgraph "Processamento"
C -->|HTML| D[trafilatura]
D -->|texto| E[Chunking]
E -->|chunks| F[Embeddings Spark]
end
subgraph "Armazenamento"
F -->|embeddings| G[ticker_news_embeddings]
E -->|chunks| H[ticker_news_chunk_embeddings]
G & H -->|HNSW| I[pgvector Index]
end
subgraph "Consulta RAG"
J[User Query] -->|embedding| I
I -->|top-k| K[Context Retrieval]
K -->|prompt| L[LLM Response]
endFluxo de Consulta RAG
flowchart LR
A[Query do Usuรกrio] --> B[Embedding da Query]
B --> C[Busca Vetorial pgvector]
C --> D[Top-k Chunks]
D --> E[Contexto Formatado]
E --> F[Prompt com Citaรงรตes]
F --> G[Resposta Fundamentada]๐ Resultados
Mรฉtrica | Resultado | Observaรงรฃo |
Dimensionalidade Embeddings | 384 | all-MiniLM-L6-v2 |
Mรฉtrica Similaridade | Cosine | Otimizada com pgvector |
Index Vector | HNSW | Busca O(log n) aproximada |
Latรชncia Query RAG | < 500ms | Com รญndice HNSW |
Throughput Embeddings | Batch ~100 | Parallel Spark |
๐ Quick Start & Setup
Prรฉ-requisitos
Acesso ao Databricks Workspace
Massive API Key (grรกtis em https://www.massive.com)
Lakebase URL configurado no workspace
Configuraรงรฃo
# 1. Criar secret scopes
python setup_secrets.py
# 2. Executar SQLs no Lakebase
psql $LAKEBASE_URL -f sql/01_setup_news_table.sql
psql $LAKEBASE_URL -f sql/02_setup_embeddings_table.sql
psql $LAKEBASE_URL -f sql/03_setup_chunk_embeddings_table.sql
psql $LAKEBASE_URL -f sql/04_cast_arrays_to_vectors.sql
psql $LAKEBASE_URL -f sql/05_setup_research_tables.sql
# 3. Executar notebook de ingestรฃo
# (via Databricks UI: importar notebooks/ingest_ticker_news_embeddings.py)
# 4. Testar RAG
python3 test_rag.py --ticker AAPL --limit 5
# 5. Deploy dos Apps
databricks bundle deploy -t devEndpoints da API
Mรฉtodo | Endpoint | Descriรงรฃo |
GET |
| Lista tickers |
GET |
| Preรงo atual |
GET |
| Notรญcias recentes |
POST |
| Sincronizar notรญcias |
POST |
| Busca semรขntica (RAG) |
Tools do MCP Server
Leitura:
get_quote(symbol)- Preรงo atualsearch_news(symbol, query, limit)- Busca notรญciassearch_research_context(query, symbol)- Busca contextoget_watchlist()- Lista tickersadd_to_watchlist(symbol)- Adicionar tickerremove_from_watchlist(symbol)- Remover ticker
Escrita (Agente):
save_research_note(symbol, title, content)- Salvar notasave_analysis_report(symbol, report, sources)- Salvar relatรณrio
๐ณ Estrutura do Projeto
databricks-capstone-delivery/
โโโ app.py # Main Flask API (Day 1/2)
โโโ lakebase.py # Lakebase connection helper
โโโ massive_client.py # Massive API client
โโโ setup_secrets.py # Secret scope setup
โโโ requirements.txt # Python dependencies
โโโ pyproject.toml # Project metadata
โโโ test_rag.py # Script de validaรงรฃo RAG
โ
โโโ dashboard/
โ โโโ app.py # Dashboard Flask
โ โโโ templates/index.html # Dashboard UI
โ
โโโ mcp_server/
โ โโโ alpaca_mcp_server.py # FastMCP server (com writing tools)
โ โโโ lakebase.py # Lakebase helper (novas funรงรตes)
โ โโโ massive_broker.py # Massive broker
โ
โโโ notebooks/
โ โโโ ingest_ticker_news_embeddings.py # Spark pipeline
โ
โโโ sql/
โ โโโ 01_setup_news_table.sql
โ โโโ 02_setup_embeddings_table.sql
โ โโโ 03_setup_chunk_embeddings_table.sql
โ โโโ 04_cast_arrays_to_vectors.sql
โ โโโ 05_setup_research_tables.sql
โ
โโโ resources/
โโโ dashboard.yml
โโโ ingest_ticker_news_embeddings_job.yml
โโโ mcp_server.yml๐ง Methodology & Quality Gates
Este projeto incorpora um sistema heurรญstico robusto para garantir qualidade e evitar erros comuns de engenharia de dados:
Data Contract Gate
Valida tabelas Silver/Gold antes da execuรงรฃo:
Verificaรงรฃo | Implementada | Estado |
Schema esperado (colunas, tipos, nullability) | โ | Documentado em SQLs |
Regras de qualidade (cardinalidade, unicidade) | โ | Tabelas com constraints |
SLA de volume e latรชncia | โ | Documentado no schema |
Contrato versionado | โ |
|
Idempotency Gate
Garante reexecuรงรฃo segura do pipeline:
Verificaรงรฃo | Implementada | Estado |
UPSERT ou FULL REFRESH definido | โ | Tabelas com ON CONFLICT |
Nenhum append cego sem verificaรงรฃo | โ | Chaves primรกrias definidas |
Custo de reprocessamento estimado | โ | Log de contagem de linhas |
Heurรญsticas Aplicadas
Heurรญstica | Descriรงรฃo | Aplicaรงรฃo |
Check antes de escrita | Validaรงรฃo de entrada antes de persistรชncia |
|
Rastreabilidade de evidรชncia | Toda conclusรฃo indica SOURCE/INFERENCE/IMPLEMENTED/VALIDATED | PRD_E_PLANO_EXECUCAO.md |
Gates antes de deploy | Dois checklists obrigatรณrios antes de considerar pronto | Este README |
Falsos positivos vs falsos negativos | Avaliaรงรฃo balanceada de RAG | Teste RAG com |
๐ Documentation Resources
PRD_E_PLANO_EXECUCAO.md- Requisitos e plano completoTECHNICAL.md- Documentaรงรฃo tรฉcnica para tech leadsCHANGELOG.md- Histรณrico de versรตesCONTRIBUTING.md- Guia de contribuiรงรฃo
๐ License
Este projeto foi desenvolvido como parte do treinamento do Databricks AI Bootcamp.
Copyright (c) 2026 Roberto
Todos os direitos reservados.
Este cรณdigo pode ser utilizado como portfolio para demonstrar competรชncias tรฉcnicas em Engenharia de Dados, RAG e Agentes de IA.
โ ๏ธ Notas Importantes
Este nรฃo รฉ um sistema de trading em produรงรฃo. Nรฃo deve ser usado para decisรตes financeiras reais.
A API do Massive tem limites de rate. O pipeline respeita esses limites.
Secrets nunca devem ser commitados. O
setup_secrets.pygarante isso.
Este projeto foi desenvolvido para demonstrar as habilidades tรฉcnicas adquiridas durante o Databricks AI Bootcamp.
Author: Roberto
LinkedIn: https://www.linkedin.com/in/roberton003/
GitHub: https://github.com/Roberton003
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityCmaintenanceMCP server that provides AI assistants access to stock market data including financial statements, stock prices, and market news through a Model Context Protocol interface.112,275MIT
- AlicenseBqualityCmaintenanceAn MCP server that provides comprehensive access to real-time stock quotes, financial statements, analyst estimates, and technical indicators via the Financial Modeling Prep API. It enables users to conduct in-depth financial analysis and track market performance through specialized tools, resources, and prompt templates.26171MIT
- AlicenseAqualityFmaintenanceA comprehensive MCP server for stock analysis and trading insights, including stock screening, fundamental analysis, insider trading, options analysis, social media research, and news analysis.1074MIT
- Flicense-qualityCmaintenanceMCP server that exposes stock research tools (fundamentals, news, technicals, analyst ratings) to AI clients, enabling autonomous generation of structured investment briefs.
Related MCP Connectors
Hosted MCP for stocks, options, Greeks, brokers, order previews, alerts, and workflows.
MCP server exposing the Backtest360 engine API as tools for AI agents.
Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Roberton003/databricks-capstone-delivery'
If you have feedback or need assistance with the MCP directory API, please join our Discord server