W

World Bank MCP - 世界银行 MCP

searchfinanceresearch-and-data

1.4w 查看 · 2026-07-07 更新

世界银行MCP 🌐

npm version License: MIT GitHub issues

基于世界银行开放数据API的世界银行模型上下文协议服务,提供全球经济发展数据的查询功能。

📋 功能

  • ✅ 国家信息查询
  • ✅ 指标搜索(教育、健康、环境等)
  • ✅ 经济数据查询(GDP、通货膨胀、失业率等)
  • ✅ 社会发展数据查询(人口、预期寿命、互联网使用情况等)
  • ✅ 教育数据查询(识字率、入学率等)
  • ✅ 健康与营养数据查询(医院、免疫接种、HIV感染率、营养不良等)
  • ✅ 实时世界银行API集成
  • ✅ 模型上下文协议兼容性

📦 安装

使用npm全局安装

npm install -g worldbank-mcp

使用npx即时运行

npx worldbank-mcp

💻 在MCP客户端中的使用

要在支持MCP的客户端(如Claude Desktop、Cursor、Cherry Studio等)中使用此服务,您需要按如下方式配置:

配置示例:

如果已全局安装,请使用npm运行:

{ "mcpServers": { "worldbank-mcp": { "name": "World Bank Data", "command": "worldbank-mcp", "description": "World Bank Open Data MCP Server" } } }

使用npx即时运行:

{ "mcpServers": { "worldbank-mcp": { "name": "World Bank Data", "command": "npx", "args": ["worldbank-mcp"], "description": "World Bank Open Data MCP Server" } } }

直接使用node运行:

{ "mcpServers": { "worldbank-mcp": { "name": "World Bank Data", "command": "node", "args": ["path/to/worldbank-mcp/build/index.js"], "description": "World Bank Open Data MCP Server" } } }

path/to/替换为您的项目目录的实际路径。

📎 使用示例

🧑‍💻 用户

用表格比较中国和美国的经济

🤖 助手

我将帮助你用详细的表格比较中国和美国的经济。让我收集两国的综合经济数据。

世界银行数据 : 获取经济数据

中国与美国经济对比 (2010-2024)

根据世界银行的数据,以下是中美两国经济的详细对比表:

表1:GDP对比(万亿美元)
年份中国GDP美国GDP美国占中国的百分比中国增长率
202418.7429.18156%2.6%
202318.2727.72152%6.2%
202218.3226.01142%-2.5%
202118.2023.68130%9.2%
202014.9921.35142%-17.6%
201914.5621.54148%2.9%
201814.1520.66146%12.9%
201712.5419.61156%10.0%
201611.4618.80164%7.9%
201511.2818.29162%5.9%
201410.6717.61165%9.5%
20139.7416.88173%12.4%
20128.6716.25187%13.1%
20117.6715.60203%19.1%
20106.1915.05243%-

关键见解:

  • 美国经济仍然显著更大(2024年大56%)
  • 自2010年以来,中国的GDP增长了203%
  • 两国经济差距正在缩小
表2:人均GDP(美元)
表3:GDP增长率(%)
表4:通货膨胀率(%)
表5:失业率(%)
表6:出口占GDP的百分比
表7:外国直接投资净流入(十亿美元)
总结分析
经济规模与增长
  • 美国:经济规模更大,成熟增长(每年2-3%)
  • 中国:规模较小但增长更快(最近5-6%),正在追赶
发展水平
  • 美国:高收入发达国家(人均85,000美元)
  • 中国:上中等收入发展中国家(人均13,000美元)
经济稳定性
  • 中国:通胀和失业更稳定
  • 美国:波动较大,但在繁荣期实现更低的失业率
经济结构
  • 中国:出口导向型,以制造业为基础
  • 美国:消费导向型,以服务业为基础
投资流动> - 中国: 传统上的净资本输出国,最近吸引了更多的外国直接投资
  • 美国: 模式混合,在有利条件下吸引大量投资

这种比较突出了两个处于不同发展阶段的经济超级大国,每个国家都有其独特的优势、挑战和经济结构。

🔧 MCP 工具

1. 获取国家列表

{ "name": "get-countries", "description": "Get all countries supported by World Bank", "parameters": { "region": "Filter by region (optional)", "incomeLevel": "Filter by income level (optional)" } }

2. 获取国家信息

{ "name": "get-country-info", "description": "Get detailed information for a specific country", "parameters": { "countryCode": "Country code (e.g.: CN, US)" } }

3. 搜索指标

{ "name": "search-indicators", "description": "Search for available indicators", "parameters": { "keyword": "Search keyword" } }

4. 获取经济数据

{ "name": "get-economic-data", "description": "Get economic data for a country", "parameters": { "countryCode": "Country code", "indicator": "Economic indicator (GDP, GDP_GROWTH, GDP_PER_CAPITA, GNI, GNI_PER_CAPITA, EXPORTS_GDP, FDI_NET, INFLATION, UNEMPLOYMENT)", "years": "Number of years to query (optional, default 10 years)" } }

5. 获取社会发展数据

{ "name": "get-social-data", "description": "Get social development data for a country", "parameters": { "countryCode": "Country code", "indicator": "Social indicator (POPULATION, LIFE_EXPECTANCY, BIRTH_RATE, DEATH_RATE, INTERNET_USERS)", "years": "Number of years to query (optional, default 10 years)" } }

6. 获取教育数据

{ "name": "get-education-data", "description": "Get education data for a country", "parameters": { "countryCode": "Country code", "indicator": "Education indicator (LITERACY_RATE, SCHOOL_ENROLLMENT, SCHOOL_COMPLETION, TEACHERS_PRIMARY, EDUCATION_EXPENDITURE)", "years": "Number of years to query (optional, default 10 years)" } }

7. 获取健康与营养数据

{ "name": "get-health-data", "description": "Get health and nutrition data for a country", "parameters": { "countryCode": "Country code", "indicator": "Health indicator (HEALTH_EXPENDITURE, PHYSICIANS, HOSPITAL_BEDS, IMMUNIZATION, HIV_PREVALENCE, MALNUTRITION, TUBERCULOSIS)", "years": "Number of years to query (optional, default 10 years)" } }

📖 支持的指标

经济指标

指标代码描述单位
GDP国内生产总值当前美元
GDP_GROWTHGDP 增长率年度 %
GDP_PER_CAPITA人均GDP当前美元
GNI国民总收入当前美元
GNI_PER_CAPITA人均国民总收入当前美元
EXPORTS_GDP货物和服务出口占GDP的百分比
FDI_NET净流入的外国直接投资当前美元
INFLATION通货膨胀率年度 %
UNEMPLOYMENT失业率占总劳动力的百分比

社会指标

指标代码描述单位
POPULATION总人口
LIFE_EXPECTANCY出生时预期寿命
BIRTH_RATE出生率每千人
DEATH_RATE死亡率每千人
INTERNET_USERS互联网用户占总人口的百分比

教育指标

指标代码描述单位
LITERACY_RATE识字率占15岁及以上人口的百分比
SCHOOL_ENROLLMENT小学入学率毛入学率 %
SCHOOL_COMPLETION小学完成率相关年龄组的百分比
TEACHERS_PRIMARY小学教师人数数量
EDUCATION_EXPENDITURE政府教育支出占GDP的百分比

健康与营养指标

指标代码描述单位
HEALTH_EXPENDITURE当前卫生支出占GDP的百分比
PHYSICIANS医生数量每千人
HOSPITAL_BEDS医院床位数每千人
IMMUNIZATION麻疹免疫接种率占12-23个月儿童的百分比
HIV_PREVALENCE艾滋病患病率占15-49岁人口的百分比
MALNUTRITION营养不良发生率占总人口的百分比
TUBERCULOSIS结核病发病率每十万人

常见国家代码

国家代码国家代码
中国CN美国US
日本JP德国DE
英国GB法国FR
印度IN巴西BR
俄罗斯RU澳大利亚AU

项目结构

worldbank-mcp/ ├── src/ │ ├── index.ts # Main entry file │ └── types.ts # Type definitions ├── build/ # Compiled output ├── package.json # Project configuration ├── tsconfig.json # TypeScript configuration └── README.md # Documentation

技术栈

  • TypeScript - 类型安全的开发语言
  • Model Context Protocol SDK - MCP协议实现
  • Axios - HTTP客户端
  • Zod - 数据验证
  • Commander - 命令行工具

API端点

项目使用世界银行开放数据API:

  • 基础URL: https://api.worldbank.org/v2
  • 国家数据: /countries
  • 指标数据: /indicators
  • 国家指标数据: /country/{code}/indicator/{id}

许可证

该项目采用MIT许可证 - 详情请参阅LICENSE文件。

工具列表

  • get-countries: Get all countries supported by World Bank

  • get-country-info: Get detailed information for a specific country

  • search-indicators: Search for available indicators

  • get-economic-data: Get economic data for a country

  • get-social-data: Get social development data for a country

  • get-education-data: Get education data for a country

  • get-health-data: Get health and nutrition data for a country

服务配置

[{'mcpServers': {'worldbank-mcp': {'args': ['worldbank-mcp'], 'command': 'npx', 'description': 'World Bank Open Data MCP Server', 'name': 'World Bank Data'}}}]

来源