mcp-mx-economy
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-mx-economy What's today's FIX exchange rate and the latest inflation reading?"
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-mx-economy
An open-source Model Context Protocol (MCP) server that gives AI assistants access to Mexican economic indicators from Banco de México (Banxico) and INEGI. It turns official time-series APIs into typed, discoverable tools that an agent can use to answer questions with source dates and values.
Repository: github.com/JEHH97/mcp-mx-economy
npm:
npx -y mcp-mx-economy— the package is not published yet. This line will be updated after the firstnpm publish(see DEPLOY.md).
The problem
Economic context is often spread across separate government data portals. An assistant should be able to retrieve a current exchange rate, compare indicators, and explain the observation period without a person manually navigating multiple APIs. This server provides a small, auditable bridge to those public data sources and never invents missing observations.
Related MCP server: mcp-inegi
Architecture
flowchart LR
Agent[Claude Desktop / Cursor / OpenCode] <-->|MCP stdio or Streamable HTTP| Tools[Zod-validated MCP tools]
Tools --> Service[Economy service]
Service --> Cache[In-memory TTL cache]
Service --> Banxico[Banxico API client]
Service --> Inegi[INEGI API client]
Banxico --> Retry[Rate limiting and retry policy]
Inegi --> Retry
Retry --> BanxicoAPI[Banxico SIE API]
Retry --> InegiAPI[INEGI Indicators API]Stack
TypeScript, Node.js 20+, and the official
@modelcontextprotocol/sdkZod input and output contracts
Banxico SIE REST API and the INEGI Indicators API
Vitest, ESLint, Prettier, TypeScript, and tsup
GitHub Actions for repeatable quality checks
Tools
Tool | Purpose |
| Latest FIX exchange rate or a historical date range |
| Latest Banxico target interest rate |
| Latest INPC index plus computed monthly and year-over-year change |
| Latest UDIS value |
| Latest 28-day TIIE reference rate |
| Latest value or date range for a Banxico series identifier |
| Latest or historical observations for an INEGI indicator identifier |
| Latest observations for multiple Banxico and/or INEGI identifiers |
Built-in Banxico references are FIX (SF43718), target rate (SF61745), INPC (SP1), UDIS (SP68257), and TIIE 28-day (SF60648). The SIE API returns observations with N/E as unavailable; those are represented as null rather than a fabricated number. INEGI results retain the provider's observation period.
Technical decisions
Provider-specific clients behind a service layer: tool registration stays focused on MCP contracts; API details and calculations remain independently testable.
Small, in-memory cache: successful provider responses are cached for one minute to reduce redundant upstream requests. This is intentionally process-local and does not persist data.
Conservative outbound pacing and bounded retries: requests are serialized with a minimum interval, and transient network, throttling, and server failures use exponential backoff. Invalid requests and provider client errors are not retried.
Helpful, typed failures: missing tokens identify the exact environment variable; other tool failures return concise messages suitable for an assistant to relay.
No runtime framework for HTTP: the optional Streamable HTTP transport uses Node's built-in HTTP server, while stdio remains the default for desktop clients.
Fixture-driven tests: automated tests inject HTTP responses and use MCP's in-memory client/server transport; they do not call public services or use real credentials.
Quick start with npx
Requirements: Node.js 20 or newer. The package is intended to run through npx, so no clone is needed. Until the first npm release, use a local build (see Local development).
npx -y mcp-mx-economyWithout arguments the server speaks MCP over stdio, the default transport for desktop clients. It writes logs to stderr only, so stdout stays reserved for protocol messages.
Environment variables
Variable | Required | Purpose |
| For Banxico tools | Banxico SIE API token, sent in the |
| For INEGI tools | INEGI Indicators API token, placed in the documented endpoint path. |
| No (default | Set to |
| No (default | TCP port for the HTTP transport. Bound to |
A missing token does not stop the server: the affected tool returns a message that names the variable to set. Use placeholders in configuration files and keep real tokens in your local environment only.
Claude Desktop
Add the server to the mcpServers section of the Claude Desktop configuration file and replace the token placeholders:
{
"mcpServers": {
"mx-economy": {
"command": "npx",
"args": ["-y", "mcp-mx-economy"],
"env": {
"BANXICO_TOKEN": "your-banxico-token",
"INEGI_TOKEN": "your-inegi-token"
}
}
}
}Cursor
Add a project MCP entry in .cursor/mcp.json:
{
"mcpServers": {
"mx-economy": {
"command": "npx",
"args": ["-y", "mcp-mx-economy"],
"env": {
"BANXICO_TOKEN": "your-banxico-token",
"INEGI_TOKEN": "your-inegi-token"
}
}
}
}OpenCode
Register a local command in the OpenCode MCP configuration. The following illustrates the command and environment shape; adapt it to the configuration format in your installed OpenCode version:
{
"mcp": {
"mx-economy": {
"type": "local",
"command": ["npx", "-y", "mcp-mx-economy"],
"environment": {
"BANXICO_TOKEN": "your-banxico-token",
"INEGI_TOKEN": "your-inegi-token"
},
"enabled": true
}
}
}Example transcript
A simplified exchange with an assistant that has the server enabled. The values are illustrative, not live data:
User: What is the latest Banxico FIX exchange rate, and what date does it refer to?
Assistant: [calls mx_fix_rate]
-> seriesId: SF43718, source: Banxico, unit: MXN per USD
-> observations: [{ date: "2026-11-18", value: 18.42 }]
Assistant: The latest FIX rate is 18.42 MXN per USD, for the observation
dated 2026-11-18 (illustrative values).Transports and exposure
stdio (default): used by Claude Desktop, Cursor, and OpenCode. No port is opened.
Streamable HTTP (optional, local only):
MCP_TRANSPORT=http MCP_HTTP_PORT=3333exposeshttp://127.0.0.1:3333/mcp. It binds to loopback and has no authentication. Do not expose it to a network, reverse proxy, or tunnel unless you add suitable authentication and network controls.
Local development
Requirements: Node.js 20 or newer and npm. Node-toolchain commands are run through scripts/in-dev in this repository.
git clone https://github.com/JEHH97/mcp-mx-economy.git
cd mcp-mx-economy
npm ci
cp .env.example .env
# Edit .env and add your personal provider tokens.
npm run build
node dist/index.jsTo point a desktop client at a local build instead of npm, replace "npx", "-y", "mcp-mx-economy" with "node", "/absolute/path/to/mcp-mx-economy/dist/index.js".
Get free API tokens
Banxico: request a SIE API token at Banxico SIE API token page. Requests use the
Bmx-TokenHTTP header.INEGI: register for an API token from the INEGI Indicators API page. The token is part of the documented indicator endpoint path.
Provider references: Banxico SIE API documentation and INEGI Indicators API documentation.
Example questions
“What is the latest Banxico FIX exchange rate, and what date does it refer to?”
“Show me the FIX exchange rate from the first day of last month through today.”
“What is the latest monthly INPC reading, and how did it change versus the previous month and the same month last year?”
“Compare the latest target rate, TIIE 28-day, and UDIS observations.”
“Fetch the latest national reading for my INEGI unemployment indicator ID.”
“Compare these Banxico series IDs and tell me their observation periods.”
Tests and quality
All checks run through one command:
npm run checkIt runs ESLint, Prettier validation, TypeScript typechecking, Vitest with domain-logic coverage thresholds, a production build, a stdio smoke test of the built binary (direct and through a symlink, as npm exposes it), and the forbidden-content scan. Tests use recorded fixture payloads, injected mock HTTP, and an in-memory MCP protocol client; they do not need tokens or network access.
License
MIT. See LICENSE.
Available Tools
8 toolsmx_banxico_seriesBanxico time seriesC
Query any single Banxico SIE series by identifier, optionally over a date range.
Inputs: seriesId (required), endDate, startDate. Returns: unit, title, source, seriesId, +1 more
mx_compare_indicatorsCompare Mexican indicatorsB
Fetch latest observations for several Banxico series and/or INEGI indicators.
Inputs: banxicoSeriesIds, inegiIndicatorIds. Returns: indicators
mx_fix_rateMexican peso FIX exchange rateA
Get the latest Banxico FIX exchange rate or a historical date range.
Inputs: endDate, startDate. Returns: unit, title, source, seriesId, +1 more
mx_inegi_indicatorINEGI indicatorC
Query a public INEGI indicator by identifier. The default geography is national.
Inputs: indicatorId (required), latest, geography. Returns: unit, title, source, seriesId, +1 more
mx_inflationMexican inflationA
Get the latest INPC index and compute monthly and annual percentage changes.
Inputs: no named parameters. Returns: title, latest, source, seriesId, +2 more
mx_target_rateBanxico target rateA
Get the latest Mexican central bank target interest rate.
Inputs: no named parameters. Returns: unit, title, source, seriesId, +1 more
mx_tiie_28dTIIE 28-day rateA
Get the latest Banxico TIIE 28-day reference rate.
Inputs: no named parameters. Returns: unit, title, source, seriesId, +1 more
mx_udisUDIS valueA
Get the latest value of the Mexican UDIS unit of account.
Inputs: no named parameters. Returns: unit, title, source, seriesId, +1 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Five tools are narrow convenience wrappers for specific indicators (FIX rate, target rate, INPC, UDIS, TIIE), while mx_banxico_series is a generic series query that can return the same data given an ID. The overlap is real but the boundary is legible: fixed, ready-made answers versus arbitrary series by identifier, with mx_compare_indicators as the batch path. An agent can choose correctly, though it may hesitate between mx_banxico_series and a specific indicator tool.
Every tool shares the mx_ prefix and snake_case, giving a clean, predictable namespace. Names are resource-oriented nouns (mx_fix_rate, mx_udis) with two exceptions (mx_compare_indicators, mx_banxico_series) that are verb/source oriented, a minor deviation in an otherwise tight convention.
Eight tools is a well-scoped set for a central-bank/statistics data server: a handful of high-traffic indicators plus two generic escape hatches and one batch helper. No tool looks redundant enough to remove, and nothing feels padded.
Core Mexican macro indicators and generic Banxico/INEGI query paths are covered, but there is no tool to search or resolve series or indicator IDs, so an agent must already know magic identifiers for the generic tools. Historical ranges are also only exposed on mx_fix_rate and the generic series tools, making the specific-indicator tools latest-only dead ends for time-series needs.
Maintenance
Related MCP Connectors
Banxico MCP — Banco de México (Mexico's central bank) via the SIE API.
Mexico's official economic data from Banxico: USD/MXN, inflation, UDIS, TIIE and reserves.
Macroeconomic and FX time-series data for AI agents: indicators, calendars, COT, forex, commodities.
Official Mexican data for AI agents: CURP, RFC, CFDI, postal codes, phone, SPEI/CEP, DOF, geocoding.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables access to Bank of Mexico (Banxico) economic data including real-time and historical USD/MXN exchange rates, inflation data, interest rates, and other financial indicators. Supports querying current rates, historical data with date ranges, and economic metadata through natural language.9MIT
- AlicenseNot gradedqualityCmaintenanceProvides access to Mexico's INEGI (national statistics office) indicators API, enabling AI agents to query statistical data through natural language or direct tool calls.88 npmMIT
- AlicenseAqualityBmaintenanceEnables AI assistants and agents to query official Mexican economic data from Banxico, including USD/MXN exchange rates, inflation (INPC), UDIS, and interest rates.66MIT
- AlicenseBqualityCmaintenanceEnables querying Mexico's central bank macroeconomic indicators — policy rate, TIIE 28/91, Cetes 28, and UDIS values — plus UDI-to-peso conversion and inflation variation calculations over date ranges. Use-case-oriented tools batch series requests, cache results, and tolerate asynchronous publication quirks to stay within official API quotas.17MIT