upbit mcp
为AI编码代理提供Upbit开发者文档的MCP服务器
Upbit开发者中心 自动收集API文档,并提供AI可搜索的 模型上下文协议(MCP) 服务器。
主要功能
- 自动收集Upbit开发者中心API文档(91个文档)
- 基于标记头的智能窃听(H1→H2→H3递归分割)
- 二级关键字搜索(正确匹配优先,部分匹配回退)
- 使用SHA256基于哈希的高速缓存快速重新启动
- 异步并行收集(同时8个请求)
快速入门
必备条件
- Python 3.11+
- 紫外线 (使用uvx时)
克劳德代码
~/.claude/settings.json的 mcpServers添加到:
{
"upbit-docs": {
"command": "uvx",
"args": ["--from", "git+https://github.com/chabinhwang/upbit-mcp@main", "upbit-mcp"]
}
}法典
~/.codex/config.toml的 mcp_servers添加到:
[mcp_servers.upbit-docs]
command = "uvx"
args = ["--from", "git+https://github.com/chabinhwang/upbit-mcp@main", "upbit-mcp"]双子星命令行工具
~/.gemini/settings.json的 mcpServers添加到:
{
"mcpServers": {
"upbit-docs": {
"command": "uvx",
"args": ["--from", "git+https://github.com/chabinhwang/upbit-mcp@main", "upbit-mcp"]
}
}
}克劳德桌面版
claude_desktop_config.json添加到:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"upbit-docs": {
"command": "uvx",
"args": ["--from", "git+https://github.com/chabinhwang/upbit-mcp@main", "upbit-mcp"]
}
}
}Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"upbit-docs": {
"command": "uvx",
"args": ["--from", "git+https://github.com/chabinhwang/upbit-mcp@main", "upbit-mcp"]
}
}
}本地安装(用于开发)
git clone https://github.com/chabinhwang/upbit-mcp.git
cd upbit-mcp
python3 -m venv .venv
.venv/bin/pip install -e .{
"upbit-docs": {
"command": "/absolute/path/to/upbit-mcp/.venv/bin/upbit-mcp"
}
}交付工具
search_docs
使用关键字搜索Upbit开发者文档。
검색어: "주문 API 매수"参数类型必需说明 |----------|------|------|------| | query 搜索词(空格分隔的关键字) | source 源过滤器。 "upbit" |
sync_sources
手动同步文档。需要最新文档时使用。
参数类型必需说明 |----------|------|------|------| | force |布尔值|X| true忽略双面缓存后强制重新收集|
动作方式
llms.txt 다운로드
↓
마크다운 링크 파싱 (91개 문서 URL 추출)
↓
하위 페이지 병렬 수집 (동시 8개)
↓
마크다운 헤더 기반 청킹 (최대 3,000자)
↓
로컬 캐시 저장 (~/.upbit-mcp-cache/)
↓
키워드 검색 제공- 缓存:启动时比较每个源的ETag以确认是否有更改,如果没有更改,请立即从缓存中加载。仅当检测到更改时,才会进行完全重新收集。
- 重新同步:
sync_sources(force=True)只需在调用或删除缓存目录后重新启动即可。
性能基准
基于2026-03-13,为了与当前本地运行的MCP分离,每次运行都是临时的 HOME使用隔离缓存后进行了实测。
- 执行路径:与实际服务器启动时间相同
lifespan标准_init_chunks()测量到 - 重复次数:每个场景10次
- 场景A:
full_recollect_boot
启动时没有缓存 llms.txt和重新收集所有子文档
- 场景B:
etag_compare_boot
从同一个临时缓存接收一次后重新启动,只比较ETag,如果没有更改,则使用缓存,无需重新下载
- 注意:
etag_compare_boot实际上,所有10/10次都使用了“无更改,使用缓存”路径。
| 方案 | 平均值 | 中值 | 最小值 | 最大值 |
|---|---|---|---|---|
full_recollect_boot | 8.297秒 | 5.873秒 | 5.573秒 | 24.104秒 |
etag_compare_boot | 0.380秒 | 0.361秒 | 0.319秒 | 0.509秒 |
- 平均标准差:
7.917s - 基于中间值的差异:
5.512s - 按平均标准
etag_compare_boot假药21.8배快速 - 解释:Upbit MCP也比完全重新收集更快,如果像现在的代码一样在ETag比较后没有更改,则使用缓存的引导路径会更快。
项目结构
upbit-mcp/
├── pyproject.toml
├── README.md
├── LICENSE
└── upbit_mcp/
├── __init__.py
├── main.py # MCP 서버 엔트리포인트
├── collector.py # 문서 수집 (httpx 비동기)
├── chunker.py # 마크다운 청킹
├── searcher.py # 키워드 검색
└── cache.py # JSON 캐시 + 해시 관리许可证
MIT许可证
