Wealthfolio MCP Server

Wealthfolio MCP Server

Integrates with Wealthfolio to provide real-time portfolio data, valuations, account management, and historical performance analytics through a Model Context Protocol interface compatible with OpenWebUI and automation tools.

Category
访问服务器

README

Wealthfolio MCP Server

A Model Context Protocol (MCP) server that integrates with Wealthfolio to provide portfolio data, valuations, and analytics to OpenWebUI and other MCP-compatible applications.

Features

  • Real-time Portfolio Data: Fetch current portfolio valuations, holdings, and performance metrics
  • Account Management: Access all your Wealthfolio accounts and their details
  • Asset Information: Get comprehensive asset profiles and market data
  • Historical Valuations: Retrieve portfolio performance history over time
  • OpenWebUI Integration: Seamlessly integrate with OpenWebUI for enhanced AI interactions
  • n8n Workflow Support: Ready for automation workflows with n8n

Prerequisites

  • Python 3.10+
  • Wealthfolio API access
  • OpenWebUI (for UI integration)
  • n8n (optional, for workflow automation)

Installation

Option 1: Local Development

  1. Clone the repository:

    git clone https://github.com/toomy1992/Wealthfolio-MCP.git
    cd Wealthfolio-MCP
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Configure environment:

    cp .env.example .env
    # Edit .env with your Wealthfolio API key
    
  4. Update your API key in .env:

    API_KEY=your_wealthfolio_api_key_here
    API_BASE_URL=https://wealthfolio.labruntipi.io/api/v1
    

Option 2: Docker (Recommended)

  1. Clone the repository:

    git clone https://github.com/toomy1992/Wealthfolio-MCP.git
    cd Wealthfolio-MCP
    
  2. Configure environment:

    cp .env.example .env
    # Edit .env with your Wealthfolio API key
    
  3. Run with Docker Compose:

    docker-compose up -d
    
  4. Or build and run manually:

    docker build -t wealthfolio-mcp .
    docker run -p 8000:8000 --env-file .env wealthfolio-mcp
    

Option 3: Pre-built Docker Image

Pull the latest release from GitHub Container Registry:

docker pull ghcr.io/toomy1992/wealthfolio-mcp:latest
docker run -p 8000:8000 --env-file .env ghcr.io/toomy1992/wealthfolio-mcp:latest

Usage

Starting the Server

uvicorn src.mcp_server:app --reload

The server will start on http://127.0.0.1:8000

API Endpoints

  • GET /portfolio - Get comprehensive portfolio data including accounts, valuations, assets, and historical performance
  • POST /sync - Trigger portfolio synchronization (placeholder for future implementation)

Testing the API

Visit http://127.0.0.1:8000/docs for interactive API documentation.

Or test with curl:

curl -X GET "http://127.0.0.1:8000/portfolio" -H "accept: application/json"

OpenWebUI Integration

  1. Install the MCP plugin in OpenWebUI
  2. Configure the MCP server URL: http://127.0.0.1:8000
  3. Add tools for portfolio queries:
    • Portfolio summary
    • Account valuations
    • Asset performance
    • Historical charts

Example OpenWebUI Queries

  • "What's my current portfolio value?"
  • "Show me my account performance over the last month"
  • "Which assets have the highest gains?"
  • "Display my portfolio allocation by asset type"

n8n Integration

Create automated workflows in n8n:

  1. HTTP Request Node: Connect to http://127.0.0.1:8000/portfolio
  2. Schedule Trigger: Set up daily/weekly portfolio reports
  3. Data Processing: Transform portfolio data for notifications
  4. Email/Discord Integration: Send automated portfolio updates

Sample n8n Workflow

Schedule Trigger → HTTP Request (Portfolio) → Data Transform → Email Notification

Configuration

Environment Variables

Variable Description Default
API_KEY Your Wealthfolio API key Required
API_BASE_URL Wealthfolio API base URL https://wealthfolio.labruntipi.io/api/v1
asset_filters Asset types to filter ["stocks", "crypto"]

API Endpoints Used

The server integrates with these Wealthfolio API endpoints:

  • /api/v1/accounts - Account information
  • /api/v1/valuations/latest - Current portfolio valuations
  • /api/v1/assets - Asset profiles and data
  • /api/v1/valuations/history - Historical performance data
  • /api/v1/holdings/item - Individual holding details

CI/CD and Releases

This project uses GitHub Actions for automated building, testing, and releasing.

Automated Versioning

  • Versions start from 0.1.0
  • Patch versions are automatically incremented on each push to main
  • Releases are created automatically with Docker images

GitHub Actions Workflow

The CI/CD pipeline includes:

  • Testing: Runs pytest and linting on all pushes
  • Docker Build: Builds and pushes Docker images to GitHub Container Registry
  • Automated Releases: Creates GitHub releases with version tags

Docker Images

Pre-built images are available at:

ghcr.io/toomy1992/wealthfolio-mcp:latest

Development

Project Structure

wealthfolio-mcp/
├── src/
│   ├── mcp_server.py      # FastAPI MCP server
│   └── api_client.py       # Wealthfolio API client
├── config/
│   └── settings.py         # Configuration management
├── tests/                  # Unit and integration tests
├── .github/
│   └── workflows/          # GitHub Actions
├── Dockerfile              # Docker build configuration
├── docker-compose.yml      # Local development setup
├── requirements.txt        # Python dependencies
├── .env.example           # Environment template
└── README.md              # This file

Running Tests

# Run all tests
pytest tests/

# Or use the Makefile
make test

Development Commands

Use the provided Makefile for common development tasks:

make install      # Install dependencies
make dev          # Run development server
make test         # Run tests
make lint         # Run linting
make format       # Format code
make docker-build # Build Docker image
make docker-run   # Run Docker container

Docker Development

# Build locally
docker build -t wealthfolio-mcp .

# Run with hot reload for development
docker run -p 8000:8000 -v $(pwd):/app --env-file .env wealthfolio-mcp

Adding New Features

  1. Extend the WealthfolioClient class in api_client.py
  2. Add new endpoints in mcp_server.py
  3. Update the README with new functionality
  4. Add tests for new features
  5. Update the Dockerfile if new dependencies are added

Troubleshooting

Common Issues

  1. API Key Invalid: Verify your API key in .env
  2. Connection Errors: Check internet connectivity and API URL
  3. Empty Responses: Ensure your Wealthfolio instance has data
  4. CORS Issues: Configure OpenWebUI CORS settings for the MCP server

Debug Mode

Run with debug logging:

uvicorn src.mcp_server:app --reload --log-level debug

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Support

Releases and Versioning

This project uses automated semantic versioning starting from 0.1.0. Each push to the main branch automatically:

  1. Increments the patch version (e.g., 0.1.00.1.1)
  2. Creates a new GitHub release
  3. Builds and pushes Docker images to GitHub Container Registry

Latest Release

GitHub release Docker Image

Changelog

v0.1.0

  • Initial release
  • Wealthfolio API integration with real endpoints
  • FastAPI MCP server implementation
  • Docker containerization
  • OpenWebUI compatibility
  • n8n workflow support
  • Automated CI/CD with GitHub Actions
  • Comprehensive test suite

Build with Grok

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选