把 PDF、Word、PPTX 丟給 Agent,
一行指令變 Markdown,快取自動搞定。
這個 MCP Server 是工具人實驗室自架的文件轉換服務,跑在 NAS3 上。
內網直連免密碼,外網用 Authorization: Bearer <NAS3密碼> 就好。
有問題找實驗室同學,或是直接問 Agent ——它比你更懂流程。
把 MCP Server 加進你的 AI Agent,只需要三個步驟
在你的 AI 工具(Claude Desktop、Cursor 等)的設定檔中貼上 Server URL,選下方對應的設定格式。
Agent 會自動呼叫 upload_file 將文件以 base64 格式上傳到 NAS,或直接傳入 URL。
Agent 呼叫 convert_to_markdown,即刻取得 Markdown 全文。結果自動存快取,下次直接取用。
根據你使用的 AI 工具,選擇對應的設定格式
在實驗室的網路內(140.112.183.x / 192.168.23.x),不需要任何密碼。
{
"mcpServers": {
"markitdown": {
"url": "https://markitdown-mcp.toolmen.bime.ntu.edu.tw/mcp"
}
}
}
// .cursor/mcp.json
{
"mcpServers": {
"markitdown": {
"url": "https://markitdown-mcp.toolmen.bime.ntu.edu.tw/mcp"
}
}
}
// .gemini/antigravity-ide/settings.json
{
"mcpServers": {
"markitdown": {
"url": "https://markitdown-mcp.toolmen.bime.ntu.edu.tw/mcp"
}
}
}
// .gemini/settings.json
{
"mcpServers": {
"markitdown": {
"url": "https://markitdown-mcp.toolmen.bime.ntu.edu.tw/mcp"
}
}
}
// 在 AGENTS.md 中加入:
// ---
// 此專案使用 markitdown MCP server 讀取文件。
// MCP Endpoint: https://markitdown-mcp.toolmen.bime.ntu.edu.tw/mcp
// 使用 check_cache → get_cached_markdown 或 upload_file → convert_to_markdown 流程。
// ---
// opencode.json
{
"mcp": {
"markitdown": {
"type": "streamable-http",
"url": "https://markitdown-mcp.toolmen.bime.ntu.edu.tw/mcp"
}
}
}
在實驗室外部使用時,需要帶上 NAS3 密碼作為 Bearer Token。
{
"mcpServers": {
"markitdown": {
"url": "https://markitdown-mcp.toolmen.bime.ntu.edu.tw/mcp",
"headers": {
"Authorization": "Bearer <NAS3密碼>"
}
}
}
}
// .cursor/mcp.json
{
"mcpServers": {
"markitdown": {
"url": "https://markitdown-mcp.toolmen.bime.ntu.edu.tw/mcp",
"headers": {
"Authorization": "Bearer <NAS3密碼>"
}
}
}
}
// .gemini/antigravity-ide/settings.json
{
"mcpServers": {
"markitdown": {
"url": "https://markitdown-mcp.toolmen.bime.ntu.edu.tw/mcp",
"headers": {
"Authorization": "Bearer <NAS3密碼>"
}
}
}
}
// .gemini/settings.json
{
"mcpServers": {
"markitdown": {
"url": "https://markitdown-mcp.toolmen.bime.ntu.edu.tw/mcp",
"headers": {
"Authorization": "Bearer <NAS3密碼>"
}
}
}
}
// 在 AGENTS.md 中加入:
// ---
// 此專案使用 markitdown MCP server 讀取文件。
// MCP Endpoint: https://markitdown-mcp.toolmen.bime.ntu.edu.tw/mcp
// 若收到 401,請向使用者詢問 NAS3 密碼,
// 加到 Authorization: Bearer <密碼> header。
// ---
// opencode.json
{
"mcp": {
"markitdown": {
"type": "streamable-http",
"url": "https://markitdown-mcp.toolmen.bime.ntu.edu.tw/mcp",
"headers": {
"Authorization": "Bearer <NAS3密碼>"
}
}
}
}
401 Unauthorized,Agent 會自動收到提示訊息,告訴它 NAS3 密碼即可,它會自行更新 header 重試。
Server 提供 8 個 MCP tools,Agent 連線後自動偵測並使用
在你的 SKILL.md 或 .agents.md 裡加入以下指令,教 Agent 使用流程
# MarkItDown MCP — 文件轉換 Skill
## MCP Server
- Name: `markitdown`
- URL: `https://markitdown-mcp.toolmen.bime.ntu.edu.tw/mcp`
- Transport: Streamable HTTP
## 使用時機
當需要讀取、分析、摘要 PDF / DOCX / PPTX / XLSX 等文件時,使用此 MCP Server。
## 基本流程
### 首次轉換文件
1. 先呼叫 `check_cache(filename)` 檢查是否有快取
2. 若有快取 → 呼叫 `get_cached_markdown(filename)` 取得內容
3. 若無快取 → 呼叫 `upload_file(filename, content_base64)` 上傳文件
4. 然後呼叫 `convert_to_markdown(source=filename, save_cache=true)` 轉換
5. 轉換結果會自動存入快取
### 轉換網頁 URL
直接呼叫 `convert_to_markdown(source="https://example.com/doc.pdf")`
### 列出已有文件
呼叫 `list_files(target="input")` 或 `list_files(target="markdown")`
## 注意事項
- 上傳前需要將文件內容 base64 編碼
- 大於 10MB 的文件效率較差,考慮分段處理
- 快取會長期保留,不會自動過期
- 若連線時收到 401 Unauthorized,請向使用者詢問 NAS3 密碼,
並在 MCP headers 中加入 `Authorization: Bearer <密碼>`
## 支援格式
`.pdf` `.docx` `.pptx` `.xlsx` `.csv` `.html` `.htm` `.txt` `.md` `.json`
# 文件轉換
使用 `markitdown` MCP Server 讀取文件。
流程:
1. `check_cache(filename)` → 有快取就用 `get_cached_markdown(filename)`
2. 沒快取 → `upload_file` + `convert_to_markdown(source, save_cache=true)`
3. URL 轉換 → 直接 `convert_to_markdown(source="https://...")`
401 時詢問使用者 NAS3 密碼,加到 Authorization: Bearer header。
Agent、MCP Server、NAS 三者之間的互動時序
Agent MCP Server NAS
│ │ │
├─ upload_file(base64) ────────→ │ │
│ ├─ decode & write ───────────→ │ /input/report.pdf
│ │ │
├─ convert_to_markdown("report.pdf") ──→ │ │
│ │ markitdown.convert() │
│ ├─ save cache ───────────────→ │ /markdown/report.md
│ ├─ save metadata ────────────→ │ /metadata/report.json
│ ←── Markdown content ─────────┤ │
│ │ │
Agent MCP Server NAS
│ │ │
├─ check_cache("report.pdf") ──→ │ │
│ ←── has_cache: true ──────────┤ ← stat() ──────────────────│
│ │ │
├─ get_cached_markdown() ──────→ │ │
│ ←── Markdown content ─────────┤ ← read() ─────────────────│
│ │ │
幾乎涵蓋所有常見的文件格式
遇到問題不慌,先看這裡
你可能在外網連線。請在 MCP 設定的 headers 裡加上
Authorization: Bearer <NAS3密碼>。密碼跟 NAS3 登入密碼相同,問實驗室同學即可。
因為 MCP 用 base64 傳檔案,會膨脹約 33%。大於 10MB
的文件建議直接用 URL 轉換(convert_to_markdown(source="https://...")),或考慮先放上 NAS 再用檔名轉換。
不會自動過期。如果原始文件更新了,重新呼叫
convert_to_markdown(source, save_cache=true) 會覆蓋舊的快取。
可以。MCP Server 和舊方案共用同一個 NAS
目錄(/mnt/nas3/Share/markitdown-filebase),檔案完全互通。但建議新的 Agent 直接用 MCP,更簡單。