Skip to main content

WYGIWYH API MCP Server - Universal MCP server for the WYGIWYH expense tracking API

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_renewator_wygiwyh-1.0.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iflow_mcp_renewator_wygiwyh-1.0.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file iflow_mcp_renewator_wygiwyh-1.0.0.tar.gz.

File metadata

File hashes

Hashes for iflow_mcp_renewator_wygiwyh-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5deaf56b4bee84e50153d43ecf232850c77cf8fd809cebb144c6c5bfda631172
MD5 dafbdef0bc1aa69c18ffe65c40cec841
BLAKE2b-256 012f170c0a1e566bd2b616174e2f715dec352f8dbbcc916192c61ed31bb7733c

See more details on using hashes here.

File details

Details for the file iflow_mcp_renewator_wygiwyh-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for iflow_mcp_renewator_wygiwyh-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b17a26d6521d14d0f13f6b2d4bfe9b446e8d066c563224abac3aa3b1a19ce91
MD5 9eb86b7ca1b24ee499cf39af32fd031c
BLAKE2b-256 56c8e132d9254877160907d5957371755926ce6447f1392b8d6b8c86874f72aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page