stock-research-assistant
Provides stock research capabilities for Databricks AI/BI agents, including watchlist management, real-time market data, company analysis, news summaries, and research note tracking, with data persisted in Lakebase Postgres.
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-research-assistantWhat's the price of NVDA over the last 30 days?"
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 Research Assistant MCP Server
A comprehensive stock research assistant built with FastMCP for Databricks AI/BI integration. Enables natural-language interaction with real market data, watchlist management, company analysis, and research note tracking.
Features
π― Watchlist Management
Track personal watchlists of tickers
Add/remove stocks with custom notes
View watchlist with live prices and performance
π Market Data
Real-time quotes from Massive Stocks API
Historical price data and performance metrics
Company fundamentals and profile information
Multi-ticker comparisons
π° News & Research
Fetch and summarize recent company news
Save research notes with investment thesis
Set price targets and confidence levels
Flag notable price moves automatically
ποΈ Data Persistence
Lakebase Postgres backend for all user data
Complete schema for users, watchlists, prices, news, and research
Optimized for future semantic search capabilities
Related MCP server: financial-research-agent
Architecture
βββββββββββββββββββ
β AI/BI Agent β β Natural language queries
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β FastMCP Server β β stocks_mcp_server.py
ββββββββββ¬βββββββββ
β
ββββββ΄βββββ
βΌ βΌ
βββββββββββ ββββββββββββββββ
βLakebase β βMassive Stocksβ
βPostgres β β API β
βββββββββββ ββββββββββββββββMCP Tools
The server exposes 10 agent tools:
Watchlist Tools
add_to_watchlist(ticker, watchlist_name, notes)- Add a stock to your watchlistremove_from_watchlist(ticker, watchlist_name)- Remove a stockget_watchlist(watchlist_name)- View all stocks with live prices
Market Data Tools
get_price_data(ticker, days)- Current and historical prices with performance summaryget_company_info(ticker)- Company fundamentals and profilecompare_tickers(tickers, metric)- Compare multiple stocks
Research Tools
get_recent_news(ticker, limit)- Fetch and summarize recent newssave_research_note(ticker, title, content, thesis, target_price, confidence)- Log analysisflag_notable_moves(threshold_percent)- Alert on significant price changes
Utility
get_current_user()- Get authenticated user email
Setup Instructions
1. Set Up Databricks Secrets
You need two secrets:
Lakebase Connection URL
databricks secrets create-scope database
databricks secrets put-secret database lakebase-urlThe value should be a standard Postgres connection URL:
postgresql://role:password@host:5432/databricks_postgres?sslmode=requireMassive Stocks API Key
databricks secrets create-scope massive
databricks secrets put-secret massive api-keyGet your API key from Massive Stocks API or similar provider.
2. Initialize Database Schema
Run the SQL schema against your Lakebase instance:
psql <lakebase-url> < schema_stocks.sqlThis creates all required tables:
users- User profileswatchlists- Named watchlists per userwatchlist_tickers- Stocks in watchlistscompanies- Company profiles and fundamentalsprice_snapshots- Historical price datanews_articles- News articles per tickerresearch_notes- User research and thesesanalysis_reports- Agent-generated reports
3. Deploy as Databricks App
cd stocks_research_assistant
databricks apps create stock-research-assistant \
--description "Stock Research Assistant with MCP" \
--source-code-path .
databricks apps deploy stock-research-assistantOr use the UI:
Go to Databricks Apps β Create App
Set source path to
/Workspace/Users/<your-email>/databricks-lakebase-app-day-3-hw/stocks_research_assistantClick Deploy
4. Connect to AI Playground or Agent Bricks
Once deployed, your app URL will be: https://stock-research-assistant-<id>.aws.databricksapps.com
Option A: AI Playground
The Playground auto-discovers workspace MCP servers
Your tools should appear automatically
Option B: Agent Bricks
Go to Machine Learning β Agents
Create a new agent
Add External Tool β MCP Server
URL:
https://stock-research-assistant-<id>.aws.databricksapps.com
Example Usage
Natural Language Queries
Managing Watchlists:
"Add AAPL and MSFT to my watchlist"
"Show me my watchlist"
"Remove TSLA from my default watchlist"Market Research:
"What's the price of NVDA over the last 30 days?"
"Compare GOOGL and META on performance"
"Show me recent news for AAPL"Investment Analysis:
"Save a research note for TSLA: Bullish on FSD progress, target $350"
"Which stocks in my watchlist moved more than 5% today?"
"Get company fundamentals for AMD"Direct Tool Calls
You can also call tools directly via the MCP protocol:
# Add to watchlist
{
"tool": "add_to_watchlist",
"arguments": {
"ticker": "AAPL",
"watchlist_name": "tech_giants",
"notes": "Strong services revenue, AI potential"
}
}
# Get price data
{
"tool": "get_price_data",
"arguments": {
"ticker": "NVDA",
"days": 90
}
}
# Save research note
{
"tool": "save_research_note",
"arguments": {
"ticker": "TSLA",
"title": "Q4 2025 Analysis",
"content": "Strong deliveries, margin expansion expected...",
"thesis": "Bullish on FSD monetization and energy storage growth",
"target_price": 350.0,
"confidence": "high"
}
}Database Schema
Key tables and relationships:
users
βββ watchlists
β βββ watchlist_tickers
βββ research_notes
βββ analysis_reports
companies (ticker lookup)
price_snapshots (time series)
news_articles (ticker, published_at)API Rate Limits
Massive Stocks API (Polygon.io) free tier:
5 API calls per minute
Delayed data (15-minute delay for stocks)
For production use, upgrade to a paid plan for:
Real-time data
Higher rate limits
WebSocket streaming
Future Enhancements
Context Engineering (Semantic Search)
The schema includes VECTOR columns for embeddings:
companies.profile_embeddingnews_articles.content_embeddingresearch_notes.content_embedding
Enables queries like:
"Find companies exposed to rising interest rates in regional banking"
"Show me research notes about AI chip manufacturers"
"Surface news about EV battery supply chain issues"
Implement with:
Databricks sentence-transformers models
pgvector extension in Lakebase
Semantic similarity search
Additional Features
Real-time price alerts via WebSocket
Technical analysis indicators (RSI, MACD, etc.)
Portfolio tracking and P&L
Earnings calendar integration
Options data and Greeks
Sector rotation analysis
Troubleshooting
"API request failed"
Check that your Massive Stocks API key is valid
Verify the secret is properly configured
Check API rate limits
"Could not retrieve Lakebase connection"
Verify Lakebase secret is set correctly
Test connection string manually:
psql <connection-url>Check that Lakebase endpoint is running
"No results returned for {ticker}"
Ticker may be invalid or delisted
Use
search_companiestool to find correct symbolSome tickers may not be available on free tier
App deployment failed
Check logs:
databricks apps logs stock-research-assistant --tail 100Verify all dependencies in requirements.txt
Ensure app.yaml env vars match your secret scopes
Files
stocks_research_assistant/
βββ README.md # This file
βββ app.yaml # Databricks App configuration
βββ requirements.txt # Python dependencies
βββ schema_stocks.sql # Lakebase schema
βββ lakebase.py # Postgres connection helper
βββ massive_stocks_broker.py # Massive API client
βββ stocks_mcp_server.py # FastMCP server with toolsLicense
MIT
Support
For issues or questions:
Check the troubleshooting section
Review Databricks Apps documentation
Check FastMCP docs at https://gofastmcp.com
Review Massive Stocks API docs at https://polygon.io/docs
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
- Flicense-qualityBmaintenanceAI-powered stock research MCP server with real-time data, CRUD operations, and interactive dashboard for fundamental analysis and comparisons.
- Flicense-qualityCmaintenanceMCP server that exposes stock research tools (fundamentals, news, technicals, analyst ratings) to AI clients, enabling autonomous generation of structured investment briefs.
- Flicense-qualityDmaintenanceA multi-agent MCP server for comprehensive stock research and analysis using natural language queries, backed by SEC filings and real-time market data.
- Flicense-qualityCmaintenanceA FastMCP server that provides stock research, technical analysis, fundamental analysis, and scoring, exposed as MCP tools, resources, and prompts for AI agents.
Related MCP Connectors
Multi-tenant FastMCP server for Charles Schwab brokerage data, monetized via DPYC Tollbooth
GibsonAI MCP server: manage your databases with natural language
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/hasthi/stock-research-assistant'
If you have feedback or need assistance with the MCP directory API, please join our Discord server