鸟网Pi MCP服务器是一个基于Python的模型上下文协议(MCP)服务器,专为鸟网Pi集成而设计。它能助力用户过滤检索鸟类检测数据、开展检测统计分析、访问音频录音等,为鸟类研究和监测提供有力支持。
本服务器是基于Python的模型上下文协议(MCP)服务器,用于鸟网Pi的集成。以下是使用前的准备步骤。
git clone https://github.com/YourUsername/mcp-server.git
cd mcp-server
python -m venv venv
source venv/bin/activate # 在Windows上使用:venv\Scripts\activate
pip install -r requirements.txt
mkdir -p data/audio data/reports
服务器可以通过环境变量进行配置:
BIRDNET_DETECTIONS_FILE:检测JSON文件的路径(默认值:'data/detections.json')BIRDNET_AUDIO_DIR:音频文件目录的路径(默认值:'data/audio')BIRDNET_REPORT_DIR:报告目录的路径(默认值:'data/reports')启动服务器:
python server.py
服务器将在http://localhost:8000上运行。
/functions - 列出可用函数(GET)/invoke - 调用一个函数(POST)getBirdDetections
startDate,endDate,species(可选)getDetectionStats
period('day','week','month','all'),minConfidence(可选)getAudioRecording
filename,format('base64'或'buffer')getDailyActivity
date,species(可选)generateDetectionReport
startDate,endDate,format('html'或'json')mcp-server/
├── birdnet/
│ ├── __init__.py
│ ├── config.py
│ ├── functions.py
│ └── utils.py
├── data/
│ ├── audio/
│ └── reports/
├── server.py
├── requirements.txt
└── README.md