FinOps Agentic Reconciliation MCP Server

FinOps Agentic Reconciliation MCP Server

This MCP server enables autonomous finance operations, providing tools to run 3-way matching audits, fetch unmatched invoices, trigger vendor holds, and retrieve vendor aging summaries. It integrates with an AI agent for policy-based discrepancy resolution and executive dashboards.

Category
Visit Server

README

FinOps-Agentic-Reconciliation

Autonomous Procure-to-Pay (P2P) 3-Way Matching Data Pipeline, FastMCP Server, and Ops AI Resolution Engine

Python 3.9+ SQL Engine MCP Server License: MIT

An enterprise-grade Finance Operations platform built to automate 3-way invoice reconciliation (PO vs. GRN vs. Invoice), audit line-item price & quantity variances, calculate financial exposure risk, and orchestrate autonomous discrepancy resolution using Model Context Protocol (MCP) tools.


šŸ“ System Architecture

flowchart TD
    subgraph Data Layer [ERP Data Ingestion]
        PO[Purchase Orders CSV] --> DB[(SQLite / Postgres DB)]
        GRN[Goods Received Notes CSV] --> DB
        INV[Vendor Invoices CSV] --> DB
    end

    subgraph SQL Engine [Analytics & Reconciliation Pipeline]
        DB --> CTE[3-Way Matching SQL CTEs & Window Functions]
        CTE --> DISC[Discrepancy Matrix & Risk Scoring]
        DISC --> DB_TABLES[Populate Discrepancies & Audit Logs]
    end

    subgraph Agentic Layer [Model Context Protocol & Ops AI Agent]
        DB_TABLES <--> MCP[FastMCP Server]
        MCP <--> AGENT[Ops AI Agent Resolution Engine]
        AGENT --> POLICY[Corporate Financial Policy Rules]
        POLICY --> ACTIONS[Auto-Approve / Hold / Credit Note Request]
    end

    subgraph Executive Layer [UI & Observability]
        DB_TABLES --> DASHBOARD[Streamlit Executive & Ops Workbench]
        ACTIONS --> DASHBOARD
    end

šŸ”„ Key Capabilities

  1. Automated Procure-to-Pay (P2P) 3-Way Matching:

    • Executes line-item reconciliation across Purchase Orders, Goods Received Notes, and Vendor Invoices.
    • Categorizes financial anomalies: UNIT_PRICE_VARIANCE, QTY_SHORTAGE, MISSING_GRN, DUPLICATE_INVOICE.
  2. Model Context Protocol (MCP) Server (src/mcp_server/):

    • Implements standard MCP JSON-RPC tool endpoints:
      • get_unmatched_invoices(status, min_severity)
      • run_3way_matching_audit(invoice_number)
      • trigger_vendor_hold(invoice_number, reason)
      • fetch_vendor_aging_summary(vendor_id)
  3. Autonomous Ops AI Agent (src/agent/):

    • Processes flagged discrepancies in batches.
    • Evaluates corporate financial policies (e.g. 1% price variance tolerance, auto-hold on missing GRN, credit note request for overbilling).
    • Updates database state atomically and logs immutable audit trails.
  4. Executive Ops Workbench & Analytics Dashboard (src/dashboard/app.py):

    • Dark-mode Streamlit dashboard with real-time KPI metrics (Auto-Match %, Financial Exposure Risk INR, Hours Saved).
    • Side-by-side PO vs. GRN vs. Invoice line-item comparison tool.
    • Live AI Agent execution terminal with simulation logs.
    • Accounts Payable aging buckets (Current, 1-30, 31-60, 60+ days) and vendor risk scatter matrix.

šŸ“Š Discrepancy Taxonomy & Policy Matrix

Anomaly Type Condition Severity Financial Exposure Autonomous Action
Immaterial Variance Price variance $\le 1.0%$ LOW Minor AUTO_APPROVE
Unit Price Mismatch Invoice rate > Agreed PO rate HIGH / CRITICAL (Billed Price - PO Price) * Qty REQUEST_CREDIT_NOTE & ON_HOLD
Quantity Shortage Billed Qty > GRN Received Qty HIGH Shortage Qty * Billed Price APPROVE_PARTIAL & ON_HOLD
Missing GRN Invoice received before warehouse receipt HIGH Total Billed Amount HOLD_PAYMENT
Duplicate Invoice Same PO/Invoice submitted multiple times CRITICAL Total Billed Amount BLOCK_IMMEDIATELY

⚔ Quickstart Guide

1. Prerequisites & Environment Setup

git clone https://github.com/your-username/FinOps-Agentic-Reconciliation.git
cd FinOps-Agentic-Reconciliation

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

2. Generate ERP Data & Run Reconciliation Pipeline

# Generate 1,000+ realistic transaction records and run ETL pipeline
make etl

# Or run directly via Python:
python -m src.pipeline.etl_reconciliation

3. Run Automated Tests

make test

4. Launch Ops Workbench Dashboard

make dashboard

Open your browser at http://localhost:8501.


šŸ“ Repository Structure

FinOps-Agentic-Reconciliation/
ā”œā”€ā”€ README.md                      # Technical documentation & architecture
ā”œā”€ā”€ pyproject.toml                 # Package configuration
ā”œā”€ā”€ requirements.txt               # Pinned dependencies
ā”œā”€ā”€ Makefile                       # Developer CLI shortcuts
ā”œā”€ā”€ config/
│   └── settings.yaml              # Financial thresholds & tolerance settings
ā”œā”€ā”€ data/
│   ā”œā”€ā”€ raw_pos.csv                # Sample PO transactions
│   ā”œā”€ā”€ raw_grns.csv               # Sample GRN receipts
│   └── raw_invoices.csv           # Sample Vendor Invoices
ā”œā”€ā”€ sql/
│   ā”œā”€ā”€ 01_schema_init.sql         # Relational DDL & performance indexes
│   ā”œā”€ā”€ 02_three_way_matching.sql  # 3-Way matching CTEs & window functions
│   └── 03_vendor_aging_kpis.sql   # AP aging aggregation queries
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ pipeline/
│   │   ā”œā”€ā”€ generate_synthetic_data.py # ERP synthetic transaction generator
│   │   └── etl_reconciliation.py  # Main ETL reconciliation engine
│   ā”œā”€ā”€ mcp_server/
│   │   └── ops_mcp_server.py      # FastMCP JSON-RPC server implementation
│   ā”œā”€ā”€ agent/
│   │   ā”œā”€ā”€ ops_agent.py           # FinOps AI Agent batch execution engine
│   │   └── discrepancy_rules.py   # Deterministic financial policies
│   └── dashboard/
│       └── app.py                 # Streamlit Executive Ops Workbench
└── tests/
    ā”œā”€ā”€ test_reconciliation.py     # Discrepancy rule unit tests
    └── test_mcp_server.py         # MCP tool integration tests

šŸ›”ļø License

Distributed under the MIT License. See LICENSE for more information.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured