imf-mcp-server
Click on "Install 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., "@imf-mcp-serverget real GDP growth for USA from 2020 to 2024"
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.
Public Hosted Server: https://imf.caseyjhand.com/mcp
Tools
Five tools covering the full IMF SDMX 3.0 query workflow, plus a DuckDB-backed canvas layer for SQL analytics over large multi-country result sets:
Tool | Description |
| List all IMF SDMX dataflows available on the portal, with optional name/ID substring filtering |
| Fetch a dataflow's dimension list and complete codelist — resolves human terms to SDMX codes before querying |
| Query a dataflow by dimension key over a time range; large result sets spill to DataCanvas |
| List DataCanvas tables and columns staged by a prior |
| Run a read-only SQL SELECT across staged DataCanvas tables for multi-country comparisons and aggregations |
imf_list_databases
Entry point for every IMF query workflow — browse and filter the full dataflow catalog.
Hundreds of dataflows covering WEO projections, balance of payments, CPI, exchange rates, money/finance statistics, and national accounts
Vintage (historical snapshot) dataflows excluded by default; set
include_vintages=trueto include themCase-insensitive substring filter across ID, name, and description
imf_get_database
Resolve human-readable terms to SDMX dimension codes before querying.
Returns all dimension IDs, positions, and their complete codelists (e.g.
"United States"→USA,"real GDP growth"→NGDP_RPCH)Country codes are ISO 3-letter (USA, GBR, DEU — not US, GB, DE)
key_formatfield shows the exact dot-separated dimension order required byimf_query_datasetCodelists truncated at 50 entries inline; use
codelist_filterto search large codelists by substring (returns all matches, uncapped), or theimf://database/{dataflow_id}resource for the full list
imf_query_dataset
Query an IMF SDMX dataflow by dimension key over a time range.
Dot-separated key in DSD keyPosition order (e.g.
USA.NGDP_RPCH.Afor WEO annual real GDP growth)+syntax for multi-code positions (e.g.USA+GBR+DEU.NGDP_RPCH.A)Returns observations with
time_period,value,status, and series attributes (unit,scale,decimals)Large multi-country or long time-range queries automatically spill to DataCanvas —
canvas_idandtable_nameare returned for SQL follow-upno_dataerrors include availability context from the upstream constraint endpoint:series_count=0means the code has no coverage in the dataflow;series_count>0means the combination is wrong andavailable_codeslists what does have data
imf_dataframe_describe / imf_dataframe_query
In-conversation SQL analytics over the observation tables that imf_query_dataset stages on a DuckDB-backed canvas.
When imf_query_dataset returns truncated: true, the full dataset is registered as a named table on the canvas. The workflow:
Call
imf_query_dataset— iftruncated: true, note thecanvas_idandtable_nameCall
imf_dataframe_describewith thecanvas_idto discover table schemaCall
imf_dataframe_querywith a SELECT statement for aggregations, cross-country comparisons, or time-series analysis
Only SELECT statements are accepted — DML and DDL are rejected. Requires CANVAS_PROVIDER_TYPE=duckdb.
Related MCP server: cnbs-mcp-server
Resource
Type | URI | Description |
Resource |
| Full metadata for a single IMF SDMX dataflow — all dimensions with complete codelists, |
All resource data is also reachable via imf_get_database. The resource URI provides the untruncated codelist for large dimensions that imf_get_database caps at 50 entries. The codelist_filter parameter on imf_get_database is a lighter alternative for targeted code lookup — it returns all substring matches without the cap.
Data source
Data is sourced from the International Monetary Fund SDMX 3.0 portal under the IMF Copyright and Terms of Use. The IMF's terms permit redistribution of statistical data with attribution. Each data-returning tool response includes a source field with the required attribution: Source: International Monetary Fund, <dataflow name>, https://data.imf.org/.
Features
Built on @cyanheads/mcp-ts-core:
Declarative tool, resource, and prompt definitions — single file per primitive, framework handles registration and validation
Unified error handling — handlers throw, framework catches, classifies, and formats
Pluggable auth:
none,jwt,oauthSwappable storage backends:
in-memory,filesystem,Supabase,Cloudflare KV/R2/D1Structured logging with optional OpenTelemetry tracing
STDIO and Streamable HTTP transports
IMF SDMX-specific:
Keyless access — no API key required; the IMF SDMX 3.0 portal is fully public
Type-safe SDMX 3.0 compact JSON client with dimension/codelist parsing and DSD validation
Key dimension count validated against the DSD before each query to catch format mismatches early
Dataflow catalog cached in-session to minimize round trips on multi-step workflows
DuckDB-backed DataCanvas spill for large multi-country or long time-range observations
Agent-friendly output:
Codelist entries carry both the machine code and human-readable label — agents can present meaningful names without a follow-up lookup
key_formatfield in every dataflow response explicitly states the dimension order, removing guesswork for key constructionObservations include
statusflags (e.g.Efor estimate) so agents can communicate data quality caveatsCanvas spill is transparent —
truncated,canvas_id, andtable_nameare always present in the output schema, letting callers branch on data rather than heuristics
Getting started
Public Hosted Instance
A public instance is available at https://imf.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
{
"mcpServers": {
"imf-mcp-server": {
"type": "streamable-http",
"url": "https://imf.caseyjhand.com/mcp"
}
}
}Self-Hosted / Local
No API key required. Add the following to your MCP client configuration file.
{
"mcpServers": {
"imf-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/imf-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with npx (no Bun required):
{
"mcpServers": {
"imf-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/imf-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with Docker:
{
"mcpServers": {
"imf-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"ghcr.io/cyanheads/imf-mcp-server:latest"
]
}
}
}To enable SQL analytics over large result sets, add CANVAS_PROVIDER_TYPE=duckdb to the env block.
For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcpPrerequisites
Bun v1.3.0 or higher (or Node.js v24+).
No API key required.
Installation
Clone the repository:
git clone https://github.com/cyanheads/imf-mcp-server.gitNavigate into the directory:
cd imf-mcp-serverInstall dependencies:
bun installConfigure environment:
cp .env.example .env
# edit .env as needed — no required vars for basic useConfiguration
Variable | Description | Default |
| Set to | — |
| IMF SDMX 3.0 base URL. Override for testing or proxied environments. |
|
| Per-request timeout in milliseconds. |
|
| Transport: |
|
| Port for HTTP server. |
|
| Auth mode: |
|
| Log level (RFC 5424). |
|
| Enable OpenTelemetry instrumentation. |
|
See .env.example for the full list of optional overrides.
Running the server
Local development
Build and run:
bun run rebuild bun run start:stdio # or bun run start:httpRun checks and tests:
bun run devcheck # Lint, format, typecheck, security bun run test # Vitest test suite bun run lint:mcp # Validate MCP definitions against spec
Docker
docker build -t imf-mcp-server .
docker run --rm -p 3010:3010 imf-mcp-serverThe Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/imf-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
Path | Purpose |
|
|
| Server-specific env var parsing and validation with Zod. |
| Tool definitions ( |
| Resource definitions ( |
| DataCanvas accessor — wraps the framework canvas instance. |
| IMF SDMX 3.0 API client — dataflow catalog, DSD fetching, data queries. |
| Unit and integration tests mirroring |
| Design notes and directory tree. |
Development guide
See CLAUDE.md/AGENTS.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storageRegister new tools and resources via the barrels in
src/mcp-server/*/definitions/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues and pull requests are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
Apache-2.0 — see LICENSE for details.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceThe server integrates with the free IMF data API and provides various features to facilitate data retrieval and analysis. The server is built using the FastMCP framework and offers the following functionalities:Last updated1012Apache 2.0
- Alicense-qualityCmaintenanceEnables querying statistical data from China NBS, World Bank, IMF, OECD, BIS, census, and department statistics via MCP tools.Last updatedApache 2.0
- Alicense-qualityBmaintenance24 MCP tools for SEC financials, FRED economics, US Census demographics, and World Bank data via Streamable HTTP.Last updatedMIT
- Alicense-qualityAmaintenanceEnables querying 29,500+ World Bank development indicators for 200+ countries across 60+ years via MCP, with 7 tools for browsing topics, sources, countries, and indicators.Last updated972Apache 2.0
Related MCP Connectors
World Bank Data360 MCP — the World Bank's modern unified data platform.
Macro indicators from World Bank, FRED, IMF, and OECD via unified query surface.
World Bank MCP — wraps the World Bank Data API v2 (free, no auth)
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyanheads/imf-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server