Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
|`voice_clone`|根据指定音频文件克隆音色|
|`generate_video`|根据指定 prompt 生成视频|
|`text_to_image`|根据指定 prompt 生成图片|
|`lyrics_generation`|根据描述提示词生成歌词|
|`music_generation`|根据指定 prompt 和歌词生成音乐|
|`voice_design`|根据指定 prompt 生成音色和试听文本|

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ We support two transport types: stdio and sse.
|`generate_video`|Generate a video from a prompt|
|`text_to_image`|Generate a image from a prompt|
|`query_video_generation`|Query the result of video generation task|
|`lyrics_generation`|Generate song lyrics from a description prompt|
|`music_generation`|Generate a music track from a prompt and lyrics|
|`voice_design`|Generate a voice from a prompt using preview text|

Expand Down
1 change: 1 addition & 0 deletions minimax_mcp/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
DEFAULT_VOICE_ID = "female-shaonv"
DEFAULT_SPEECH_MODEL = "speech-2.6-hd"
DEFAULT_MUSIC_MODEL = "music-2.0"
DEFAULT_LYRICS_MODEL = "lyrics-01"
DEFAULT_SPEED = 1.0
DEFAULT_VOLUME = 1.0
DEFAULT_PITCH = 0
Expand Down
54 changes: 54 additions & 0 deletions minimax_mcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,60 @@ def text_to_image(
text=f"Failed to save images: {str(e)}"
)

@mcp.tool(
description="""Generate song lyrics from a description prompt using AI.

COST WARNING: This tool makes an API call to Minimax which may incur costs.
Only use when explicitly requested by the user.

Args:
prompt (str): Description of the song style, mood, theme, etc.
Example: "A melancholic ballad about rainy nights in the city"
type (int, optional): Generation type. 1 = generate full lyrics,
2 = edit/refine existing lyrics. Defaults to 1.
lyrics (str, optional): Existing lyrics to refine (required when type=2).

Returns:
Text content with the generated lyrics including structure tags.
"""
)
def lyrics_generation(
prompt: str,
type: int = 1,
lyrics: str = None,
) -> TextContent:
try:
if not prompt:
raise MinimaxRequestError("Prompt is required.")

payload = {
"model": DEFAULT_LYRICS_MODEL,
"prompt": prompt,
"type": type,
}
if lyrics is not None:
payload["lyrics"] = lyrics

response_data = api_client.post("/v1/lyrics_generation", json=payload)

data = response_data.get("data", {})
generated_lyrics = data.get("lyrics", "")

if not generated_lyrics:
raise MinimaxRequestError("No lyrics generated")

return TextContent(
type="text",
text=f"Success. Generated lyrics:\n{generated_lyrics}",
)

except MinimaxAPIError as e:
return TextContent(
type="text",
text=f"Failed to generate lyrics: {str(e)}"
)


@mcp.tool(
description="""Create a music generation task using AI models. Generate music from prompt and lyrics.

Expand Down