mcp local server
A Python-based server that enables accessing and analyzing bird detection data through the Model Context Protocol, offering features like filtering detections, accessing audio recordings, and generating reports.
A Python-based server that enables accessing and analyzing bird detection data through the Model Context Protocol, offering features like filtering detections, accessing audio recordings, and generating reports.
A Python-based Model Context Protocol (MCP) server for BirdNet-Pi integration.
requirements.txt
Clone the repository:
git clone https://github.com/YourUsername/mcp-server.git
cd mcp-server
Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate # On Windows use: venvScriptsactivate
Install dependencies:
pip install -r requirements.txt
Set up your data directories:
mkdir -p data/audio data/reports
The server can be configured using environment variables:
- BIRDNET_DETECTIONS_FILE
: Path to detections JSON file (default: 'data/detections.json')
- BIRDNET_AUDIO_DIR
: Path to audio files directory (default: 'data/audio')
- BIRDNET_REPORT_DIR
: Path to reports directory (default: 'data/reports')
Start the server:
python server.py
The server will run on http://localhost:8000
.
/functions
- List available functions (GET)/invoke
- Invoke a function (POST)getBirdDetections
Parameters: startDate, endDate, species (optional)
getDetectionStats
Parameters: period ('day', 'week', 'month', 'all'), minConfidence (optional)
getAudioRecording
Parameters: filename, format ('base64' or 'buffer')
getDailyActivity
Parameters: date, species (optional)
generateDetectionReport
mcp-server/
├── birdnet/
│ ├── __init__.py
│ ├── config.py
│ ├── functions.py
│ └── utils.py
├── data/
│ ├── audio/
│ └── reports/
├── server.py
├── requirements.txt
└── README.md