Cover image
Try Now
2025-04-06

Serveur MCP: gestion du portefeuille d'investissement

3 years

Works with Finder

2

Github Watches

0

Github Forks

2

Github Stars

Portfolio Manager MCP Server

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

Installation

  1. Clone this repository:

    git clone https://github.com/ikhyunAn/portfolio-manager-mcp.git
    cd portfolio-manager-mcp
    
  2. Install the required dependencies:

    pip install -r requirements.txt
    
  3. Set up API keys (optional):

    export ALPHA_VANTAGE_API_KEY="your_key_here"
    export NEWS_API_KEY="your_key_here"
    

    Alternatively, create a .env file in the root of the directory and store the API keys

Usage

Running the Server

You can run the server in two different modes:

  1. Stdio Transport (default, for Claude Desktop integration):

    python main.py   # alternate commands: i.e.) python3, python3.11
    
  2. SSE Transport (for HTTP-based clients):

    python main.py --sse
    

Integration with Claude Desktop

Add the server to your Claude Desktop configuration file:

{
  "mcpServers": {
    "portfolio-manager": {
      "command": "python",      // may use different command
      "args": ["/path/to/portfolio-manager-mcp/main.py"],
      "env": {
        "ALPHA_VANTAGE_API_KEY": "your_key_here",
        "NEWS_API_KEY": "your_key_here"
      }
    }
  }
}

If you choose to run your server in a virtual environment, then your configuration file will look like:

{
  "mcpServers": {
    "portfolio-manager": {
      "command": "/path/to/portfolio-manager-mcp/venv/bin/python",
      "args": ["/path/to/portfolio-manager-mcp/main.py"],
      "env": {
        "PYTHONPATH": "/path/to/portfolio-manager-mcp",
        "ALPHA_VANTAGE_API_KEY": "your_key_here",
        "NEWS_API_KEY": "your_key_here"
      }
    }
  }
}

To run it in a virtual environment:

# Create a virtual environment
python3 -m venv venv

# Activate the virtual environment
source venv/bin/activate  # On macOS/Linux
# or
# venv\Scripts\activate   # On Windows

# Install dependencies
pip install -r requirements.txt

# Run the server
python3 main.py

Or use the MCP CLI for easier installation:

mcp install main.py

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

License

MIT

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • tomoyoshi hirata
  • Sony α7IIIマニュアルアシスタント

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • jae-jae
  • MCP Server pour récupérer le contenu de la page Web à l'aide du navigateur sans tête du dramwright.

  • ravitemer
  • Un puissant plugin Neovim pour gérer les serveurs MCP (Protocole de contexte modèle)

  • patruff
  • Pont entre les serveurs Olllama et MCP, permettant aux LLM locaux d'utiliser des outils de protocole de contexte de modèle

  • Sysc4lls
  • Lecteur de documentation IDA (Sort-of) MCP Server

  • pontusab
  • La communauté du curseur et de la planche à voile, recherchez des règles et des MCP

  • JackKuo666
  • 🔍 Permettre aux assistants d'IA de rechercher et d'accéder aux informations du package PYPI via une interface MCP simple.

  • av
  • Exécutez sans effort LLM Backends, API, Frontends et Services avec une seule commande.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 LLM 资料总结 (数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Résumé des meilleures ressources LLM du monde.

    Reviews

    2 (1)
    Avatar
    user_QMZWD6vh
    2025-04-17

    As a dedicated user of MCP_InvestmentPortfolio, I find it incredibly user-friendly and efficient for managing my investments. The intuitive interface and comprehensive tools provided by ikhyunAn make portfolio tracking and analysis a breeze. Highly recommended for both novice and experienced investors!