UOF UOF
Released已發布An MCP server for the UOF (U-Office Force) first-generation platform — WKF workflow tools (form queries, apply/sign/terminate tasks) over its SOAP/ASMX services and selected web flows.
UOF (U-Office Force) 一代平台的 MCP Server 實作
Features功能特色
- 19 exposed tools for UOF workflow operations.
preview_workflowandget_external_form_listcurrently return capability guidance rather than live data. - MCP server over stdio for local AI clients.
- Tool-first interface: users call the same tools without ever choosing a mechanism — how each tool talks to UOF is an internal, developer-time decision.
- Browser sign-in:
uof_custom_loginopens the real UOF login page in the user's own browser and captures the session. The local MCP proxy relays the login form to UOF, so the password transits the server process in memory but is never parsed, logged, persisted, written to a config file, or returned to the AI. An unattended username/password fallback stays available for CI. - Single identity model: one server process represents one UOF identity, and the session persists across restarts.
- httpx web automation: operations use HTTPS requests (
httpx+lxml) against UOF'saspx/ashxendpoints, without a browser runtime. On Alpine Linux or musl, ensure binary wheels or native build dependencies are available.
- 19 exposed tools for UOF workflow operations.
preview_workflowandget_external_form_listcurrently return capability guidance rather than live data. - MCP server over stdio for local AI clients.
- Tool-first interface: users call the same tools without ever choosing a mechanism — how each tool talks to UOF is an internal, developer-time decision.
- Browser sign-in:
uof_custom_loginopens the real UOF login page in the user's own browser and captures the session. The local MCP proxy relays the login form to UOF, so the password transits the server process in memory but is never parsed, logged, persisted, written to a config file, or returned to the AI. An unattended username/password fallback stays available for CI. - Single identity model: one server process represents one UOF identity, and the session persists across restarts.
- httpx web automation: operations use HTTPS requests (
httpx+lxml) against UOF'saspx/ashxendpoints, without a browser runtime. On Alpine Linux or musl, ensure binary wheels or native build dependencies are available.
Quick Start快速開始
Install
Install from PyPI:
pip install mcp-uof
Or run without installing:
uvx --from mcp-uof mcp-uof
To install and run the current source instead:
git clone https://github.com/asgard-ai-platform/mcp-uof.git
cd mcp-uof
uv sync
cp .env.example .env
Set the connection URL — that is the only required variable:
export UOF_BASE_URL=https://your-uof-domain.com/VirtualPath
Sign in by calling the uof_custom_login tool in your chat: it opens the real UOF login page in
your default browser, and the session is handed back to the server once you log in. Credentials
are relayed as-is by the local proxy — never parsed, logged, persisted, or returned to the AI, and
never written to a config file. See docs/configuration.md
for the unattended (username/password) fallback used by CI.
Use with Claude Code
Add the server via the Claude CLI:
claude mcp add --transport stdio uof -- mcp-uof
Or with environment variables inline:
claude mcp add --transport stdio uof \
-e UOF_BASE_URL=https://your-uof-domain.com/VirtualPath \
-- mcp-uof
If you clone the repo locally, run it through uv:
claude mcp add --transport stdio uof -- uv --directory /absolute/path/to/mcp-uof run mcp-uof
Use with Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"uof": {
"command": "mcp-uof",
"env": {
"UOF_BASE_URL": "https://your-uof-domain.com/VirtualPath"
}
}
}
}
Or with a local checkout:
{
"mcpServers": {
"uof": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/mcp-uof", "run", "mcp-uof"],
"env": {
"UOF_BASE_URL": "https://your-uof-domain.com/VirtualPath"
}
}
}
}
See docs/integration.md and examples/ for more client configuration examples.
安裝
從 PyPI 安裝:
pip install mcp-uof
或不安裝、直接執行:
uvx --from mcp-uof mcp-uof
若要使用目前原始碼:
git clone https://github.com/asgard-ai-platform/mcp-uof.git
cd mcp-uof
uv sync
cp .env.example .env # 至少填入 UOF_BASE_URL(帳密非必填)
uv run mcp-uof # 以 stdio 啟動 MCP Server
啟動後在對話中呼叫 uof_custom_login,於瀏覽器完成登入即可開始操作。
設定細節見 docs/configuration.md。
MCP Client 設定(Claude Desktop / VS Code)
完整綁定與身份切換教學見 docs/integration.md。最小範例:
{
"mcpServers": {
"uof": {
"command": "mcp-uof",
"env": {
"UOF_BASE_URL": "https://your-uof-domain.com/VirtualPath"
}
}
}
}
範例檔見 examples/。
身份模型
一個 Server 程序 = 一個身份,該 Server 的所有工具呼叫都以這個身份送出。
- 瀏覽器登入(預設):身份就是實際在瀏覽器登入的那個人。要換人操作,呼叫
uof_custom_logout後重新登入,或uof_custom_login(force=True)。 - 帳密備援:身份由
env區塊的UOF_ACCOUNT綁定;換人就是換一份 server entry。
完整說明見 docs/integration.md。
API ReferenceAPI 參考文件
This project targets UOF first-generation web flows, driven over httpx.
- Authentication: a
Login.aspxcookie session, obtained either through browser sign-in or the credential fallback. - Base URL: configured with
UOF_BASE_URL, for examplehttps://your-uof-domain.com/VirtualPath. - Required UOF settings: see docs/configuration.md.
This project targets UOF first-generation web flows, driven over httpx.
- Authentication: a
Login.aspxcookie session, obtained either through browser sign-in or the credential fallback. - Base URL: configured with
UOF_BASE_URL, for examplehttps://your-uof-domain.com/VirtualPath. - Required UOF settings: see docs/configuration.md.
Available Tools可用工具
All tool names use the uof_custom_ prefix.
| Domain | Tools |
|---|---|
| System | check_auth, login, logout |
| WKF Workflow | get_form_list, get_external_form_list, query_forms, get_pending_sign_list, search_users, get_form_structure, get_form_structure_by_id, get_dialog_structure, search_dialog_options, operate_dialog, preview_workflow, apply_form, get_task_data, get_task_result, sign_next, terminate_task |
Important behavior and constraints:
get_pending_sign_listreturns every form awaiting the current identity's signature (with TaskId/SiteId/NodeSeq), sourced from the Homepage pending-sign widget.query_formsis a different set — the forms you submitted or signed, by date range (query_mode=apply/sign). Ask "what do I need to sign?" →get_pending_sign_list.- Composite fields (line items, vendor pickers, expense details) live inside dialogs. Use
get_dialog_structureto see a dialog field's inner controls,search_dialog_optionsto look up real picker candidates (never fabricate codes), and pass them intoapply_formvia the_lookups/_fill_before/_press_after/_rowsreserved keys.operate_dialogis a probe only — it cannot accumulate rows. sign_nextperforms approval for the current pending step and can close the flow or route to a designated next signer. It does not accept a signing comment; return, parallel/countersign, and fixed-flow stepping still require the Web UI.terminate_taskcloses a task:Cancelvoids an in-flight form (via the web recall page),Adopt/Rejectapprove/reject through the web sign flow. It checks task status first and blocks repeated closure of an already-closed task.preview_workflow(flow simulation) is not available over httpx and directs the user to the Web UI; you can still submit directly withapply_formand inspect the real signing route afterward withget_task_result.apply_formalways submits as the identity this server process is signed in as (the browser-login user, or the configuredUOF_ACCOUNTwhen the credential fallback is used). Itsapplicant_accountandfirst_signer_accountparameters are currently retained for interface compatibility but do not change the submitted identity or routing.
See docs/tools.md for full tool specs, role model, examples, and operational boundaries.
All tool names use the uof_custom_ prefix.
| Domain | Tools |
|---|---|
| System | check_auth, login, logout |
| WKF Workflow | get_form_list, get_external_form_list, query_forms, get_pending_sign_list, search_users, get_form_structure, get_form_structure_by_id, get_dialog_structure, search_dialog_options, operate_dialog, preview_workflow, apply_form, get_task_data, get_task_result, sign_next, terminate_task |
Important behavior and constraints:
get_pending_sign_listreturns every form awaiting the current identity's signature (with TaskId/SiteId/NodeSeq), sourced from the Homepage pending-sign widget.query_formsis a different set — the forms you submitted or signed, by date range (query_mode=apply/sign). Ask "what do I need to sign?" →get_pending_sign_list.- Composite fields (line items, vendor pickers, expense details) live inside dialogs. Use
get_dialog_structureto see a dialog field's inner controls,search_dialog_optionsto look up real picker candidates (never fabricate codes), and pass them intoapply_formvia the_lookups/_fill_before/_press_after/_rowsreserved keys.operate_dialogis a probe only — it cannot accumulate rows. sign_nextperforms approval for the current pending step and can close the flow or route to a designated next signer. It does not accept a signing comment; return, parallel/countersign, and fixed-flow stepping still require the Web UI.terminate_taskcloses a task:Cancelvoids an in-flight form (via the web recall page),Adopt/Rejectapprove/reject through the web sign flow. It checks task status first and blocks repeated closure of an already-closed task.preview_workflow(flow simulation) is not available over httpx and directs the user to the Web UI; you can still submit directly withapply_formand inspect the real signing route afterward withget_task_result.apply_formalways submits as the identity this server process is signed in as (the browser-login user, or the configuredUOF_ACCOUNTwhen the credential fallback is used). Itsapplicant_accountandfirst_signer_accountparameters are currently retained for interface compatibility but do not change the submitted identity or routing.
See docs/tools.md for full tool specs, role model, examples, and operational boundaries.
Development開發
uv sync
uv run python tests/run.py smoke
uv run python -m compileall src tests
Tests that connect to a real UOF test environment require .env:
uv run python tests/run.py mounted
See CONTRIBUTING.md and docs/testing.md for development and testing guidelines.
uv sync
uv run python tests/run.py smoke
uv run python -m compileall src tests
Tests that connect to a real UOF test environment require .env:
uv run python tests/run.py mounted
See CONTRIBUTING.md and docs/testing.md for development and testing guidelines.
License授權
MIT
MIT License
Project StructureProject Structure
mcp-uof/
├── src/mcp_uof/ # MCP server, auth (web session), routing, httpx web backend
├── docs/ # Architecture, configuration, integration, tools, testing
├── examples/ # Claude Desktop and VS Code MCP config examples
├── tests/ # smoke / mounted test layers
├── .env.example # Environment variable template
├── README.zh-TW.md # Traditional Chinese README
└── pyproject.toml
mcp-uof/
├── src/mcp_uof/ # MCP server, auth (web session), routing, httpx web backend
├── docs/ # Architecture, configuration, integration, tools, testing
├── examples/ # Claude Desktop and VS Code MCP config examples
├── tests/ # smoke / mounted test layers
├── .env.example # Environment variable template
├── README.zh-TW.md # Traditional Chinese README
└── pyproject.toml
本版本範圍本版本範圍
本版本提供**電子簽核(WKF)**模組,透過 stdio 連線供 Claude Desktop、VS Code 等 MCP 客戶端使用,涵蓋表單查詢、流程預覽、起單、進度追蹤、簽核與結案。
機制對使用者透明(工具是唯一面向)
對外只有一組固定工具,底層以 httpx + lxml 操作 UOF 網頁端點,不需要瀏覽器 runtime。MCP Server 提供表單清單、欄位解析、通用起單、查詢、簽核與結案;特定表單的填寫 SOP 與業務驗證由部署端私有 skill 組合。詳見 docs/architecture.md。
其他特點:
- 不需瀏覽器 runtime:全部以 httpx + lxml 實作;在 musl/Alpine 環境部署時,仍需確認相依套件有 binary wheel 或備妥原生建置工具。
- 瀏覽器登入:呼叫
uof_custom_login,會在使用者自己的瀏覽器開啟真實的 UOF 登入頁,登入後 session 自動交回 MCP。密碼由本機代理原樣轉送給 UOF,不解析、不記錄、不落地,也不會回傳給 AI,更不必寫進設定檔;session 存到UOF_SESSION_DIR(預設~/.uof),重啟免重登。無人值守情境(CI)仍可用帳密自動登入備援。 - 單一身份模型:一個 Server 程序代表一位 UOF 使用者(見身份模型)。
- 認證失敗訊息分流:「尚未登入」會要求 AI 去開登入頁;「設定錯誤」才要使用者檢查設定。
起單能力範圍
起單由同一個 apply_form 完成,支援通用欄位型別(文字、自動編號、可空欄位、日期、單選/下拉、通用 dataGrid 明細)。實際申請身份固定為本 Server 目前登入的身份;目前工具簽名中的 applicant_account 與 first_signer_account 尚未改變身份或派單路徑,需要指定首站簽核者時請使用 UOF Web UI。本 repo 不內建特定表單的業務 SOP,欄位組合與檢查應由部署端的私有 skill 依表單結構與業務規則決定。
重要:一般網頁起單可填的欄位以
get_form_structure_by_id回傳者為準;若某欄位漏掉,應先視為解析器待修問題。通用 dataGrid 明細已支援,附件上傳、多站/並簽會簽尚未支援。
本版本提供**電子簽核(WKF)**模組,透過 stdio 連線供 Claude Desktop、VS Code 等 MCP 客戶端使用,涵蓋表單查詢、流程預覽、起單、進度追蹤、簽核與結案。
機制對使用者透明(工具是唯一面向)
對外只有一組固定工具,底層以 httpx + lxml 操作 UOF 網頁端點,不需要瀏覽器 runtime。MCP Server 提供表單清單、欄位解析、通用起單、查詢、簽核與結案;特定表單的填寫 SOP 與業務驗證由部署端私有 skill 組合。詳見 docs/architecture.md。
其他特點:
- 不需瀏覽器 runtime:全部以 httpx + lxml 實作;在 musl/Alpine 環境部署時,仍需確認相依套件有 binary wheel 或備妥原生建置工具。
- 瀏覽器登入:呼叫
uof_custom_login,會在使用者自己的瀏覽器開啟真實的 UOF 登入頁,登入後 session 自動交回 MCP。密碼由本機代理原樣轉送給 UOF,不解析、不記錄、不落地,也不會回傳給 AI,更不必寫進設定檔;session 存到UOF_SESSION_DIR(預設~/.uof),重啟免重登。無人值守情境(CI)仍可用帳密自動登入備援。 - 單一身份模型:一個 Server 程序代表一位 UOF 使用者(見身份模型)。
- 認證失敗訊息分流:「尚未登入」會要求 AI 去開登入頁;「設定錯誤」才要使用者檢查設定。
起單能力範圍
起單由同一個 apply_form 完成,支援通用欄位型別(文字、自動編號、可空欄位、日期、單選/下拉、通用 dataGrid 明細)。實際申請身份固定為本 Server 目前登入的身份;目前工具簽名中的 applicant_account 與 first_signer_account 尚未改變身份或派單路徑,需要指定首站簽核者時請使用 UOF Web UI。本 repo 不內建特定表單的業務 SOP,欄位組合與檢查應由部署端的私有 skill 依表單結構與業務規則決定。
重要:一般網頁起單可填的欄位以
get_form_structure_by_id回傳者為準;若某欄位漏掉,應先視為解析器待修問題。通用 dataGrid 明細已支援,附件上傳、多站/並簽會簽尚未支援。
Mcp Tools 總覽 19 個Mcp Tools 總覽 19 個
所有 Tool 名稱使用 uof_custom_ 前綴。
| Domain | Tools |
|---|---|
| System | check_auth, login, logout |
| WKF 電子簽核 | get_form_list, get_external_form_list, query_forms, get_pending_sign_list, search_users, get_form_structure, get_form_structure_by_id, get_dialog_structure, search_dialog_options, operate_dialog, preview_workflow, apply_form, get_task_data, get_task_result, sign_next, terminate_task |
完整工具規格、人員角色模型、使用情境與能力邊界,請見 docs/tools.md(導入前必讀)。
幾個關鍵邊界先說在前面:
- 待簽清單用
get_pending_sign_list(回「目前輪到本帳號待簽」的單,含 TaskId/SiteId/NodeSeq);query_forms則查「自己送出/簽過」的單(依日期,query_mode選 apply/sign),兩者是不同集合 - 複合欄位(明細、供應商挑選等)藏在對話框裡:用
get_dialog_structure看內部控制項、search_dialog_options查真實候選(勿捏造代碼),再經apply_form的_lookups/_rows等保留鍵帶入;operate_dialog僅供探測、不能累積明細列 terminate_task:Cancel撤單作廢(走網頁表單取回頁)、Adopt/Reject走網頁簽核流程同意/否決;對已結案的單會被工具層攔截、不重複結案preview_workflow(流程模擬)目前不提供 httpx 版,會提示改於網頁操作;可直接apply_form起單後用get_task_result看實際簽核路徑get_external_form_list目前只回傳能力說明,不會列出後台的「非線上使用」表單
所有 Tool 名稱使用 uof_custom_ 前綴。
| Domain | Tools |
|---|---|
| System | check_auth, login, logout |
| WKF 電子簽核 | get_form_list, get_external_form_list, query_forms, get_pending_sign_list, search_users, get_form_structure, get_form_structure_by_id, get_dialog_structure, search_dialog_options, operate_dialog, preview_workflow, apply_form, get_task_data, get_task_result, sign_next, terminate_task |
完整工具規格、人員角色模型、使用情境與能力邊界,請見 docs/tools.md(導入前必讀)。
幾個關鍵邊界先說在前面:
- 待簽清單用
get_pending_sign_list(回「目前輪到本帳號待簽」的單,含 TaskId/SiteId/NodeSeq);query_forms則查「自己送出/簽過」的單(依日期,query_mode選 apply/sign),兩者是不同集合 - 複合欄位(明細、供應商挑選等)藏在對話框裡:用
get_dialog_structure看內部控制項、search_dialog_options查真實候選(勿捏造代碼),再經apply_form的_lookups/_rows等保留鍵帶入;operate_dialog僅供探測、不能累積明細列 terminate_task:Cancel撤單作廢(走網頁表單取回頁)、Adopt/Reject走網頁簽核流程同意/否決;對已結案的單會被工具層攔截、不重複結案preview_workflow(流程模擬)目前不提供 httpx 版,會提示改於網頁操作;可直接apply_form起單後用get_task_result看實際簽核路徑get_external_form_list目前只回傳能力說明,不會列出後台的「非線上使用」表單
TestingTesting
兩層測試法(smoke / mounted),統一入口:
uv run python tests/run.py smoke # 離線:import 探索、工具→機制綁定(CI 可跑)
uv run python tests/run.py mounted # 真實掛載 MCP:真 stdio 子程序、多身份(需 .env)
uv run python tests/run.py all # 兩層依序(缺 .env 時真實層自動 skip)
各層定義與測試紀律見 docs/testing.md。
兩層測試法(smoke / mounted),統一入口:
uv run python tests/run.py smoke # 離線:import 探索、工具→機制綁定(CI 可跑)
uv run python tests/run.py mounted # 真實掛載 MCP:真 stdio 子程序、多身份(需 .env)
uv run python tests/run.py all # 兩層依序(缺 .env 時真實層自動 skip)
各層定義與測試紀律見 docs/testing.md。
文件文件
Tags標籤
Related MCP Servers相關 MCP 伺服器
591 Real Estate 591 房地產資料
An MCP server to fetch and query real estate listings from 591.com.tw for AI assistants.
開源 MCP(Model Context Protocol) server,將台灣最大房地產平台 591 售屋網 包裝成 4 個 AI 可呼叫的 tool,支援售屋與租屋搜尋。
buy123 Vendor Portal buy123 供應商平台
Model Context Protocol server for read-only buy123 vendor portal queries
mcp-buy123-vendor 是針對 buy123 供應商後台的開源 Model Context Protocol (MCP) 伺服器。它讓 Claude Desktop、Claude Code...
CPBL Statistics 中華職棒統計
An MCP (Model Context Protocol) server that provides comprehensive statistics and data for the Chine...
一個中華職棒(CPBL)統計資料的 MCP 伺服器,透過 Model Context Protocol (MCP) 將資料查詢功能以 AI 可呼叫工具的形式對外開放。