Labsco
ikhyunAn logo

Portfolio Manager MCP Server

โ˜… 6

from ikhyunAn

A server providing tools and resources for managing and analyzing investment portfolios.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredNeeds API keys

Portfolio Manager MCP Server

Project Logo

MseeP.ai Security Assessment Badge

A Model Context Protocol (MCP) server that provides tools and resources for managing and analyzing investment portfolios.

Features

  • Portfolio Management: Create and update investment portfolios with stocks and bonds
  • Market Data: Fetch real-time stock price information and relevant news
  • Analysis: Generate comprehensive portfolio reports and performance analysis
  • Recommendations: Get personalized investment recommendations based on portfolio composition
  • Visualization: Create visual representations of portfolio allocation

Example Queries

Once the server is running and connected to Claude, you can interact with it using natural language:

  • "Create a portfolio with 30% AAPL, 20% MSFT, 15% AMZN, and 35% US Treasury bonds with user Id <User_ID>"
  • "What's the recent performance of my portfolio?"
  • "Show me news about the stocks in my portfolio"
  • "Generate investment recommendations for my current portfolio"
  • "Visualize my current asset allocation"

Project Structure

portfolio-manager/
โ”œโ”€โ”€ main.py                      # Entry point
โ”œโ”€โ”€ portfolio_server/            # Main package
โ”‚   โ”œโ”€โ”€ api/                     # External API clients
โ”‚   โ”‚   โ”œโ”€โ”€ alpha_vantage.py     # Stock market data API
โ”‚   โ”‚   โ””โ”€โ”€ news_api.py          # News API
โ”‚   โ”œโ”€โ”€ data/                    # Data management
โ”‚   โ”‚   โ”œโ”€โ”€ portfolio.py         # Portfolio models
โ”‚   โ”‚   โ””โ”€โ”€ storage.py           # Data persistence
โ”‚   โ”œโ”€โ”€ resources/               # MCP resources
โ”‚   โ”‚   โ””โ”€โ”€ portfolio_resources.py # Portfolio resource definitions
โ”‚   โ”œโ”€โ”€ tools/                   # MCP tools
โ”‚   โ”‚   โ”œโ”€โ”€ analysis_tools.py    # Portfolio analysis
โ”‚   โ”‚   โ”œโ”€โ”€ portfolio_tools.py   # Portfolio management
โ”‚   โ”‚   โ”œโ”€โ”€ stock_tools.py       # Stock data and news
โ”‚   โ”‚   โ””โ”€โ”€ visualization_tools.py # Visualization tools
โ”‚   โ””โ”€โ”€ server.py                # MCP server setup
โ””โ”€โ”€ requirements.txt             # Dependencies

Future Work

As of now, the MCP program uses manually created JSON file which keeps track of each user's investment portfolio.

This should be fixed so that it reads in the portfolio data from actual banking applications.

Tasks

  • Extract JSON from a Finance or Banking Application which the user uses
  • Enable modifying the investment portfolio by the client
  • Implement automated portfolio rebalancing
  • Add support for cryptocurrency assets
  • Develop mobile application integration