MCP Accounting
Integrates with the OpenAI API to generate AI-powered explanations for detected financial anomalies, providing natural language insights into accounting irregularities such as large transactions and duplicate payments.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP AccountingCheck for unusually large expenses or duplicate payments."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: Quack MCP
๐งฑ 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
User registers
User is created as inactive/unverified
Verification token generated (DB)
Email sent with verification link
Email Verification
Token validated
User marked as:
is_active = Trueis_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
Request reset
Token generated and emailed
User submits new password
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/registerPOST /auth/loginGET /verify-emailPOST /forgot-passwordPOST /reset-password
Core Features
POST /upload-transactionsPOST /tools/get_transactionsPOST /tools/detect_large_expensesPOST /tools/find_duplicate_paymentsPOST /report/anomaliesPOST /report/anomalies/explain
๐ณ Running with Docker
docker compose up --buildAccess:
API Docs: http://localhost:8000/docs
Frontend: http://localhost:3000
โ๏ธ 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
BaseinstanceProper 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
This server cannot be deployed
Maintenance
Related MCP Connectors
SEC filings and financial data for AI agents: 59 tools for statements, valuation and supply chains.
Open-source AI accounting skills verified by licensed accountants (tax, VAT, payroll).
AI agents for bookkeeping, reconciliation, and financial close for SMBs.
AI Accountant for Quickbooks- recording, reconcile, month-end close
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceAI-first CSV analysis tool that enables AI agents to analyze, query, and audit large CSV files directly within conversations, turning raw data into actionable insights.2-
- AlicenseNot gradedqualityDmaintenanceEnables LLM agents to load, explore, and analyze CSV and Excel files using DuckDB, with tools for SQL querying, statistical analysis, expense optimization, and anomaly detection.MIT
- FlicenseAqualityBmaintenanceExposes a ledger system (invoice queue, duplicate control, VAT register, contractor history, decision journal) as MCP tools for AI agents, enabling accurate invoice processing with deterministic validation.7-
- AlicenseAqualityCmaintenanceEnables AI agents to interact with a double-entry ledger, offering tools for account management, balanced journal entries, balance queries, trial balance, and penny-perfect allocation. Built with safety by construction: no update/delete tools, idempotent posting, and an append-only journal.7MIT