MiniMax-AI / MiniMax-AI/MiniMax-MCP

refactor: split monolithic server.py (800+ lines) into separate tool modules

Open
#68 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.6k
Forks
284
PR merge metrics
No merged PRs in 30d

Description

Problem

minimax_mcp/server.py is a single 800+ line file containing all tool definitions, configuration, and the MCP server setup. This makes it hard to navigate, test, and maintain.

Current structure

minimax_mcp/
├── __init__.py      # 2 lines
├── __main__.py      # config generator
├── client.py        # API client (good, already separated)
├── const.py         # constants (good, already separated)
├── exceptions.py    # exceptions (good, already separated)
├── server.py        # 800+ lines — ALL tools + config + server setup
└── utils.py         # utilities (good, already separated)

Proposed structure

minimax_mcp/
├── __init__.py
├── __main__.py
├── client.py
├── const.py
├── exceptions.py
├── server.py        # ~50 lines — MCP setup, config, imports tools
├── utils.py
└── tools/
    ├── __init__.py  # exports all tool functions
    ├── audio.py     # text_to_audio, play_audio, list_voices
    ├── video.py     # generate_video, query_video_generation
    ├── image.py     # text_to_image
    ├── music.py     # music_generation
    └── voice.py     # voice_clone, voice_design

Benefits

  • Each tool module is independently testable
  • Easier to add new tools without touching a massive file
  • Clear separation of concerns
  • Reduces merge conflicts when multiple contributors work on different tools

Implementation notes

  • Each tool module receives mcp, api_client, base_path, resource_mode as module-level or injected dependencies
  • server.py imports and registers all tools
  • No behavior change — purely structural refactor

Acceptance criteria

  • server.py reduced to <100 lines
  • Each tool in its own module
  • All existing tests pass
  • uvx minimax-mcp works identically

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading minimax_mcp/server.py and the existing project tests to map the current tool definitions, configuration, and MCP setup. Separate the tools into the proposed modules under minimax_mcp/tools/ while preserving behavior, then run all existing tests and verify that uvx minimax-mcp works identically; done means server.py is under 100 lines and every tool has its own module.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.