Skip to main content

A Model Context Protocol (MCP) server for querying case information from CSV files

Project description

Case Search MCP Server

這是一個 Model Context Protocol (MCP) server,用於查詢 CSV 檔案中的案件資訊。

功能

  • 根據案件編號 (case_id) 查詢案件資訊
  • 以 JSON 格式回傳完整的案件資料
  • 支援透過 stdio 與 MCP 客戶端通訊

安裝

從 PyPI 安裝(推薦)

# 使用 uvx 直接執行(不需要安裝)
uvx case-search

# 或安裝到本地環境
pip install case-search

從原始碼安裝

# 複製專案
git clone https://github.com/plion818/case-search.git
cd case-search

# 使用 uv 安裝相依套件
uv pip install -e .

使用方式

方式一:透過 uvx 執行(推薦)

最簡單的方式,不需要事先安裝:

uvx case-search

方式二:本地安裝後執行

# 安裝後執行
pip install case-search
case-search

方式三:在 Claude Desktop 中使用

編輯 Claude Desktop 設定檔,加入以下內容:

Windows: %APPDATA%\Claude\claude_desktop_config.json

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

使用已發佈的套件(推薦):

{
  "mcpServers": {
    "case-search": {
      "command": "uvx",
      "args": ["case-search"]
    }
  }
}

使用本地開發版本:

{
  "mcpServers": {
    "case-search": {
      "command": "uvx",
      "args": [
        "--from",
        "c:\\Users\\plion818\\2. Learn\\MCP\\case_search",
        "case-search"
      ]
    }
  }
}

或使用絕對路徑指定 Python 執行檔:

{
  "mcpServers": {
    "case-search": {
      "command": "uv",
      "args": [
        "--directory",
        "c:\\Users\\plion818\\2. Learn\\MCP\\case_search",
        "run",
        "case-search"
      ]
    }
  }
}

工具說明

search_case

根據案件編號查詢案件資訊。

輸入參數:

  • case_id (string, 必填): 案件編號,例如 "2023-0001", "2024-0002", "2025-0001"

輸出範例:

{
  "case_id": "2025-0001",
  "taxpayer_name": "建宏科技股份有限公司",
  "taxpayer_id": "11122233",
  "tax_type": "營所稅",
  "declaration_type": "結算申報",
  "filing_date": "2025-05-31",
  "declared_amount": 1250000,
  "assessed_amount": 1300000,
  "status": "核定",
  "handler": "王大明",
  "jurisdiction": "中區國稅局臺中分局",
  "last_updated": "2025-09-15 14:20:00"
}

如果找不到案件,會回傳錯誤訊息:

{
  "error": "找不到案件編號 2099-0001 的資料"
}

資料檔案

案件資料儲存在專案根目錄的 data.csv 檔案中,包含以下欄位:

  • case_id: 案件編號
  • taxpayer_name: 納稅人名稱
  • taxpayer_id: 稅籍編號
  • tax_type: 稅目
  • declaration_type: 申報類型
  • filing_date: 申報日期
  • declared_amount: 申報金額
  • assessed_amount: 核定金額
  • status: 案件狀態
  • handler: 承辦人
  • jurisdiction: 管轄機關
  • last_updated: 最後更新時間

開發

本專案使用 Python 3.10+ 和以下主要套件:

  • mcp[cli] >= 1.24.0
  • pandas >= 2.0.0

授權

此專案由 plion818 開發維護。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

case_search-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

case_search-0.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file case_search-0.1.0.tar.gz.

File metadata

  • Download URL: case_search-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for case_search-0.1.0.tar.gz
Algorithm Hash digest
SHA256 48e6220f8482fec61f3d7e750b113c6a234685abba016a148ef9489fe987ad54
MD5 745048341eb78a9432f19171a6fee0f8
BLAKE2b-256 65d83171039a6f208933dedaae1077e71924f5bcca762c215b68b7ebea3e8618

See more details on using hashes here.

File details

Details for the file case_search-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for case_search-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 184ebea531ec5affae598f5f7767801bef30809b5917aedcade213ce56bea39f
MD5 7436af771b762aa6a643a96738c6f41a
BLAKE2b-256 e3c7ea0866a0cc00a6da967314d76f1530f4b5c4ec61ac9f7850fd2a7c1aef9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page