A Model Context Protocol (MCP) server designed for interacting with the Genius API. This server enables LLMs and AI applications to search for songs, artists, fetch lyrics, and retrieve metadata from Genius.com through a standardized MCP interface.
The Genius MCP Server provides a bridge between AI applications and the Genius API, allowing seamless access to one of the world's largest databases of song lyrics and music metadata. The server is designed to be deployed on Cloudflare Workers, providing a scalable and performant solution for music-related queries.
Note: Since Genius.com's API doesn't provide lyrics directly, the server fetches the HTML of the song's page and scrapes the lyrics from it.
Response Format: All tools and resources return data in JSON format for easy programmatic consumption.
The server exposes the following tools that enable LLMs to execute actions or search for information:
-
genius-search-song- Search for songs, artists, or web pages in Genius- Parameters:
q(string) - The search query - Returns: JSON with search results including songs, artists, and web pages
- Parameters:
-
genius-song-lyrics- Get a song's lyrics and complete metadata by song ID- Parameters:
songId(number) - The Genius song ID - Returns: JSON with complete song data including lyrics, metadata, producers, writers, samples, etc.
- Parameters:
-
genius-list-artist-songs- List songs of an artist by their ID- Parameters:
artistId(number, required) - The Genius artist IDsort(optional) - "title" or "popularity"page(optional) - Page number for paginationperPage(optional) - Results per page (max 50)
- Returns: JSON with list of songs and pagination info
- Parameters:
The server provides the following resources that can be accessed via URI (all return JSON format):
-
genius-artist- Artist information accessible viagenius://artists/{id}- Returns: JSON with artist ID, name, URL, and description
-
genius-song- Song metadata accessible viagenius://songs/{id}- Returns: JSON with song metadata (title, artist, album, stats, producers, writers, samples) without lyrics
-
genius-song-lyrics- Song lyrics and metadata accessible viagenius://songs/{id}/lyrics- Returns: JSON with complete song data including lyrics (scraped from HTML)
genius-search-prompt- Helper prompt to prepare a query for searching Genius- Parameters:
initialQuery(string, optional) - An initial search term to include
- Parameters:
To use this MCP server, you need:
-
A Genius API key (Client Access Token)
- Sign up at https://genius.com/api-clients
- Create a new API client to obtain your access token
-
A Cloudflare account (for deployment)
- Sign up at https://dash.cloudflare.com/
- Clone this repository:
git clone <repository-url>
cd genius-mcp- Install dependencies:
npm install-
Configure your Genius API key:
- Add your Genius API key to your Cloudflare Workers environment variables
- Or configure it in
wrangler.tomlfor local development
-
Run locally (development):
npm run dev - Deploy to Cloudflare Workers:
npm run deployRun the server locally:
npm run devThis will start a local development server that you can test with MCP clients.
npm run type-checknpm run lint # Run ESLint
npm run lint:fix # Run ESLint with auto-fix
npm run lint:biome # Run Biome linter
npm run format # Format code with Biome- Deploy your server to Cloudflare Workers
- Go to https://playground.ai.cloudflare.com/
- Enter your deployed MCP server URL (e.g.,
genius-mcp.<your-account>.workers.dev/sse) - Use the Genius tools directly from the playground
- Run the server locally
- In another terminal window, run
DANGEROUSLY_OMIT_AUTH=true npx @modelcontextprotocol/inspector@latest - In the inspector, enter the URL of the local server (e.g.,
http://localhost:8787/sse)
You can connect to your remote MCP server from Claude Desktop using the mcp-remote proxy.
- Follow Anthropic's Quickstart
- In Claude Desktop, go to Settings > Developer > Edit Config
- Add your server configuration:
{
"mcpServers": {
"genius": {
"command": "npx",
"args": [
"mcp-remote",
"https://genius-mcp.<your-account>.workers.dev/sse"
]
}
}
}- Restart Claude Desktop
For detailed information about the Genius API endpoints and data structures, refer to the official Genius API documentation.
This MCP server is built using:
- Model Context Protocol SDK - For MCP server implementation
- Cloudflare Workers - For serverless deployment
- Zod - For schema validation
[Add your license here]
[Add contribution guidelines here]
For issues and questions:
- Open an issue on GitHub
- Check the Genius API documentation
- Review the MCP documentation