Skip to content

chew-z/bradio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“» Bradio

A powerful dual-mode CLI tool and MCP server for discovering internet radio stations. Built with Go and powered by the fantastic Radio Browser database.

✨ Features

  • πŸ” Smart Search: Find stations by name or tag with popularity-based sorting
  • πŸ€– AI Integration: MCP server mode for seamless AI assistant integration
  • ⚑ Fast & Lightweight: Single binary with no external dependencies
  • 🎡 Shell-Friendly: Perfect for integration with fzf, mpv, and other tools
  • πŸ“Š Rich Output: Detailed station info including click count, codec, bitrate, and streaming URL

πŸš€ Quick Start

Installation

# Clone and build
git clone <repository-url>
cd bradio
go build -o bin/bradio .

Basic Usage

# Search by station name
bradio --name "Milano Lounge"

# Search by tag/genre
bradio --tag "ambient"

# Limit results
bradio --tag "jazz" --limit 10

# Get help
bradio --help

πŸŽ›οΈ Operating Modes

1. CLI Mode (Default)

Traditional command-line interface for interactive use:

# Search examples
bradio --name "BBC Radio"
bradio --tag "classical" --limit 20
bradio --tag "electronic"

Output Format:

(15420) BBC Radio 1; pop,hits,uk,bbc; MP3[128]; http://stream.live.vc.bbcmedia.co.uk/bbc_radio_one
(8965) Jazz FM; jazz,smooth jazz,uk; AAC[128]; http://edge-audio-01-gos2.sharp-stream.com/jazzmmp3

2. MCP Server Mode

Model Context Protocol server for AI assistant integration:

# Start MCP server
bradio --mcp

Available MCP Tools:

  • search_radio_by_name - Search stations by name
  • search_radio_by_tag - Search stations by tag/genre
  • get_popular_stations - Get most popular stations globally

Example MCP Usage:

# List available tools
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | bradio --mcp

# Search for jazz stations
echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_radio_by_tag","arguments":{"tag":"jazz","limit":5}}}' | bradio --mcp

🎡 Integration Examples

With fzf + mpv (Interactive Radio Player)

# One-liner for quick radio browsing
bradio --tag 'lounge' | fzf --nth 1 --preview="echo {}" --preview-window=bottom:2:nohidden | awk -F $'; ' '{print $4}' | mpv --playlist=-

# Create a handy function
function br() { 
    bradio "$@" | fzf --nth 1 --preview='echo {}' --preview-window=bottom:2:nohidden | awk -F $'; ' '{print $4}' | mpv --playlist=- 
}

# Use the function
br --tag 'chillout' --limit 50

With AI Assistants (MCP Mode)

# Configure Claude/GPT to use bradio as MCP server
# Add to your AI assistant's MCP configuration:
{
  "servers": {
    "bradio": {
      "command": "/path/to/bradio",
      "args": ["--mcp"]
    }
  }
}

πŸ› οΈ Development

Building

go build -o bin/bradio .

Testing

./run_test.sh
# or directly:
go test -v ./...

Linting

./run_lint.sh

Formatting

./run_format.sh

πŸ“š Command Reference

CLI Flags

Flag Description Default
--name Search stations by name -
--tag Search stations by tag/genre -
--limit Maximum number of results 12
--help Show help information -
--mcp Run as MCP server -

Search Tips

  • Popular genres: jazz, classical, rock, electronic, ambient, news, talk
  • Language tags: english, french, german, spanish, italian
  • Country codes: uk, usa, france, germany, italy
  • Combine terms: Use specific tags like smooth jazz, deep house, indie rock

🌐 Data Source

Bradio is powered by the excellent Radio Browser - a community-driven database of internet radio stations. Radio Browser provides:

  • 🌍 Global Coverage: Thousands of stations worldwide
  • πŸ†“ Free & Open: No API keys or registration required
  • πŸ“Š Rich Metadata: Detailed station information and statistics
  • πŸ”„ Live Updates: Community-maintained, always current
  • πŸš€ High Performance: Fast, reliable API infrastructure

Special thanks to the Radio Browser team and community for maintaining this fantastic resource!

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   CLI Mode      β”‚    β”‚   Core Logic     β”‚    β”‚  MCP Server     β”‚
β”‚                 β”‚    β”‚                  β”‚    β”‚     Mode        β”‚
β”‚ β€’ Flag parsing  │───▢│ β€’ Radio search   │◀───│ β€’ Tools         β”‚
β”‚ β€’ Direct output β”‚    β”‚ β€’ Data formattingβ”‚    β”‚ β€’ Resources     β”‚
β”‚ β€’ Error handlingβ”‚    β”‚ β€’ API calls      β”‚    β”‚ β€’ Transport     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚ Radio-Browser    β”‚
                    β”‚      API         β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Radio Browser - For providing the incredible radio station database
  • goradios - Go library for Radio Browser API
  • mcp-go - Go implementation of Model Context Protocol

About

commandline tool and MCP server for searching stations with radio-browser API

Topics

Resources

License

Stars

Watchers

Forks

Languages