Mcp Florence2

io.github.jkawamoto由 GitHub 帳號 jkawamoto 發布v0.5.4更新於 Nov 14, 2026

An MCP server for processing images using Florence-2

已驗證STDIO僅桌面檔案與儲存媒體與設計

概覽

AI 產生的概覽

在本機執行微軟 Florence-2 視覺模型,讓助理對圖片與多頁 PDF 進行 OCR、產生描述並執行自訂視覺任務。

可以做什麼
  • 從圖片或多頁 PDF 逐頁擷取所有可見文字
  • 產生詳細描述,涵蓋物件、空間關係、顏色與背景
  • 執行自訂 Florence-2 任務提示,例如物件偵測、區域描述與邊界框
  • 輸入來源可為本機檔案路徑或 HTTP/HTTPS 網址
適用情境
適合需要從掃描檔、發票或截圖讀取文字,或描述圖片內容,又不希望把檔案送到外部視覺 API 的情境。配備 GPU 或 Apple Silicon 的桌面環境可獲得更快的推論速度。
執行需求
以本機 stdio 程序執行,通常透過 uvx 啟動或在 Claude Desktop 安裝 .mcpb 套件;僅支援桌面端。需下載 Hugging Face 上的 Florence-2 模型(預設 large,可選 base),需要 Python 與 uv,以及足夠的磁碟、記憶體或 GPU;僅在處理網址時需要對外 HTTP 連線。可透過 HTTP_PROXY、HTTPS_PROXY、NO_PROXY 設定代理。
安裝前請注意
處理 http 或 https 網址時伺服器程序會發出對外請求,README 警告在不可信使用者或提示可提供網址的環境中,可能遭受伺服器端請求偽造(SSRF),指向內網服務或雲端中繼資料端點;不可信或多租戶環境應使用防 SSRF 的轉送代理。交給工具的檔案與網址會被本機模型讀取,首次執行會從 Hugging Face 下載模型權重。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mcp Florence2,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

English | 日本語

Florence-2 MCP Server

[uv] [Python Version] [Python Application] [pre-commit] [GitHub License]

[MseeP.ai Security Assessment Badge]

Florence-2 MCP Server brings local vision intelligence and Optical Character Recognition (OCR) to your AI assistants via the Model Context Protocol (MCP). Powered by Microsoft's Florence-2 foundation model, it lets your LLMs inspect, caption, and extract text from local images, web URLs, and multi-page PDF documents — entirely offline and on your own machine.


✨ Key Features

  • 🔒 100% Local & Private: All image and document processing runs on your local machine. No external vision API fees, token limits, or data sharing.
  • 📄 Multi-Page PDF & Image Support: Process common image formats (JPEG, PNG, WebP, etc.) as well as multi-page PDF documents page-by-page.
  • ⚡ Native Hardware Acceleration: Automatically detects and leverages Apple Silicon (MPS), NVIDIA GPU (CUDA), or CPU.
  • 🧹 Zero VRAM Waste: By default, inference runs in an on-demand subprocess to release VRAM immediately after completion. A --cache-model flag is available for low-latency continuous usage.
  • 🎯 Rich Vision Tasks: Perform high-precision text OCR, detailed descriptive captioning, and open-ended visual queries using native Florence-2 prompt tokens (e.g. object detection, region descriptions).
  • 📦 One-Click Installs: Ready-to-use .mcpb bundle for Claude Desktop, 1-click deeplink for LM Studio, and extension support for Goose.

🚀 Quick Installation

Choose your preferred MCP client below:

Claude Desktop

Option 1: One-Click Extension Bundle (Recommended)
  1. Download the latest mcp-florence2.mcpb bundle from the Releases page.
  2. Double-click the downloaded .mcpb file, or drag-and-drop it into Claude Desktop's Settings window.
Option 2: Manual Configuration

Add the following configuration to your claude_desktop_config.json:

json
{  "mcpServers": {    "florence-2": {      "command": "uvx",      "args": [        "--from",        "git+https://github.com/jkawamoto/mcp-florence2",        "mcp-florence2"      ]    }  }}

[!NOTE] Config file locations:

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

For more details, see Connect to local MCP servers.


Goose

Option 1: One-Click URL

Click the link below to launch the Goose extension installer:

text
goose://extension?cmd=uvx&arg=--from&arg=git%2Bhttps%3A%2F%2Fgithub.com%2Fjkawamoto%2Fmcp-florence2&arg=mcp-florence2&id=florence2&name=Florence-2&description=An%20MCP%20server%20for%20processing%20images%20using%20Florence-2
Option 2: Manual Configuration

Add the following to ~/.config/goose/config.yaml:

