Asgard AI

台灣公司登記查詢

一個針對台灣公司登記公開資料的 MCP 伺服器,透過 Model Context Protocol (MCP) 對 AI 客戶端提供可呼叫工具。資料來源為經濟部商業發展署 GCIS 開放資料端點。

releaseddatataiwancompanygovmoea
工具數
9
維護者
asgard-ai-platform
授權
MIT
地區
taiwan

簡介

一個針對台灣公司登記公開資料的 MCP 伺服器,透過 Model Context Protocol (MCP) 對 AI 客戶端提供可呼叫工具。資料來源為經濟部商業發展署 GCIS 開放資料端點。

Features

  • stdio JSON-RPC 2.0 — 標準 MCP 傳輸協定
  • @mcp.tool() 裝飾器 — Pydantic 型別化工具註冊
  • REST 連接器 — 內建指數退避重試機制
  • 無認證公開 API — 直接使用 GCIS 開放資料端點
  • E2E 測試 — 即時 API 測試執行器
  • 9 個已註冊工具 — 公司搜尋、董監事、營業項目、分公司等

Requirements

  • Python 3.14.x
  • uv
  • 不需要 API 金鑰(公開資料)

Install

從 PyPI 安裝
pip install mcp-tw-company
使用 uvx(免安裝)
uvx mcp-tw-company
從原始碼安裝
git clone https://github.com/asgard-ai-platform/mcp-tw-company.git
cd mcp-tw-company
uv sync

Configuration

Claude Desktop

加入 claude_desktop_config.json:

{
  "mcpServers": {
    "tw-company": {
      "command": "uvx",
      "args": ["mcp-tw-company"]
    }
  }
}
Claude Code

加入專案中的 .mcp.json:

{
  "mcpServers": {
    "tw-company": {
      "command": "uvx",
      "args": ["mcp-tw-company"]
    }
  }
}
Cursor

加入 Cursor MCP 設定:

{
  "mcpServers": {
    "tw-company": {
      "command": "uvx",
      "args": ["mcp-tw-company"]
    }
  }
}

Quick Start

# 環境設定
uv sync

# 測試連線
uv run python scripts/auth/test_connection.py

# 啟動伺服器
uv run python mcp_server.py

Usage Examples

「用名稱搜尋公司」

你: 幫我查「宏碁」相關的公司

AI 呼叫:

get_company_registrations_by_name_keyword(
  company_name_keyword = "宏碁",
  company_status = "01",
)

結果: SUCCESS — 回傳符合條件的公司登記資料,包含公司名稱、統一編號、資本額、代表人、地址等。

「用統編查公司」

你: 統一編號 89845559 是哪家公司?

AI 呼叫:

get_company_registration_master_by_number(
  business_accounting_no = "89845559",
)

結果: SUCCESS — 回傳公司登記主檔:森鉅科技材料股份有限公司,資本額 30 億,位於台南市。

「查董監事」

你: 查一下這家公司的董監事名單

AI 呼叫:

get_company_directors_by_number(
  business_accounting_no = "89845559",
)

結果: SUCCESS — 回傳 9 位董監事的職稱、姓名、法人代表、持股數。

「查營業項目」

你: 這家公司的營業項目有哪些?

AI 呼叫:

get_company_registration_with_business_items_by_number(
  business_accounting_no = "89845559",
)

結果: SUCCESS — 回傳公司資料及 13 項營業登記項目,涵蓋製造業、貿易業、營建業等。

「判斷統編類型」

你: 統編 00208407 是公司還是商號?

AI 呼叫:

get_registry_entity_type_by_number(
  no = "00208407",
)

結果: SUCCESS — 回傳登記類型判斷結果(公司、分公司或商業)。

Available Tools

工具 說明 主要參數
get_company_registrations_by_name_keyword 依名稱關鍵字搜尋公司 company_name_keyword, company_status
get_company_registration_master_by_number 公司登記主檔 business_accounting_no(8 碼)
get_company_registration_with_business_items_by_number 公司登記含營業項目 business_accounting_no(8 碼)
get_company_directors_by_number 董監事資料 business_accounting_no(8 碼)
get_company_name_by_number 統編查公司名稱 business_accounting_no(8 碼)
get_registry_entity_type_by_number 統編類型判斷 no(8 碼)
get_branch_offices_by_company_number 依公司統編查分公司 business_accounting_no(8 碼)
get_business_registration_profile_by_agency 依機關查商業登記 president_no, agency
get_business_registration_items_by_number 商業登記營業項目 president_no(8 碼)

所有工具支援 skip(預設 0)和 top(預設 50)分頁參數。

Todo

  • 介接 公司登記基本資料-應用二:F05D1060-7D57-4763-BDCE-0DAF5975AFE0
  • 介接 統編查商號名稱:855A3C87-003A-4930-AA4B-2F4130D713DC
  • 追查 商業登記關鍵字查詢 上游端點限制:A1B4CBFF-2D3A-409B-8A78-2AD94F63AE4A 目前在此環境回 非授權介接之IP
  • 追查 分公司統編查分公司資料 上游端點限制:23632BB3-5DB7-4423-9643-1D4AC140D479 目前在此環境回 非授權介接之IP

Project Structure

mcp-tw-company/
├── app.py                  # FastMCP 單例
├── mcp_server.py           # 入口(stdio 傳輸)
├── config/settings.py      # API 端點、URL 建構、請求標頭
├── connectors/
│   └── rest_client.py      #   HTTP REST(含重試+分頁)
├── auth/
│   └── none.py             #   無認證(公開 API)
├── tools/
│   └── company_registry_tools.py
├── tests/test_all_tools.py # E2E 測試執行器
└── scripts/auth/test_connection.py

Testing

uv run python scripts/auth/test_connection.py   # 驗證 API 連通性
uv run python tests/test_all_tools.py           # 執行所有工具 E2E 測試

Data Source

目前使用經濟部商業發展署 GCIS 公司登記與商業登記開放資料端點。

Contributing

請參閱 CONTRIBUTING.md 了解開發環境設定與貢獻指南。

License

MIT License — 詳見 LICENSE。