Metadata-Version: 2.4
Name: fxbaogao-mcp
Version: 1.0.1
Summary: 发现报告是专业研报搜索平台。全面覆盖行业分析、公司研究、宏观策略、财报、招股书等研究报告的相关搜索和阅读。
Requires-Python: >=3.11
Requires-Dist: bs4>=0.0.2
Requires-Dist: httpx[socks]>=0.28.1
Requires-Dist: mcp[cli]>=1.10.1
Requires-Dist: twine>=6.1.0
Description-Content-Type: text/markdown

# 发现报告 MCP

这是发现报告（fxbaogao.com）的 MCP 接入项目，提供研究报告搜索、命中段落获取、PDF 下载地址获取和本地 PDF 下载能力。

本仓库是本地版 MCP Server，适合在本机通过 `stdio` 方式运行。发现报告也提供在线 HTTP 版 MCP，可直接添加到 Claude 等支持远程 MCP 的客户端。

## 在线 HTTP 版

如果只需要使用在线版，不需要安装本仓库。直接添加远程 MCP：

```bash
claude mcp add --transport http fxbaogao --scope user https://api.fxbaogao.com/mcp/ \
  --header "Authorization: Bearer sk-xxx"
```

把 `sk-xxx` 替换为你的发现报告 API Key。

## 本地版

本地版通过环境变量读取 API Key，然后由本机 MCP Server 调用发现报告接口。

```bash
export FXBAOGAO_API_KEY=<your_api_key>
```

使用 `uvx` 启动：

```json
{
  "mcpServers": {
    "fxbaogao-mcp": {
      "command": "uvx",
      "args": ["fxbaogao-mcp@latest"],
      "env": {
        "FXBAOGAO_API_KEY": "<your_api_key>"
      }
    }
  }
}
```

本地开发时也可以从源码运行：

```bash
export FXBAOGAO_API_KEY=<your_api_key>
.venv/bin/python -m fxbaogao_mcp
```

## 可选配置

| 环境变量 | 默认值 | 说明 |
| --- | --- | --- |
| `FXBAOGAO_API_KEY` | 无 | 必填，发现报告 API Key |
| `FXBAOGAO_API_BASE_URL` | `https://api.fxbaogao.com` | API Base URL |
| `FXBAOGAO_PDF_BASE_URL` | `https://dr.fxbaogao.com/` | 相对 PDF 路径的补全域名 |
| `FXBAOGAO_WORKSPACE` | 当前工作目录 | `download_pdf` 的本地下载根目录 |
| `HTTP_TIMEOUT` | `60.0` | API 请求超时时间，单位秒 |
| `DOWNLOAD_TIMEOUT` | `120.0` | PDF 下载超时时间，单位秒 |

## 工具

### `search_reports`

搜索研究报告。

主要参数：

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `keywords` | string | 搜索关键词，关键词和机构至少提供一个 |
| `org_names` / `orgNames` | string[] | 机构名称列表 |
| `start_time` / `startTime` / `time` | string / int | 开始时间，支持毫秒时间戳字符串，也支持 `last3day`、`last7day`、`last1mon`、`last3mon`、`last1year` |
| `end_time` / `endTime` | string / int | 结束时间，毫秒时间戳 |

返回结果中会补充官网阅读链接：

```text
https://www.fxbaogao.com/view?id=<reportId>
```

### `get_paragraphs`

根据报告 ID 和关键词获取摘要与命中正文段落。

主要参数：

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `report_id` / `reportId` / `doc_id` / `id` | integer | 报告 ID |
| `keyword` | string | 用于命中上下文的关键词 |

### `get_report_content`

兼容旧工具名，内部调用 `get_paragraphs`。


### `get_pdf_url`

根据报告 ID 获取 PDF 下载地址。

主要参数：

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `report_id` / `reportId` / `doc_id` / `id` | integer | 报告 ID |

### `download_pdf`

根据报告 ID 下载 PDF 到本地工作区。

主要参数：

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `report_id` / `reportId` / `doc_id` / `id` | integer | 报告 ID |
| `output_dir` | string | 相对 `FXBAOGAO_WORKSPACE` 的输出目录，默认 `intermediate/downloads` |
| `filename` | string | 保存文件名，默认 `<reportId>.pdf` |
| `overwrite` | boolean | 文件存在时是否覆盖 |

## 接口来源

当前本地版调用以下发现报告 API：

| 能力 | 接口 |
| --- | --- |
| 搜索报告 | `POST /mofoun/agent/search` |
| 获取段落 | `POST /mofoun/agent/paragraph` |
| 获取 PDF | `GET /mofoun/agent/download?reportId=<reportId>` |

## 注意事项

本工具仅供学习和研究使用，请遵守发现报告的使用条款和相关法律法规。
