A Model Context Protocol (MCP) server built with FastMCP 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file case_search-0.2.0.tar.gz.
File metadata
- Download URL: case_search-0.2.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2116e5ec00fd53576035db069ab531c19fe6801d152dded60b61e6e93b23d33
|
|
| MD5 |
7e9083a5e3eefe079d61e0921dc8cfac
|
|
| BLAKE2b-256 |
f481df9fea5e6650a8c95d00ef19f490aa06deb4db2375757272c7b7891f6604
|
File details
Details for the file case_search-0.2.0-py3-none-any.whl.
File metadata
- Download URL: case_search-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40ccb88f33895cb58ab817839af909d55a1d29be4a0dd7d5bca99053fdfdb872
|
|
| MD5 |
9bc98fd1becc917dd4e8cc6d6be56b98
|
|
| BLAKE2b-256 |
36a6c124ef1381584ef629ce3af5550190b7fc94e47f63ce601d647b6bc38402
|