- Home
- MCP servers
- Tutorial
Tutorial
- python
1
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"gustavo-sacchi-tutorial_mcp_langgraph": {
"command": "uv",
"args": [
"run",
"server_mcp.py"
],
"env": {
"GROQ_API_KEY": "YOUR_GROQ_API_KEY",
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY"
}
}
}
}You create a local MCP server that exposes finance-focused tools and connect it with LangGraph to run an intelligent ReAct agent. This setup lets you query real-time stock data, analyst estimates, news, and financial documents through a configurable, persistent memory agent that can access multiple data sources via MCP tools.
How to use
To use the server with an MCP client, start the MCP server locally, then launch the client in a separate terminal. You will interact with the agent by asking questions about stocks, headlines, and financial analysis. The agent can leverage built-in financial tools to provide summaries, prices, dividends, and more, based on real-time data feeds.
Steps to use the system:
- Start the MCP server in one terminal.
- Start the MCP client (agent) in another terminal.
- Ask the agent questions like the current price of a stock, recent news on investments in AI, or a full summary of a company’s financial statements.
How to install
Prerequisites you need before installation:
- Python 3.13 or later
- OpenAI API key and/or Groq API key
- UV (Python package manager)
- LangGraph MCP Adapter (for the client integration)
Installation steps you will follow:
- Install UV using the appropriate script for your OS.
- Clone the project, install dependencies, and set up the local environment variables.
- Configure API keys in the environment file.
# Install UV (examples shown per OS)
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and configure the project
# Clone the repository
git clone https://github.com/gustavo-sacchi/tutorial_mcp_langgraph.git
cd tutorial_mcp_langgraph
# Install dependencies and create virtual environment
uv sync
# Configure environment variables
cp .env.exemple .env
# Edit API keys in the environment file
# OPENAI_API_KEY and GROQ_API_KEY are required
"} ,{
Additional sections
Configuration and usage notes:
- Set your API keys in the environment file to enable the agent to access AI services and data sources.
- The MCP server exposes a local HTTP interface at http://localhost:4200, but you typically interact with it through the client process started with UV.
- You can test the MCP interface using the inspector command: npx @modelcontextprotocol/inspector uv run server_mcp.py to validate the server’s MCP endpoints.
Security and maintenance tips:
- Keep your API keys secure and do not commit them to version control.
- Regularly restart the server when you update tool configurations or add new tools.
- Use the persistent memory features to maintain context across conversations for longer and more coherent interactions.
Available tools
StockSummary
Provides a concise summary of stock price, volume, and date.
AnalystEstimates
Returns analyst price targets and consensus estimates.
Recommendations
Gives Buy/Hold/Sell recommendations based on data signals.
Dividends
Shows historical dividend payments for a company.
IndustrySector
Provides sector and industry classification for a company.
FinancialStatements
Fetches balance sheet, income statement, and cash flow data.
WebNews
Searches and retrieves relevant news articles and insights.