Inspiration

Corporate travel allowance inflation is a major loophole for HR departments. With fuel prices fluctuating across regions and employees using varying modes of transport, manual verification is slow and error-prone. We built Travel Expense Audit MCP Agent to automatically convert a raw text claim from an employee into a structured, mathematically verified audit verdict in milliseconds, stopping expense leaks instantly.

What it does

The application takes unstructured, conversational claim text submitted by employees, extracts the key operational parameters, and runs them against a live verification pipeline. It automatically pulls city-specific fuel rates, cross-references the vehicle type's baseline efficiency, calculates the legitimate trip cost, and issues a definitive approval or a fraud flag based on financial variance.

How we built it

We designed a decoupled, real-time auditing infrastructure using a modern AI-agent stack:

  • Frontend: Built a clean, high-contrast dashboard with Streamlit to handle raw text inputs and stream live execution logs.
  • Orchestration: Integrated OpenRouter using gemini-2.5-flash to process text narratives and parse them into clean JSON entities containing city, distance, vehicle type, and claimed amount.
  • Model Context Protocol (MCP): Utilized FastMCP to expose dedicated backend tools (get_fuel_rate_by_city and verify_trip_math), separating the AI's reasoning capabilities from our deterministic calculations.

The Audit Mathematics

The agent passes extracted parameters directly to a strict Python verification layer using the following logic:

$$\text{Expected Cost} = \left( \frac{\text{Distance (km)}}{\text{Vehicle Efficiency (km/L)}} \right) \times \text{Local Fuel Rate (₹/L)}$$

$$\text{Variance} = \text{Total Claimed Amount} - \text{Expected Cost}$$

If $\text{Variance} \le \text{150}$, the claim is instantly approved. Any amount higher triggers a prominent fraud alert status banner.

Challenges we ran into

  • Separation of Concerns: Early iterations allowed the LLM to handle the cost calculations directly, which led to inconsistent mathematical reasoning. We resolved this by restricting the LLM strictly to entity extraction and routing all mathematical logic to deterministic Python code via the MCP layer.
  • UI Layout Contrast: Designing a clean interface in Streamlit that effectively highlights compliance status banners while maintaining high text readability required precise custom CSS injections.

Accomplishments that we're proud of

  • Successful Tool Integration: Achieving a flawless tool-calling sequence where the LLM cleanly triggers local backend functions based purely on a user's natural language narrative.
  • Zero Math Hallucinations: Engineering a hybrid architecture that successfully eliminates AI mathematical errors in a financial compliance application.

What we learned

  • The Power of MCP: We experienced firsthand how the Model Context Protocol securely and cleanly bridges generative AI with hard code execution environments.
  • Deterministic Guardrails: We learned that combining natural language understanding for data extraction with absolute mathematical validation layers is infinitely more reliable for corporate fintech applications than using text generation alone.

What's next for Travel Expense Audit MCP Agent

  • OCR Receipt Verification: Integrating an image processing layer to let users upload photos of fuel bills alongside their text narratives for multi-modal verification.
  • Enterprise ERP Connectors: Developing native plugins to connect the MCP agent directly with corporate accounting platforms like SAP, Zoho Books, or Workday for automated reimbursement processing.

Built With

  • fastmcp
  • openrouter
  • python
  • python-dotenv
  • streamlit
Share this project:

Updates

Submission history