✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more

BirdNet-Pi MCP Server

A Python-based Model Context Protocol (MCP) server for BirdNet-Pi integration.

Features

  • Bird detection data retrieval with date and species filtering
  • Detection statistics and analysis
  • Audio recording access
  • Daily activity patterns
  • Report generation

Requirements

  • Python 3.8+
  • FastAPI
  • Uvicorn
  • Other dependencies listed in requirements.txt

Installation

  1. Clone the repository:
git clone https://github.com/YourUsername/mcp-server.git
cd mcp-server
  1. Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate  # On Windows use: venvScriptsactivate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up your data directories:
mkdir -p data/audio data/reports

Configuration

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’)

Running the Server

Start the server:

python server.py

The server will run on http://localhost:8000.

API Endpoints

  • /functions - List available functions (GET)
  • /invoke - Invoke a function (POST)

Available Functions

  1. getBirdDetections

    • Get bird detections filtered by date range and species
    • Parameters: startDate, endDate, species (optional)
  2. getDetectionStats

    • Get detection statistics for a time period
    • Parameters: period (β€˜day’, β€˜week’, β€˜month’, β€˜all’), minConfidence (optional)
  3. getAudioRecording

    • Get audio recording for a detection
    • Parameters: filename, format (β€˜base64’ or β€˜buffer’)
  4. getDailyActivity

    • Get bird activity patterns for a specific day
    • Parameters: date, species (optional)
  5. generateDetectionReport

    • Generate a report of detections
    • Parameters: startDate, endDate, format (β€˜html’ or β€˜json’)

Directory Structure

mcp-server/
β”œβ”€β”€ birdnet/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ config.py
β”‚   β”œβ”€β”€ functions.py
β”‚   └── utils.py
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ audio/
β”‚   └── reports/
β”œβ”€β”€ server.py
β”œβ”€β”€ requirements.txt
└── README.md

Featured Templates

View More
Verified Icon
AI Agents
AI Chatbot Starter Kit
1336 8300 5.0
Customer service
Multi-language AI Translator
136 921
Customer service
AI-Powered Product List Manager
153 868
Verified Icon
AI Assistants
Speech to Text
137 1882
AI Characters
Your Speaking Avatar
169 928

Start your free trial

Build your solution today. No credit card required.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.