LyricsGenius MCP Server

LyricsGenius MCP Server

site icon
2025.05.10 0
Python音乐服务歌词检索娱乐功能
LyricsGenius MCP Server 是一个基于 Model Context Protocol (MCP) 的服务,用于通过 LyricsGenius 库访问 Genius.com 上的歌曲歌词和艺术家信息。该服务提供了搜索艺术家和歌曲、获取艺术家详细信息、检索歌词、获取艺术家专辑和热门歌曲等功能。
View on GitHub

Overview

基本能力

产品定位

LyricsGenius MCP Server 是一个用于访问 Genius.com 上歌曲歌词和艺术家信息的服务,适用于需要获取音乐相关数据的应用场景。

核心功能

  • 搜索 Genius.com 上的艺术家、歌曲、专辑等内容
  • 获取艺术家的详细信息
  • 检索歌曲的歌词
  • 获取艺术家的专辑和热门歌曲
  • 获取专辑的曲目列表

适用场景

  • 音乐应用需要显示歌词
  • 音乐数据分析
  • 艺术家信息展示
  • 音乐推荐系统

工具列表

  • search(query, search_type=None, per_page=10, page=1) - 在 Genius 上搜索艺术家、歌曲、专辑等内容
  • get_lyrics(title, artist=None) - 直接获取歌曲的歌词
  • get_artist_songs(artist_identifier, per_page=20, sort="popularity") - 获取艺术家的歌曲
  • get_artist_albums(artist_identifier) - 获取艺术家的专辑
  • get_album_tracks(album_identifier) - 通过专辑 ID 或名称获取专辑的曲目

常见问题解答

  • 需要 Python 3.8+ 和 LyricsGenius API token
  • API token 可以从 https://genius.com/api-clients 获取

使用教程

使用依赖

  • Python 3.8+
  • LyricsGenius API token

安装教程

  1. 克隆仓库 git clone <repository-url> cd lyricsgenius-mcp

  2. 创建虚拟环境 uv venv source .venv/bin/activate # Windows: .venv\Scripts\activate

  3. 安装依赖 uv pip install -r requirements.txt

  4. 设置 Genius API token

  5. 复制 .env 文件并重命名为 .env
  6. your_token_here 替换为实际的 Genius API token

调试方式

  • 直接运行服务器 python server.py

  • 在 Claude Desktop 中安装 mcp install server.py

  • 使用 MCP 开发工具运行 mcp dev server.py

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。