---
title: "Building Ramp's MCP server"
description: "Ramp built an open-source MCP server that exposes its developer API to LLMs through tools and a SQL interface, enabling natural-language access to business spend data. Using FastMCP in Python and Claude Desktop, the prototype could run analyses, generate visualizations, and issue cards on demand, but pagination struggled beyond a few hundred transactions because of miscalculations, context limits, input sizes, and token use. The team replaced bulk responses with an in-memory ETL that flattens API JSON into SQLite, then exposes load, transformation, and query tools; an OLAP-powered API was added for reporting workloads that caused timeouts. This let Claude analyze tens of thousands of spend events with aggregate and window functions while reducing token usage, although API latency, occasional reliability problems, tool-selection errors, and security risks remain; audit logs, OAuth scopes, and constrained tools provide mitigations, while write actions await a safety framework."
---

# Building Ramp's MCP server

[Ramp](https://yomu.fyi/company/ramp) · Junho Choi · Mar 25, 2025

**Type:** Explainer

## Summary

Ramp built an open-source MCP server that exposes its developer API to LLMs through tools and a SQL interface, enabling natural-language access to business spend data. Using FastMCP in Python and Claude Desktop, the prototype could run analyses, generate visualizations, and issue cards on demand, but pagination struggled beyond a few hundred transactions because of miscalculations, context limits, input sizes, and token use. The team replaced bulk responses with an in-memory ETL that flattens API JSON into SQLite, then exposes load, transformation, and query tools; an OLAP-powered API was added for reporting workloads that caused timeouts. This let Claude analyze tens of thousands of spend events with aggregate and window functions while reducing token usage, although API latency, occasional reliability problems, tool-selection errors, and security risks remain; audit logs, OAuth scopes, and constrained tools provide mitigations, while write actions await a safety framework.

## Context

The initial API-based prototype worked for a small demo business but encountered miscalculations, limited context windows, input-size limits, high token usage, and timeouts as the volume of spend data increased. The source also identifies reliability, API latency, tool-selection, and information-security risks.

## Approach / What changed

The implementation uses FastMCP in Python, a lightweight in-memory ETL, flattened API JSON, an in-memory SQLite database, and MCP tools for loading data, transforming it, and executing SQL queries. An OLAP-powered API supports reporting workloads, while audit logging, constrained OAuth scopes, and selected tools mitigate security risks.

## Takeaways

- Replacing paginated raw responses with SQL let Claude analyze tens of thousands of spend events and use aggregate or window functions while loading only the data needed in its context.
- The server flattens nested REST API JSON into SQLite rows, sets missing keys to NULL, and casts lists to text; its MCP tools separate API loading, processing, and query execution.
- Audit logging and constrained OAuth scopes and tools reduce MCP-related information-security risk, but occasional tool misuse and unreliable write actions remain, with a safety framework still planned.

**Tags:** [MCP](https://yomu.fyi/topic/mcp), [Python](https://yomu.fyi/topic/python), [SQL](https://yomu.fyi/topic/sql)

- Source: [Ramp](https://builders.ramp.com/post/ramp-mcp)
- Source URL: https://builders.ramp.com/post/ramp-mcp
- Ingested by Yomu: 2026-09-01T01:34:26.133Z

[Read original post](https://builders.ramp.com/post/ramp-mcp)