yaml
extensions:  florence2:    name: Florence-2    cmd: uvx    args: [ --from, git+https://github.com/jkawamoto/mcp-florence2, mcp-florence2 ]    enabled: true    type: stdio

For more details, refer to Using Extensions | goose.


LM Studio

Click the button below to install directly into LM Studio:

[Add MCP Server florence-2 to LM Studio]


Claude Code, Cursor, Cline & Other MCP Clients

You can connect any client that supports stdio MCP servers using uvx:

bash
uvx --from git+https://github.com/jkawamoto/mcp-florence2 mcp-florence2

🛠️ Tools

The server automatically equips your AI assistant with the following vision capabilities. You can interact with them using natural language:

1. ocr

Extracts all visible text from images or multi-page PDF documents.

  • Example user request: "Please extract all text from /path/to/invoice.pdf."
  • Multi-page support: Automatically iterates through every page in a PDF document.
Tool schema & parameters
ParameterTypeRequiredDescription
srcstringYesLocal file path or HTTP/HTTPS URL of an image or PDF file.

2. caption

Generates comprehensive, detailed captions describing what is depicted in the image.

  • Example user request: "Describe what is shown in https://example.com/photo.jpg."
  • Returns granular descriptions of objects, spatial relationships, colors, and background scenery.
Tool schema & parameters
ParameterTypeRequiredDescription
srcstringYesLocal file path or HTTP/HTTPS URL of an image or PDF file.

3. process

Executes custom Florence-2 task prompts directly against the input image or PDF for advanced computer vision workflows (such as object detection or region captioning).

  • Example user request: "Detect all objects in this image and return their bounding boxes."
Tool schema & supported task prompts
Parameters
ParameterTypeRequiredDescription
srcstringYesLocal file path or HTTP/HTTPS URL of an image or PDF file.
promptstringYesTask prompt specifying the operation to perform.
Supported Florence-2 Task Prompts
Task PromptDescription
<CAPTION>Concise one-sentence summary of the image.
<DETAILED_CAPTION>Moderate-length description of the image content.
<MORE_DETAILED_CAPTION>Highly detailed and exhaustive scene description.
<OCR>Plain text extraction from the image.
<OCR_WITH_REGION>Text extraction along with bounding box coordinates.
<OD>Object detection (identifies objects and their bounding boxes).
<DENSE_REGION_CAPTION>Generates descriptions for multiple distinct regions.
<REGION_PROPOSAL>Identifies candidate bounding boxes for prominent visual regions.

⚙️ Configuration & CLI Options

The server can be customized using command-line arguments:

bash
mcp-florence2 [OPTIONS]
OptionTypeDefaultDescription
--modelstringflorence-community/Florence-2-largeHugging Face model identifier to load.
--cache-modelflagfalseKeeps the model in VRAM for faster repeated calls (by default, models run in subprocesses to free memory when idle).
--versionflag-Show version information.
--helpflag-Show help message and exit.

Using a Smaller / Faster Model

If you have limited GPU memory or want faster execution, switch to Florence-2-base:

json
{  "mcpServers": {    "florence-2": {      "command": "uvx",      "args": [        "--from",        "git+https://github.com/jkawamoto/mcp-florence2",        "mcp-florence2",        "--model",        "florence-community/Florence-2-base"      ]    }  }}

🛡️ Security Considerations

When processing URLs starting with http:// or https://, outbound HTTP requests are initiated directly from the server process. In environments where untrusted users or prompts may supply URLs, this could potentially expose the server to Server-Side Request Forgery (SSRF) targeting internal network services or cloud metadata endpoints.

[!WARNING] In multi-tenant or untrusted environments, route outgoing HTTP(S) traffic through an SSRF-safe forward proxy (such as Smokescreen or Squid configured to block private/internal IP ranges).

Since Python's requests library automatically respects standard environment variables, proxy settings can be configured directly in your client configuration:

  • HTTP_PROXY / http_proxy: Proxy URL for HTTP requests.
  • HTTPS_PROXY / https_proxy: Proxy URL for HTTPS requests.
  • NO_PROXY / no_proxy: Comma-separated list of hosts to bypass the proxy.
Proxy Configuration Examples
Claude Desktop

Add the env block to claude_desktop_config.json:

json
{  "mcpServers": {    "florence-2": {      "command": "uvx",      "args": [        "--from",        "git+https://github.com/jkawamoto/mcp-florence2",        "mcp-florence2"      ],      "env": {        "HTTP_PROXY": "http://proxy.example.com:8080",        "HTTPS_PROXY": "http://proxy.example.com:8080"      }    }  }}
Goose

Add the env block to ~/.config/goose/config.yaml:

yaml
extensions:  florence2:    name: Florence-2    cmd: uvx    args: [ --from, git+https://github.com/jkawamoto/mcp-florence2, mcp-florence2 ]    env:      HTTP_PROXY: "http://proxy.example.com:8080"      HTTPS_PROXY: "http://proxy.example.com:8080"    enabled: true    type: stdio

💻 Development

Setup & Run Tests

This project uses uv for fast, reliable dependency management.

bash
# Clone the repositorygit clone https://github.com/jkawamoto/mcp-florence2.gitcd mcp-florence2
# Install dependencies and run testsuv run pytest
# Run pre-commit checksuv run pre-commit run --all-files

📄 License

This application is released under the MIT License.

來源:README.md,提交 335b6df

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:該軟體包類型無法在沙箱中執行。

版本歷史

5
  1. v0.5.4最新Nov 14, 2026
  2. v0.5.3Oct 29, 2026
  3. v0.5.2Oct 21, 2026
  4. v0.5.1Oct 1, 2026
  5. v0.5.0Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分