AdaTile-MCP
AdaTile-MCP v1.0
高分辨率图像自适应切分预处理层(MCP),目标模型 DeepSeek deepseek-v4-flash-vision-exp。
按《AdaTile-MCP 项目构建指南(v1.2)》六周计划完成全部 Phase 0–5。进度与实测数据见 STATE.md,当前已发现的问题清单见 KNOWN_ISSUES.md。
六层流水线(pipeline_v1)
L1 快速通道(magic bytes/懒解码/超限降采样/小图直传)→ L2 显著性(频谱残差 CPU 默认, U²-Netp 可选,Watchdog 超时降级)→ L3 自适应切分(连通域/预算预分配/连续块选取/文档 fine 路径)→ L4 组装上传(tile 级流水线化编码→上传、三级缓存、合规六项硬校验、降级链)→ L5 流式调用(json_object 强制输出、TTFT 双口径、重试与全局保底)→ L6 规则化合并 (IOU>0.3 同标签并 bbox)。
Related MCP server: image-tiler-mcp-server
降级行为说明
触发 | 行为 | 标记 |
格式不支持/文件损坏 | 结构化错误,无降级 |
|
显著性检测超时(>350ms) | 均匀动态网格替代 | trace 可见 |
Files API 上传失败(重试后) | Σbase64 ≤24MiB 全内联 |
|
内联仍超限 | 仅全局缩略图直发 |
|
模型散文输出(无 JSON) | 强制 JSON 重试一次 | 自动,无需配置 |
file_id 失效 | 刷新缓存重组装一次 | 自动 |
质量与延迟基线(实测,详见 experiments/*.json)
首次预处理 p95 1116ms(含真实上传)/ 命中 134ms;TTFT 847ms/613ms;10 并发 100% 成功
Phase 5 四方案对比与消融:
experiments/phase5_results.json
环境要求
Python 3.11+(项目内
.venv为 3.13)环境变量
DEEPSEEK_API_KEY(DeepSeek 平台申请)Windows/Git Bash 下激活 venv:
source .venv/Scripts/activate新机器一键装环境:
setup.bat(Windows)/setup.sh(macOS/Linux),见下节
从零接入(新机器 / 任意 agent)
.venv 与密钥都不随仓库走,新机器只需 5 步:
安装 Python 3.11+(Windows 安装时勾选 "Add to PATH")。
获取代码:
git clone https://github.com/Mutton-hub/adatile-mcp.git(或复制本目录,无需带.venv)。装环境:在项目根运行
setup.bat(Windows)或./setup.sh(macOS/Linux)——自动创建.venv并安装requirements.txt全部依赖。配 key:设置环境变量
DEEPSEEK_API_KEY,或复制.env.example为.env填入(二者选一;.env已被.gitignore排除)。注册 MCP:按下表把你的 agent 配置指向本机仓库绝对路径下的
run.bat(Windows)/run.sh(Unix),重启会话后先调adatile_status自检。
同一台机器上接入多个 agent 时,只需重复第 5 步(各客户端各自配置),环境与 key 共用。
MCP 注册 —— 适配任意本地 agent/harness
服务器是标准 MCP(stdio 默认 / http / sse 可选),以下客户端均可接入。
key 解析顺序:环境变量 DEEPSEEK_API_KEY → 项目根 .env 文件(复制 .env.example 为 .env 填入即可,适合难以注入环境变量的客户端)。
通用形式(所有支持 stdio MCP 的客户端)。<repo> 替换为仓库克隆/检出后的实际绝对路径(路径含中文或空格时必须用绝对路径):
{
"mcpServers": {
"adatile-mcp": {
"command": "<repo>\\run.bat",
"args": []
}
}
}
run.bat启动器自动定位 venv(macOS/Linux 用<repo>/run.sh)。也可直接指向<repo>/.venv/Scripts/python.exe+server.py。
各客户端放置位置:
客户端 | 配置文件 | 传输 |
ZCode | 项目根 | stdio |
Claude Code | 项目根 | stdio |
Claude Desktop (Win) |
| stdio |
Cursor |
| stdio |
Cline (VS Code) |
| stdio |
Continue |
| stdio |
Windsurf |
| stdio |
自研/远程 harness |
| streamable-http( |
ZCode 项目级配置示例(<repo>/.zcode/config.json,克隆后随仓库分享给团队):
{
"mcp": {
"servers": {
"adatile-mcp": {
"command": "C:\\path\\to\\cloned-repo\\run.bat",
"args": []
}
}
}
}接入后的使用流程(任意 agent/harness)
配置 key:设置环境变量
DEEPSEEK_API_KEY,或复制.env.example为<repo>/.env并填入 (.env已被.gitignore排除,不会进入版本控制;adatile_status可确认 key 是否就绪)。注册 MCP 服务器(上表)并重启客户端会话。
先调用
adatile_status(零 API 调用、零费用)确认 key 配置与本地 L1–L6 能力。再调用
analyze_high_res_image,传入image_path(本地绝对路径)与task_hint。优先使用返回的
merged_answer;objects/tile_details中的 bbox 可用于精确定位。同一张图的追问只需重复调用同一
image_path——内部三级缓存自动命中, 无需手动管理 file_id。
HTTP 模式示例(容器/远程 harness):
./run.sh --transport http --host 0.0.0.0 --port 8765
# MCP endpoint: http://<host>:8765/mcp接入后先调用 adatile_status(零 API 调用)确认 key 配置与本地能力,再调用 analyze_high_res_image。
工具:analyze_high_res_image
参数 | 说明 |
| 本地图片绝对路径(JPEG/PNG/GIF/WebP,按内容判断) |
|
|
|
|
其余参数 |
|
返回:merged_answer、objects(尽力解析)、tile_details(含 bbox 与 file_id)、latency_ms、token_usage、upload_stats、route(direct_pass / tile_pipeline)。
常用命令
# 生成测试集 A(50 张 4K 合成图 + ground_truth.json)
.venv/Scripts/python.exe experiments/cases/gen_set_a.py --n 10 --seed 42
# Phase 0 校准实验(先跑一票否决用例!)
.venv/Scripts/python.exe experiments/run_phase0.py --cases TC-0.1.8 TC-0.3.1 TC-0.4.2
.venv/Scripts/python.exe experiments/run_phase0.py --list # 查看全部用例
.venv/Scripts/python.exe experiments/run_phase0.py --full # 含重型用例
.venv/Scripts/python.exe experiments/run_phase0.py --rounds 10 # TTFT 轮数控制费用
# 本地自检(无 API 调用)
.venv/Scripts/python.exe -m pytest tests/test_local.py -q
# stdio 端到端冒烟测试(真实子进程 + 官方 MCP SDK,零 API 调用)
.venv/Scripts/python.exe tests/stdio_smoke.pyAgent 侧 System Prompt(模板 B,指南 3.3)
当用户上传高分辨率图像(总像素 > 64 万)时:
1. 调用 analyze_high_res_image 工具,传入 image_path 和 task_hint(上传与切片由工具自动经 Files API 完成);
2. task_hint:文字识别→"ocr";全景描述→"describe";具体元素→"detect";
3. 优先使用 merged_answer;tile_details 中的 bbox 可精确定位;
4. 同一张图的追问请复用工具(内部缓存自动命中);
5. 禁止直接将原图 base64 传给 VLM——必须走本工具,否则细节丢失。降级行为(Phase 0)
L1 损坏/不支持格式 → 结构化错误
{stage:"L1", reason:...},无降级路径小图(≤64 万像素)→ DirectPass 单次直传
Files API 不可用 → 主方案暂无自动降级(Phase 3 实现全内联降级链)
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables vision LLMs to read PDFs by automatically detecting text corruption and switching between text extraction and image rendering modes, while preserving reading order and filtering unnecessary images to prevent token overflow.3MIT
- AlicenseAqualityDmaintenanceMCP server that gives LLMs full-resolution vision by tiling images and capturing web pages before details are lost.1412MIT
- AlicenseNot gradedqualityCmaintenanceBridges text-only models like DeepSeek to 6 free multimodal vision APIs via MCP, enabling image understanding and analysis through automatic fallback and caching.563MIT
- AlicenseAqualityCmaintenanceAugments DeepSeek-V4 with image understanding and deep research capabilities via MCP, enabling vision and web research tools.51MIT
Related MCP Connectors
AI visual generation agent: multi-pipeline rendering, prompt crafting, and image composition.
AI image processing: upscale, resize, crop, compress, convert file format, and generate SEO metadata
Video scene understanding for AI agents via the Primate Vision API.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Mutton-hub/adatile-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server