- Home
- MCP servers
- Banxico
Banxico
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
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.
How to use
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.
How to install
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"
}
}
Additional setup and options
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"
}
}
Running directly (no MCP client proxy)
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.py
Configuration and tokens
Obtain 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.
Troubleshooting
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"
Available tools
get_latest_usd_mxn_rate
Fetches the most recent USD/MXN exchange rate from Banxico.
get_usd_mxn_historical_data
Retrieves historical USD/MXN rate data with an optional limit on the number of points.
get_series_metadata
Returns metadata for a specific Banxico data series by ID.
get_date_range_data
Retrieves data for a defined date range for a given series.
get_inflation_data
Fetches monthly, accumulated, or annual inflation data depending on type.
get_udis_data
Gets UDIS values across a selectable data window.
get_cetes_28_data
Provides CETES 28-day rate data.
get_banxico_reserves_data
Returns data on Banxico reserve assets.
get_unemployment_data
Fetches unemployment data over a specified period.