# MCP Server

### 概述

Infoway MCP Server 是基于 [Model Context Protocol](https://modelcontextprotocol.io/) 的金融数据服务器，让 Claude Desktop、Cursor 等 AI 助手可以直接在对话中查询实时金融数据。

| 项目        | 说明                                                                                  |
| --------- | ----------------------------------------------------------------------------------- |
| PyPI      | [`infoway-mcp-server`](https://pypi.org/project/infoway-mcp-server/)                |
| ClawHub   | [`infoway-financial-data`](https://clawhub.ai/infoway-api/infoway-financial-data)   |
| Python 版本 | 3.10+                                                                               |
| 传输方式      | stdio                                                                               |
| 工具数量      | 17 个                                                                                |
| GitHub    | [infoway-api/infoway-mcp-server](https://github.com/infoway-api/infoway-mcp-server) |

### 功能特点

* **17 个金融数据工具**，涵盖实时行情、K线图、市场概览、板块分析和个股基本面
* **多市场支持**：美股、港股、A股、新加坡、日本、印度 + 加密货币 + 外汇
* **零配置**：只需添加 API Key 即可开始使用
* 支持 Claude Desktop、Cursor 及所有兼容 MCP 协议的客户端

### 安装

```bash
# 使用 uvx（推荐）
uvx infoway-mcp-server

# 使用 pip
pip install infoway-mcp-server
```

### 配置

#### Claude Desktop

将以下内容添加到 Claude Desktop 配置文件：

* macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
* Windows: `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "infoway": {
      "command": "uvx",
      "args": ["infoway-mcp-server"],
      "env": {
        "INFOWAY_API_KEY": "你的API密钥"
      }
    }
  }
}
```

#### Cursor

添加到 Cursor MCP 配置文件（`.cursor/mcp.json`）：

```json
{
  "mcpServers": {
    "infoway": {
      "command": "uvx",
      "args": ["infoway-mcp-server"],
      "env": {
        "INFOWAY_API_KEY": "你的API密钥"
      }
    }
  }
}
```

#### Claude Code

添加到 Claude Code 配置文件（`.claude/settings.json`）：

```json
{
  "mcpServers": {
    "infoway": {
      "command": "uvx",
      "args": ["infoway-mcp-server"],
      "env": {
        "INFOWAY_API_KEY": "你的API密钥"
      }
    }
  }
}
```

### 工具列表

#### 实时行情（3个）

| 工具名                  | 说明                              |
| -------------------- | ------------------------------- |
| `get_realtime_trade` | 获取股票、加密货币、外汇的实时成交数据（价格、成交量、涨跌幅） |
| `get_market_depth`   | 获取标的买卖盘口深度数据                    |
| `get_kline`          | 获取K线（OHLCV）蜡烛图数据，支持1分钟到年线共12种周期 |

#### 市场概览（4个）

| 工具名                      | 说明                                 |
| ------------------------ | ---------------------------------- |
| `get_market_temperature` | 获取市场温度/情绪指标（0-100）                 |
| `get_market_breadth`     | 获取市场涨跌家数分布统计                       |
| `get_global_indexes`     | 获取全球主要股指实时数据（道琼斯、标普500、纳斯达克、恒生指数等） |
| `get_leading_industries` | 获取当日领涨行业板块排名                       |

#### 板块分析（4个）

| 工具名                 | 说明                        |
| ------------------- | ------------------------- |
| `get_industry_list` | 获取行业板块完整列表及涨跌数据           |
| `get_concept_list`  | 获取概念/主题板块列表（AI、新能源车、元宇宙等） |
| `get_plate_members` | 获取指定板块内的所有成分股             |
| `get_plate_heatmap` | 获取板块热力图数据，用于可视化展示         |

#### 个股基本面（5个）

| 工具名                    | 说明                            |
| ---------------------- | ----------------------------- |
| `get_company_overview` | 获取公司简介、高管、总部等基本信息             |
| `get_stock_valuation`  | 获取估值指标：PE、PB、EV/EBITDA、股息率、市值 |
| `get_stock_ratings`    | 获取分析师评级：买入/卖出/持有家数、目标价        |
| `get_stock_panorama`   | 获取个股全景数据概览                    |
| `get_stock_drivers`    | 获取影响股价的关键驱动因素分析               |

#### 工具类（1个）

| 工具名              | 说明                 |
| ---------------- | ------------------ |
| `search_symbols` | 搜索和查询可用交易品种，可按市场过滤 |

### 支持的标的格式

| 市场    | 格式        | 示例          |
| ----- | --------- | ----------- |
| 美股    | `{代码}.US` | `AAPL.US`   |
| 港股    | `{代码}.HK` | `700.HK`    |
| A股上交所 | `{代码}.SH` | `600519.SH` |
| A股深交所 | `{代码}.SZ` | `000001.SZ` |
| 加密货币  | `{交易对}`   | `BTCUSDT`   |
| 外汇    | `{货币对}`   | `USDJPY`    |

### 对话示例

> **"苹果和特斯拉现在什么价格？"** Claude 会调用 `get_realtime_trade`，标的 `AAPL.US,TSLA.US`

> **"看一下比特币最近30天的日K线"** Claude 会调用 `get_kline`，标的 `BTCUSDT`，market\_type `crypto`

> **"今天美股表现怎么样？哪些板块领涨？"** Claude 会调用 `get_market_temperature` 和 `get_leading_industries`

> **"帮我全面分析一下腾讯"** Claude 会组合调用 `get_company_overview`、`get_stock_valuation`、`get_stock_ratings`、`get_stock_drivers`

> **"对比一下英伟达和 AMD 的估值"** Claude 会分别调用 `get_stock_valuation` 查询 `NVDA.US` 和 `AMD.US`

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.infoway.io/sdk-and-tools/mcp-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
