home / mcp / banxico mcp server
MCP server to query Banxico SIE API for USD/MXN rates, historical data, and indicators
Configuration
View docs{
"mcpServers": {
"cfocoder-banxico_mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/cfocoder/banxico_mcp",
"banxico-mcp-server"
],
"env": {
"BANXICO_API_TOKEN": "your_token_here"
}
}
}
}You can run a Banxico MCP Server to access Banxico SIE API data, including real-time USD/MXN rates, historical data, and various economic indicators. This MCP server enables convenient data retrieval through MCP clients and supports automated updates or local execution with your API token.
Configure your MCP client to connect to the Banxico MCP Server using one of the provided runtime methods. Once configured, you can request current exchange rates, historical data within a date range, and metadata about the data series. Use natural language prompts such as “What is the current USD to MXN rate?”, “Show USD/MXN data for the last 7 days,” or “Get the metadata for the USD/MXN series” to obtain the corresponding data.
Prerequisites you need before installing the server are:
- Python 3.10+ installed on your system
- uvx (recommended) or uv package manager
- Banxico API Token for authentication with the SIE API."banxico": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/cfocoder/banxico_mcp",
"banxico-mcp-server"
],
"env": {
"BANXICO_API_TOKEN": "your_token_here"
}
}You have a second runtime option that runs the server via an explicit Python path and a fast MCP provider. This method uses uvx with Python and a local path to the server script.
"banxico": {
"command": "uvx",
"args": [
"--python", "3.12",
"--from", "fastmcp",
"--with", "httpx",
"--",
"python",
"/absolute/path/to/banxico_mcp_server.py"
],
"env": {
"BANXICO_API_TOKEN": "your_token_here"
}
}If you prefer to run the server directly without an MCP client wrapper, you can start the server with the Python interpreter and your token set in the environment.
export BANXICO_API_TOKEN=your_token_here
python banxico_mcp_server.pyObtain your Banxico API token by registering for access to the SIE API and following the token issuance steps. Keep this token secure and supply it to clients via the BANXICO_API_TOKEN environment variable in your MCP client configuration.
Common issues you might encounter include missing or invalid API tokens, network connectivity problems, or startup errors related to Python versions or dependencies. Ensure you have Python 3.10+ installed, the required dependencies available (uvx or uv, httpx for certain configurations), and that the Banxico API is reachable.
# Enable debug logging if you need more details
BANXICO_API_TOKEN=your_token PYTHONPATH=. python -c "\nimport logging\nlogging.basicConfig(level=logging.DEBUG)\nfrom banxico_mcp_server import mcp\nmcp.run()\n"Fetches the most recent USD/MXN exchange rate from Banxico.
Retrieves historical USD/MXN rate data with an optional limit on the number of points.
Returns metadata for a specific Banxico data series by ID.
Retrieves data for a defined date range for a given series.
Fetches monthly, accumulated, or annual inflation data depending on type.
Gets UDIS values across a selectable data window.
Provides CETES 28-day rate data.
Returns data on Banxico reserve assets.
Fetches unemployment data over a specified period.