WYGIWYH Expense Tracking MCP Server

WYGIWYH Expense Tracking MCP Server

Enables AI agents to interact with the WYGIWYH expense tracking API through 75 dynamically generated MCP tools. Supports comprehensive financial operations including transaction management, account handling, recurring expenses, and investment tracking.

Category
访问服务器

README

WYGIWYH API MCP Server

A production-ready Model Context Protocol (MCP) server that provides a universal interface to the WYGIWYH expense tracking API. The server dynamically generates 75 MCP tools from an OpenAPI specification, enabling AI agents and automation platforms like n8n to interact with the expense tracking system through standardized tool calls.

Original repo of WYGIWYH

✨ Features

  • 🔄 Dynamic Tool Generation - Automatically generates 75 MCP tools from OpenAPI specification
  • 🔐 Secure Authentication - Bearer token authentication for MCP endpoints + Basic Auth for API access
  • 🚀 HTTP Streamable Transport - Full compatibility with n8n and other MCP clients
  • 🐳 Production-Ready Docker - Optimized multi-stage build with health checks
  • Async/Await - Efficient non-blocking API communication
  • 📊 Comprehensive API Coverage - All WYGIWYH API endpoints exposed as tools

🎯 Use Cases

  • Automate expense tracking workflows with n8n
  • Build AI assistants that manage financial data
  • Create custom integrations with WYGIWYH API
  • Implement voice-controlled expense logging
  • Develop automated reporting systems

📦 Quick Start

Prerequisites

  • Docker & Docker Compose
  • WYGIWYH API credentials
  • MCP Bearer token

Installation

  1. Clone the repository

    git clone https://github.com/ReNewator/MCP-WYGIWYH.git
    cd MCP-WYGIWYH
    
  2. Configure environment

    cp .env.example .env
    # Edit .env with your credentials
    # Don't forget change you WYGIWYH url in server.py
    
  3. Deploy with Docker

    ./deploy.sh
    

    Or manually:

    docker-compose up -d
    
  4. Verify deployment

    curl http://localhost:5000/health
    

🔧 Configuration

Create a .env file with the following variables:

# WYGIWYH API Credentials
API_USERNAME=your_email@example.com
API_PASSWORD=your_password_here

# MCP Server Authentication
MCP_TOKEN=your_mcp_bearer_token_here

🌐 n8n Integration

Configure the n8n MCP Client node:

  • Endpoint: http://your-server:5000/
  • Transport: HTTP Streamable
  • Authentication: Header Auth
    • Name: Authorization
    • Value: Bearer YOUR_MCP_TOKEN

🛠️ Available Tools

The server exposes 75 MCP tools organized by category:

Account Management

  • account-groups_* - Account group operations (6 tools)
  • accounts_* - Account CRUD operations (6 tools)

Transaction Management

  • transactions_* - Transaction operations (6 tools)
  • recurring-transactions_* - Recurring transaction management (6 tools)
  • installment-plans_* - Installment plan handling (6 tools)

Financial Tools

  • categories_* - Expense category management (6 tools)
  • tags_* - Transaction tagging (6 tools)
  • currencies_* - Currency management (6 tools)
  • exchange-rates_* - Exchange rate operations (6 tools)

Investment Features

  • dca_* - Dollar-cost averaging strategies (15 tools)
  • entities_* - Entity management (6 tools)

Use the tools/list method to see all available tools with their schemas.

📁 Project Structure

.
├── mcp_sse_server.py      # Main MCP server with HTTP Streamable
├── server.py              # Core MCP implementation
├── test_server.py         # Validation script
├── Dockerfile             # Production Docker image
├── docker-compose.yml     # Docker Compose config
├── deploy.sh              # Automated deployment
├── requirements.txt       # Python dependencies
├── DEPLOYMENT.md          # Detailed deployment guide
├── PROJECT.md             # Technical documentation
└── attached_assets/
    └── WYGIWYH API.yaml   # OpenAPI specification

🚀 Deployment

Docker (Recommended)

# Build and run
docker-compose up -d

# View logs
docker-compose logs -f

# Stop server
docker-compose down

Kubernetes

apiVersion: apps/v1
kind: Deployment
metadata:
  name: wygiwyh-mcp-server
spec:
  replicas: 2
  template:
    spec:
      containers:
      - name: mcp-server
        image: wygiwyh-mcp-server:latest
        ports:
        - containerPort: 5000
        env:
        - name: API_USERNAME
          valueFrom:
            secretKeyRef:
              name: wygiwyh-secrets
              key: api-username

Cloud Platforms

  • AWS ECS/Fargate - Use the Docker image with environment variables
  • Google Cloud Run - Deploy as container with secrets management
  • Azure Container Instances - Direct deployment from Docker Hub

See DEPLOYMENT.md for detailed cloud deployment instructions.

🧪 Testing

Run the validation script to verify the setup:

python test_server.py

This displays all 75 generated MCP tools grouped by category.

📊 API Endpoints

  • POST / - MCP JSON-RPC endpoint (requires Bearer token)
  • GET /health - Health check (no authentication)

🔒 Security Features

  • ✅ Bearer token authentication for MCP access
  • ✅ Basic Auth for WYGIWYH API requests
  • ✅ Non-root container user
  • ✅ Secrets managed via environment variables
  • ✅ No exposed credentials in logs

🏗️ Architecture

Dynamic Tool Generation

The server automatically generates MCP tools from the OpenAPI specification:

  1. Parses WYGIWYH API OpenAPI YAML
  2. Converts schemas to JSON Schema format
  3. Creates Tool objects for all operations
  4. Handles allOf merging for complex types
  5. Exposes tools via MCP protocol

Benefits:

  • Single source of truth (OpenAPI spec)
  • Automatic updates when API changes
  • Zero manual endpoint definitions
  • Consistent tool schemas

Authentication Flow

┌─────────────┐     Bearer Token     ┌─────────────┐
│   n8n/MCP   │ ──────────────────> │  MCP Server │
│   Client    │                      │             │
└─────────────┘                      └─────────────┘
                                            │
                                            │ Basic Auth
                                            ▼
                                     ┌─────────────┐
                                     │  WYGIWYH    │
                                     │     API     │
                                     └─────────────┘

🐛 Troubleshooting

Server won't start

# Check logs
docker-compose logs

# Verify environment
cat .env

Authentication errors

  • Ensure API_USERNAME is your WYGIWYH email
  • Verify API_PASSWORD is correct
  • Check MCP_TOKEN matches client configuration

Connection refused

# Check server status
docker-compose ps

# Test health endpoint
curl http://localhost:5000/health

📚 Documentation

🤝 Contributing

Contributions are welcome! Please follow these guidelines:

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

📄 License

Copyright (c) 2025 ReNewator.com. All rights reserved.

🔗 Links

💬 Support

For issues and questions:

  • Open an issue on GitHub
  • Check existing documentation
  • Review deployment logs

Built with ❤️ by ReNewator.com

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选