The Portfolio Manager MCP server provides tools and resources for managing and analyzing investment portfolios. It offers real-time stock data, portfolio analysis, personalized recommendations, and visualization capabilities through a Model Context Protocol (MCP) server that integrates with Claude.
Before installing, you'll need:
Clone the repository and navigate to the directory:
git clone https://github.com/ikhyunAn/portfolio-manager-mcp.git
cd portfolio-manager-mcp
Install the required dependencies:
pip install -r requirements.txt
Set up API keys (optional but recommended for full functionality):
export ALPHA_VANTAGE_API_KEY="your_key_here"
export NEWS_API_KEY="your_key_here"
Alternatively, create a .env file in the root directory to store your API keys.
The server can be run in two different modes:
Stdio Transport (default mode for Claude Desktop integration):
python main.py
SSE Transport (for HTTP-based clients):
python main.py --sse
To integrate the server with Claude Desktop:
Add the server to your Claude Desktop configuration file:
{
"mcpServers": {
"portfolio-manager": {
"command": "python",
"args": ["/path/to/portfolio-manager-mcp/main.py"],
"env": {
"ALPHA_VANTAGE_API_KEY": "your_key_here",
"NEWS_API_KEY": "your_key_here"
}
}
}
}
If using a virtual environment:
{
"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"
}
}
}
}
For a cleaner installation, you can use 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
For easier installation, you can use the MCP CLI:
mcp install main.py
Once the server is running and connected to Claude, you can interact using natural language queries such as:
The Portfolio Manager MCP server offers several key features:
Currently, the MCP program uses manually created JSON files to track each user's investment portfolio, with plans to integrate with actual banking applications in the future.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "portfolio-manager" '{"command":"python","args":["/path/to/portfolio-manager-mcp/main.py"],"env":{"ALPHA_VANTAGE_API_KEY":"your_key_here","NEWS_API_KEY":"your_key_here"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"portfolio-manager": {
"command": "python",
"args": [
"/path/to/portfolio-manager-mcp/main.py"
],
"env": {
"ALPHA_VANTAGE_API_KEY": "your_key_here",
"NEWS_API_KEY": "your_key_here"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"portfolio-manager": {
"command": "python",
"args": [
"/path/to/portfolio-manager-mcp/main.py"
],
"env": {
"ALPHA_VANTAGE_API_KEY": "your_key_here",
"NEWS_API_KEY": "your_key_here"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect