内容
[](README.md)
[](README_es.md)
# INE-MCP. MCP 与 INE API 集成
**INE 是西班牙国家统计局。**
**INE-mcp** 允许使用 **Model Context Protocol (MCP)** 直接从 Claude AI 和其他兼容的 MCP 客户端访问西班牙官方统计数据。
INE-mcp 是一个 MCP server,它公开了一些工具,供 LLM 查询 INE 的经济、人口和社会指标。
## 主要特性
- **经济指标** 查询(GDP、CPI、失业率等)
- 访问**人口数据**(人口普查、移民、出生率)
- 统计数据的历史时间序列
- 官方统计业务的元数据
- 按地区、时期和特定变量进行筛选
- JSON 格式的结构化响应
## 安装
### 从 uv 安装
### 前提条件
- Python 3.10 或更高版本
- [uv](https://docs.astral.sh/uv/getting-started/installation/) 包管理器
### uv 安装
首先安装 `uv`,一个 Python 包管理器。
**从终端安装:**
对于 Mac 和 Linux:
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```
对于 Windows:
```bash
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```
或者使用 pip 安装:
```bash
pip install uv
```
有关 **uv** 安装的更多详细信息,请参阅 [官方文档](https://docs.astral.sh/uv/getting-started/installation/)。
## 与 Claude 等桌面客户端集成
安装 **uv** 后,您可以按照以下步骤从任何兼容的客户端(如 Claude Desktop)使用 MCP server:
1. 转到 **Claude > Settings > Developer > Edit Config > `claude_desktop_config.json`**
2. 在 `"mcpServers"` 下添加此代码块:
```json
"ine_mcp": {
"command": "uvx",
"args": [
"ine_mcp"
]
}
```
3. 查阅 INE 的官方文档:<https://www.ine.es/dyngs/DAB/index.htm?cid=1099>
4. 如果您配置了其他 MCP server,请用逗号 `,` 分隔它们。
要与其他 MCP 兼容的客户端(如 Cursor、CODEGPT 或 Roo Code)集成,只需将相同的代码块添加到客户端的 MCP server 配置中即可。
## 使用示例
正确配置后,您可以提出如下问题:
```
- "What data from Spain's INE can you access?"
- "Find data from the Active Population Survey (EPA)"
- "Show me price indices for steel products during Q1 2023"
```