Modelscope Mcp Server

by modelscope

585 downloads
Not rated
GitHub

About

A MCP server that integrates with ModelScope's ecosystem, providing seamless access to AI models, datasets, apps, papers, and generation capabilities through popular MCP clients.

Details

Author
modelscope
Downloads
585
Categories
Other

- Retrieve information about the currently authenticated ModelScope user
- Generate images from text prompts or transform existing images (text-to-image and image-to-image)
- Search for machine learning models with advanced filtering (task type, author, inference support)
- Search for arXiv papers indexed in ModelScope with comprehensive metadata
- Documentation search and Gradio API integration (both coming soon)

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Modelscope Mcp Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install and run via uvx modelscope-mcp-server or the pre-built Docker image spadrian/modelscope-mcp-server. Configure your MCP client (e.g., Claude Desktop, Cursor, VS Code, Cherry Studio) with the appropriate JSON, setting the environment variable MODELSCOPE_API_TOKEN to your ModelScope API token. The server supports stdio (default), HTTP, and SSE transports; for HTTP/SSE use --transport http and optionally --port.

get_current_user

Get current authenticated user information from ModelScope. Use this when a request is about the user's own profile for ModelScope. Or when information is missing to build other tool calls.

get_environment_info

Get current MCP server environment information. Returns version information for the server, FastMCP framework, MCP protocol, and Python runtime. Useful for debugging and compatibility checking.

search_models

Search for models on ModelScope.

search_datasets

Search for datasets on ModelScope.

search_studios

Search for studios on ModelScope.

search_papers

Search for papers on ModelScope.

search_mcp_servers

Search for MCP servers on ModelScope.

get_mcp_server_detail

Get detailed information about a specific MCP server.

generate_image

Generate an image based on the given text prompt and ModelScope AIGC model ID. Supports both text-to-image and image-to-image generation.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "modelscope mcp server": {
            "modelscope-mcp-server": {
                "command": "uvx",
                "args": [
                    "modelscope-mcp-server"
                ],
                "env": {
                    "MODELSCOPE_API_TOKEN": "your-api-token"
                }
            }
        }
    }
}

McpServers

{
    "modelscope-mcp-server": {
        "command": "uvx",
        "args": [
            "modelscope-mcp-server"
        ],
        "env": {
            "MODELSCOPE_API_TOKEN": "your-api-token"
        }
    }
}

ModelScope MCP Server

PyPI - Version
Docker
Docker Hub
License

A Model Context Protocol (MCP) server that integrates with ModelScope's ecosystem, providing seamless access to AI models, datasets, apps, papers, and generation capabilities through popular MCP clients.

✨ Features

- 🔐 User Authentication - Retrieve information about the currently authenticated ModelScope user
- 🎨 AI Image Generation - Generate images from text prompts or transform existing images using AIGC models (supports both text-to-image and image-to-image generation)
- 🔍 Model Search - Search for machine learning models on ModelScope with advanced filtering options (task type, author, inference support, etc.)
- 📚 Research Paper Search - Search for arXiv papers indexed in ModelScope with comprehensive metadata
- 📖 Documentation Search _(Coming Soon)_ - Semantic search for ModelScope documentation and articles
- 🚀 Gradio API Integration _(Coming Soon)_ - Invoke Gradio APIs exposed by any pre-configured ModelScope studio

🚀 Quick Start

1. Get Your API Token

1. Visit ModelScope and sign in to your account
2. Navigate to [Home] → [Access Tokens] to retrieve your default API token or create a new one

> 📖 For detailed instructions, refer to the ModelScope Token Documentation

2. Integration with MCP Clients

Add the following JSON configuration to your MCP client's configuration file:

{
  "mcpServers": {
    "modelscope-mcp-server": {
      "command": "uvx",
      "args": ["modelscope-mcp-server"],
      "env": {
        "MODELSCOPE_API_TOKEN": "your-api-token"
      }
    }
  }
}

Or, you can use the pre-built Docker image:

{
  "mcpServers": {
    "modelscope-mcp-server": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "-e", "MODELSCOPE_API_TOKEN",
        "spadrian/modelscope-mcp-server:latest"
      ],
      "env": {
        "MODELSCOPE_API_TOKEN": "your-api-token"
      }
    }
  }
}

Refer to the MCP JSON Configuration Standard for more details.

This format is widely adopted across the MCP ecosystem:

- Cherry Studio: See Cherry Studio MCP Configuration
- Claude Desktop: Uses ~/.claude/claude_desktop_config.json
- Cursor: Uses ~/.cursor/mcp.json
- VS Code: Uses workspace .vscode/mcp.json
- Other clients: Many MCP-compatible applications follow this standard

🛠️ Development

Environment Setup

1. Clone and Setup:

   git clone https://github.com/modelscope/modelscope-mcp-server.git
   cd modelscope-mcp-server
   uv sync
   

2. Activate Environment:

   source .venv/bin/activate  # Linux/macOS
   # or via your IDE
   

3. Set Your API Token Environment Variable:

   export MODELSCOPE_API_TOKEN="your-api-token"
   

Or, you can set the API token in the .env file (under the project root) for convenience:

   MODELSCOPE_API_TOKEN="your-api-token"
   

Running the Demo Script

Run a quick demo to explore the server's capabilities:

uv run python demo.py

Use the --full flag to demonstrate all available features:

uv run python demo.py --full

Running the Server Locally

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.