genius WebMCP
Browser tool configuration for genius
URL Pattern: ^https?://genius\.com(/.*)?$
Allowed Extra Domains: genius.com
Tools (1)
genius_search()
Genius 歌曲/歌词搜索
Parameters
query
string
required
- 搜索关键词
JavaScript Handler
(params) => {
const run = async function(args) {
const q = encodeURIComponent(args.query);
const resp = await fetch(`https://genius.com/api/search/multi?q=${q}`);
if (!resp.ok) return { error: 'HTTP ' + resp.status };
const data = await resp.json();
const sections = data?.response?.sections || [];
const songSection = sections.find(s => s.type === 'song') || sections[0];
if (!songSection || !songSection.hits || songSection.hits.length === 0) {
return { query: args.query, count: 0, results: [] };
}
const results = songSection.hits.map(hit => {
const r = hit.result;
return {
title: r.title,
artist: r.primary_artist?.name,
url: r.url,
image: r.song_art_image_url,
pageviews: r.stats?.pageviews || null
};
});
return { query: args.query, count: results.length, results };
};
return run(params || {});
}
🔌 Chrome MCP Server Extension
Use these tools with Claude, ChatGPT, and other AI assistants.
How to Use WebMCP
WebMCP tools are designed for browser extensions or automation frameworks. The browser extension matches the current URL against the pattern and executes the JavaScript handler when the tool is invoked.
API Endpoint:
GET /api/webmcp/match?url=https://www.genius.com/...