A Model Context Protocol (MCP) server for BirdNET-Pi. Reads detection data directly from BirdNET-Pi's SQLite database and serves audio files from the extracted clips directory.
This is designed to run on the Raspberry Pi that hosts BirdNET-Pi, exposed over HTTP, and accessed remotely by Claude Code (or any MCP-compatible client) over your local network.
The server runs on your Pi and speaks streamable-HTTP. Claude Code on your laptop connects to it over the network — no SSH tunneling, no local install of BirdNET-Pi data required.
[Claude Code on laptop] --HTTP--> [mcp-server on Pi:8090] --reads--> [birds.db + audio files]
~/BirdNET-Pi/scripts/birds.db, ~/BirdSongs/Extracted/)Clone the repo on your Pi:
git clone https://github.com/<your-fork>/mcp-birdnet-pi-server ~/BirdNET-Pi/mcp-local-server
cd ~/BirdNET-Pi/mcp-local-server
Run it:
MCP_HTTP_HOST=0.0.0.0 MCP_HTTP_PORT=8090 ./run.sh
run.sh creates a virtualenv, installs dependencies, and starts the server. After the first run, subsequent starts are fast.
To run it in the background and persist across reboots, add a cron @reboot entry or a systemd unit pointing to run.sh with the env vars set.
| Variable | Default | Description |
|---|---|---|
MCP_HTTP_HOST | 127.0.0.1 | Bind address. Use 0.0.0.0 to accept LAN connections. |
MCP_HTTP_PORT | 8090 | Port to listen on. |
BIRDNET_DB | ~/BirdNET-Pi/scripts/birds.db | Path to BirdNET-Pi SQLite database. |
BIRDNET_AUDIO_DIR | ~/BirdSongs/Extracted/ | Path to extracted audio clips. |
BIRDNET_REPORT_DIR | ~/BirdSongs/reports/ | Path to write generated reports. |
On your laptop, add the server once:
claude mcp add --transport http birdnet http://<pi-ip>:8090/mcp
Replace <pi-ip> with your Pi's local IP (e.g. 192.168.1.107). The config persists — you don't need to re-run this after the server restarts.
get_detectionsDetections filtered by date range and optional species.
start_date (required): YYYY-MM-DDend_date (required): YYYY-MM-DDspecies (optional): partial match, case-insensitiveget_statsAggregate statistics for a time period.
period (required): day, week, month, or allmin_confidence (optional): float 0.0–1.0, default 0.0get_audioAudio file for a specific detection.
filename (required): File_Name value from a detection recordformat (optional): base64 (default) or bufferget_activityHourly detection counts for a specific day.
date (required): YYYY-MM-DDspecies (optional): partial match, case-insensitivegenerate_reportDetection report for a date range.
start_date (required): YYYY-MM-DDend_date (required): YYYY-MM-DDformat (optional): json (default) or htmlReads directly from BirdNET-Pi's SQLite database:
CREATE TABLE detections (
Date DATE,
Time TIME,
Sci_Name VARCHAR(100),
Com_Name VARCHAR(100),
Confidence FLOAT,
...
File_Name VARCHAR(100)
);
No JSON export or intermediate files required.
MIT
7 commits
1 commits
Python
67.2%
HTML
20.1%
JavaScript
6.5%
Shell
4.0%
Dockerfile
2.2%
A Model Context Protocol (MCP) server for BirdNET-Pi. Reads detection data directly from BirdNET-Pi's SQLite database and serves audio files from the extracted clips directory.
This is designed to run on the Raspberry Pi that hosts BirdNET-Pi, exposed over HTTP, and accessed remotely by Claude Code (or any MCP-compatible client) over your local network.
The server runs on your Pi and speaks streamable-HTTP. Claude Code on your laptop connects to it over the network — no SSH tunneling, no local install of BirdNET-Pi data required.
[Claude Code on laptop] --HTTP--> [mcp-server on Pi:8090] --reads--> [birds.db + audio files]
~/BirdNET-Pi/scripts/birds.db, ~/BirdSongs/Extracted/)Clone the repo on your Pi:
git clone https://github.com/<your-fork>/mcp-birdnet-pi-server ~/BirdNET-Pi/mcp-local-server
cd ~/BirdNET-Pi/mcp-local-server
Run it:
MCP_HTTP_HOST=0.0.0.0 MCP_HTTP_PORT=8090 ./run.sh
run.sh creates a virtualenv, installs dependencies, and starts the server. After the first run, subsequent starts are fast.
To run it in the background and persist across reboots, add a cron @reboot entry or a systemd unit pointing to run.sh with the env vars set.
| Variable | Default | Description |
|---|---|---|
MCP_HTTP_HOST | 127.0.0.1 | Bind address. Use 0.0.0.0 to accept LAN connections. |
MCP_HTTP_PORT | 8090 | Port to listen on. |
BIRDNET_DB | ~/BirdNET-Pi/scripts/birds.db | Path to BirdNET-Pi SQLite database. |
BIRDNET_AUDIO_DIR | ~/BirdSongs/Extracted/ | Path to extracted audio clips. |
BIRDNET_REPORT_DIR | ~/BirdSongs/reports/ | Path to write generated reports. |
On your laptop, add the server once:
claude mcp add --transport http birdnet http://<pi-ip>:8090/mcp
Replace <pi-ip> with your Pi's local IP (e.g. 192.168.1.107). The config persists — you don't need to re-run this after the server restarts.
get_detectionsDetections filtered by date range and optional species.
start_date (required): YYYY-MM-DDend_date (required): YYYY-MM-DDspecies (optional): partial match, case-insensitiveget_statsAggregate statistics for a time period.
period (required): day, week, month, or allmin_confidence (optional): float 0.0–1.0, default 0.0get_audioAudio file for a specific detection.
filename (required): File_Name value from a detection recordformat (optional): base64 (default) or bufferget_activityHourly detection counts for a specific day.
date (required): YYYY-MM-DDspecies (optional): partial match, case-insensitivegenerate_reportDetection report for a date range.
start_date (required): YYYY-MM-DDend_date (required): YYYY-MM-DDformat (optional): json (default) or htmlReads directly from BirdNET-Pi's SQLite database:
CREATE TABLE detections (
Date DATE,
Time TIME,
Sci_Name VARCHAR(100),
Com_Name VARCHAR(100),
Confidence FLOAT,
...
File_Name VARCHAR(100)
);
No JSON export or intermediate files required.
MIT
7 commits
1 commits
Python
67.2%
HTML
20.1%
JavaScript
6.5%
Shell
4.0%
Dockerfile
2.2%