AdaTile-MCP
AdaTile-MCP v1.0
高解像度画像の適応的タイル分割前処理層(MCP)。対象モデルは DeepSeek deepseek-v4-flash-vision-exp。
『AdaTile-MCP プロジェクト構築ガイド(v1.2)』の6週間計画に従い、Phase 0–5 をすべて完了。進捗と実測データは STATE.md、現在判明している問題の一覧は KNOWN_ISSUES.md を参照。
6層パイプライン(pipeline_v1)
L1 高速パス(magic bytes/遅延デコード/上限超過時のダウンサンプリング/小画像の直接送信)→ L2 顕著性(スペクトル残差 CPU デフォルト、 U²-Netp オプション、Watchdog タイムアウト時はダウングレード)→ L3 適応的タイル分割(連結成分/予算の事前割り当て/連続ブロック選択/ドキュメント fine パス)→ L4 アセンブルとアップロード(tile 単位のパイプライン化エンコード→アップロード、3段階キャッシュ、コンプライアンス6項目のハード検証、ダウングレードチェーン)→ L5 ストリーミング呼び出し(json_object 強制出力、TTFT の二重計測、リトライとグローバルフォールバック)→ L6 ルールベースのマージ (IOU>0.3 かつ同一ラベルなら bbox を結合)。
Related MCP server: image-tiler-mcp-server
ダウングレード動作の説明
トリガー | 動作 | マーカー |
形式非対応/ファイル破損 | 構造化エラー、ダウングレードなし |
|
顕著性検出のタイムアウト(>350ms) | 均一な動的グリッドで代替 | trace で確認可能 |
Files API アップロード失敗(リトライ後) | Σbase64 ≤24MiB ならすべてインライン |
|
インラインでも上限超過 | グローバルサムネイルのみ直接送信 |
|
モデルが散文を出力(JSON なし) | JSON 強制でリトライを1回実行 | 自動、設定不要 |
file_id の無効化 | キャッシュを更新して再アセンブルを1回実行 | 自動 |
品質とレイテンシのベースライン(実測、詳細は experiments/*.json)
初回前処理 p95 1116ms(実アップロード含む)/ キャッシュヒット 134ms;TTFT 847ms/613ms;10 並行で 100% 成功
Phase 5 の4方式比較とアブレーション:
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の全依存関係をインストール。キーを設定:環境変数
DEEPSEEK_API_KEYを設定するか、.env.exampleを.envにコピーして記入(どちらか一方;.envは.gitignoreで除外済み)。MCP を登録:以下の表に従い、agent の設定を本機のリポジトリ絶対パス配下の
run.bat(Windows)/run.sh(Unix)に指定し、セッション再起動後にまずadatile_statusで自己診断。
同一マシンで複数の agent を接続する場合は、手順5を繰り返すだけ(各クライアントが個別に設定)。環境とキーは共用。
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を繰り返し呼び出すだけでよい——内部の3段階キャッシュが自動的にヒットし、 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 で1回の直接送信
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