A Model Context Protocol (MCP) server for BirdNET-Pi integration. Provides tools to query bird detection data, statistics, audio recordings, activity patterns, and reports from a local BirdNET-Pi installation.
pip install -r requirements.txt
Or with uv:
uv pip install -r requirements.txt
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)python server.py
MCP_TRANSPORT=http python server.py
Or with custom host/port:
MCP_TRANSPORT=http MCP_HTTP_HOST=0.0.0.0 MCP_HTTP_PORT=8000 python server.py
docker build -t mcp-birdnet-pi-server .
docker run -p 8000:8000 -v /path/to/data:/app/data mcp-birdnet-pi-server
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"birdnet": {
"command": "python",
"args": ["/absolute/path/to/mcp-BirdNET-Pi-server/server.py"]
}
}
}
get_detectionsGet bird detections filtered by date range and optional species.
start_date (required): Start date in YYYY-MM-DD formatend_date (required): End date in YYYY-MM-DD formatspecies (optional): Species name filter (partial match, case-insensitive)get_statsGet aggregate detection statistics for a time period.
period (required): day, week, month, or allmin_confidence (optional): Minimum confidence threshold 0.0-1.0 (default: 0.0)get_audioRetrieve the audio recording for a specific bird detection.
filename (required): Audio filename from a detection recordformat (optional): base64 (default) or bufferget_activityGet hourly bird activity patterns for a specific day.
date (required): Date in YYYY-MM-DD formatspecies (optional): Species name filtergenerate_reportGenerate a detection report for a date range.
start_date (required): Report start dateend_date (required): Report end dateformat (optional): json (default) or htmlpython -m pytest test_server.py -v
mcp-BirdNET-Pi-server/
├── birdnet/
│ ├── __init__.py
│ ├── config.py
│ ├── functions.py
│ └── utils.py
├── data/
│ └── detections.json
├── server.py
├── test_server.py
├── Dockerfile
├── requirements.txt
└── README.md
MIT
Last updated: 2026-03-23
Model Context Protocol (MCP) is still one of the most useful interoperability layers for tools and agents. The tradeoff is that large MCP servers can expose many tools, and naive tool-calling can flood context windows with schemas, tool chatter, and irrelevant call traces.
In practice, “more tools” is not always “better outcomes.” Tool surface area must be paired with execution patterns that keep token use bounded and behavior predictable.
Recent workflows increasingly move complex orchestration out of chat context and into code execution loops. This reduces repetitive schema tokens and makes tool usage auditable and testable.
Core reading:
Prompt injection remains an open security problem for tool-using agents. It is manageable, but not “solved.”
Primary risks:
Mitigation baseline:
Treat every tool output as untrusted input unless explicitly verified.