MCP Accounting MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "DATABASE_URL=${DATABASE_URL}" -e "SECRET_KEY=${SECRET_KEY}" -e "FRONTEND_URL=${FRONTEND_URL}" mcp-accounting -- docker compose up --build
Required:DATABASE_URLSECRET_KEYFRONTEND_URL
README.md

An AI-powered accounting anomaly detection platform

MCP Accounting Platform

An AI-powered accounting anomaly detection platform built with FastAPI, PostgreSQL, React, and OpenAI, featuring a complete production-ready authentication system.


๐Ÿš€ Overview

MCP Accounting is a full-stack system designed to:

  • Ingest financial transaction data
  • Detect anomalies (large transactions, duplicates)
  • Generate AI-powered explanations
  • Expose functionality as MCP-style callable APIs

๐Ÿงฑ Tech Stack

Backend

  • FastAPI
  • SQLAlchemy
  • PostgreSQL
  • Passlib (bcrypt)
  • JWT (authentication)
  • Docker

Frontend

  • React (TypeScript)
  • Tailwind CSS

AI Layer

  • OpenAI API (explanations)

๐Ÿ” Authentication System (Production-Ready)

Features Implemented

  • โœ… User registration
  • โœ… Email verification (token-based)
  • โœ… Secure password hashing (bcrypt)
  • โœ… Login with JWT (stateless auth)
  • โœ… Password reset flow
  • โœ… Protected routes (JWT-ready)

Auth Flow

Registration
  1. User registers
  2. User is created as inactive/unverified
  3. Verification token generated (DB)
  4. Email sent with verification link
Email Verification
  • Token validated

  • User marked as:

    • is_active = True
    • is_verified = True
  • Token invalidated after use

Login
  • Validates:

    • Email exists
    • Password matches (bcrypt)
    • User is verified
  • Returns JWT:

{
  "access_token": "jwt-token",
  "token_type": "bearer"
}
Password Reset
  1. Request reset
  2. Token generated and emailed
  3. User submits new password
  4. Token invalidated

๐Ÿ—๏ธ Architecture

Frontend (React)
        โ†“
FastAPI (API Layer)
        โ†“
Service Layer (Business Logic)
        โ†“
SQLAlchemy ORM
        โ†“
PostgreSQL
        โ†“
AI Layer (OpenAI)

๐Ÿ”„ Data Flow

Register โ†’ Verify Email โ†’ Login โ†’ Upload CSV
        โ†“
Store Transactions โ†’ Detect Anomalies
        โ†“
Generate Report โ†’ AI Explanation

๐Ÿงฉ API Endpoints

Auth

  • POST /auth/register
  • POST /auth/login
  • GET /verify-email
  • POST /forgot-password
  • POST /reset-password

Core Features

  • POST /upload-transactions
  • POST /tools/get_transactions
  • POST /tools/detect_large_expenses
  • POST /tools/find_duplicate_payments
  • POST /report/anomalies
  • POST /report/anomalies/explain

๐Ÿณ Running with Docker

docker compose up --build

Access:


โš™๏ธ Environment Variables

DATABASE_URL=postgresql://postgres:postgres@db:5432/mcp_accounting
SECRET_KEY=your-secret-key
FRONTEND_URL=http://localhost:3000

๐Ÿง  Key Technical Decisions

1. Separation of Token Types

Use Case Mechanism
Email verification DB token
Password reset DB token
Authentication JWT

2. Security Practices

  • Password hashing via bcrypt
  • No plaintext password storage
  • Token invalidation after use
  • Generic login errors (no user enumeration)

3. SQLAlchemy Best Practices

  • Single Base instance
  • Proper model registration
  • Dependency-injected DB sessions

4. Dockerized Environment

  • Service-based networking (db)
  • Environment-driven configuration
  • Clean container rebuilds

๐Ÿงช Current Status

  • โœ… End-to-end functional
  • โœ… Authentication fully implemented
  • โœ… Stable Docker environment
  • โœ… Clean API contracts
  • โœ… AI integration working

๐Ÿ“Œ Next Steps

  • Alembic migrations (schema versioning)
  • JWT-protected endpoints
  • Role-based access control (RBAC)
  • Background jobs (email queue)
  • Token hashing (security hardening)
  • Observability (logs + metrics)

๐Ÿ’ก Project Purpose

This project demonstrates:

  • Real-world backend architecture
  • Secure authentication design
  • AI integration into financial workflows
  • MCP-style API exposure for automation

๐Ÿ‘จโ€๐Ÿ’ป Author

Developed as a production-style backend system to showcase:

  • Python / FastAPI expertise
  • System design & architecture
  • Secure authentication flows
  • AI-driven application design

๐Ÿ“„ License

MIT License

Tools (3)

get_transactionsRetrieve stored financial transaction data.
detect_large_expensesIdentify transactions that exceed a specific threshold.
find_duplicate_paymentsScan for duplicate payment entries in the dataset.

Environment Variables

DATABASE_URLrequiredPostgreSQL connection string
SECRET_KEYrequiredSecret key for JWT authentication
FRONTEND_URLrequiredURL for the frontend application

Configuration

claude_desktop_config.json
{"mcpServers": {"mcp-accounting": {"command": "docker", "args": ["run", "-i", "--rm", "mcp-accounting"]}}}

Try it

โ†’Analyze my uploaded transactions and list all duplicate payments found.
โ†’Detect any unusually large expenses in the current transaction dataset.
โ†’Provide an AI-powered explanation for the anomalies detected in my recent financial report.

Frequently Asked Questions

What are the key features of MCP Accounting?

Ingest and store financial transaction data. Automated detection of large transaction anomalies. Identification of duplicate payment entries. AI-powered explanations for financial anomalies. Production-ready authentication system with JWT.

What can I use MCP Accounting for?

Automating the audit process for large CSV transaction datasets. Identifying potential accounting errors or fraud through duplicate detection. Generating AI-driven insights from raw financial transaction logs.

How do I install MCP Accounting?

Install MCP Accounting by running: docker compose up --build

What MCP clients work with MCP Accounting?

MCP Accounting works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP Accounting docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare