ModelScope MCP Server
Enables AI agents and chatbots to access ModelScope's ecosystem of AI resources, including image generation, resource discovery, and more through conversational interactions.
README
ModelScope MCP Server
English | 中文
Empowers AI agents and chatbots with direct access to ModelScope's rich ecosystem of AI resources. From generating images to discovering cutting-edge models, datasets, apps and research papers, this MCP server makes ModelScope's vast collection of tools and services accessible through simple conversational interactions.
For a quick trial or a hosted option, visit the project page on the ModelScope MCP Plaza.
✨ Features
- 🎨 AI Image Generation - Generate images from prompts (text-to-image) or transform existing images (image-to-image) using AIGC models
- 🔍 Resource Discovery - Search and discover ModelScope resources including models, datasets, studios (AI apps), research papers, and MCP servers with advanced filtering options
- 📋 Resource Details - Get comprehensive details for specific resources
- 📖 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 studios
- 🔐 Context Information - Access current operational context including authenticated user information and environment details
🚀 Quick Start
1. Get Your API Token
- Visit ModelScope and sign in to your account
- Navigate to [Home] → [Access Tokens] to retrieve or create your API token
📖 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",
"ghcr.io/modelscope/modelscope-mcp-server"
],
"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
-
Clone and Setup:
git clone https://github.com/modelscope/modelscope-mcp-server.git cd modelscope-mcp-server uv sync -
Activate Environment (or use your IDE):
source .venv/bin/activate # Linux/macOS -
Set Your API Token (see Quick Start section for token setup):
export MODELSCOPE_API_TOKEN="your-api-token" # Or create .env file: echo 'MODELSCOPE_API_TOKEN="your-api-token"' > .env
Running the Demo Script
Run a quick demo to explore the server's capabilities:
uv run python demo.py
Use the --full flag for comprehensive feature demonstration:
uv run python demo.py --full
Running the Server Locally
# Standard stdio transport (default)
uv run modelscope-mcp-server
# Streamable HTTP transport for web integration
uv run modelscope-mcp-server --transport http
# HTTP/SSE transport with custom port (default: 8000)
uv run modelscope-mcp-server --transport [http/sse] --port 8080
For HTTP/SSE mode, connect using a local URL in your MCP client configuration:
{
"mcpServers": {
"modelscope-mcp-server": {
"url": "http://127.0.0.1:8000/mcp/"
}
}
}
You can also debug the server using the MCP Inspector tool:
# Run in UI mode with stdio transport (can switch to HTTP/SSE in the Web UI as needed)
npx @modelcontextprotocol/inspector uv run modelscope-mcp-server
# Run in CLI mode with HTTP transport (can do operations across tools, resources, and prompts)
npx @modelcontextprotocol/inspector --cli http://127.0.0.1:8000/mcp/ --transport http --method tools/list
Testing
# Run all tests
uv run pytest
# Run specific test file
uv run pytest tests/test_search_papers.py
# With coverage report
uv run pytest --cov=src --cov-report=html
🔄 Continuous Integration
This project uses GitHub Actions for automated CI/CD workflows that run on every push and pull request:
Automated Checks
- ✨ Lint - Code formatting, linting, and style checks using pre-commit hooks
- 🧪 Test - Comprehensive testing across all supported Python versions
- 🔍 CodeQL - Security vulnerability scanning and code quality analysis
- 🔒 Gitleaks - Detecting secrets like passwords, API keys, and tokens
Local Development Checks
Run the same checks locally before submitting PRs:
# Install and run pre-commit hooks
uv run pre-commit install
uv run pre-commit run --all-files
# Run tests
uv run pytest
Monitor CI status in the Actions tab.
📦 Release Management
This project uses GitHub Actions for automated release management. To create a new release:
-
Update version using the bump script:
uv run python scripts/bump_version.py [patch|minor|major] # Or set specific version: uv run python scripts/bump_version.py set 1.2.3.dev1 -
Commit and tag (follow the script's output instructions):
git add src/modelscope_mcp_server/_version.py git commit -m "chore: bump version to v{version}" git tag v{version} && git push origin v{version} -
Automated publishing - GitHub Actions will automatically:
- Create a new GitHub Release
- Publish package to PyPI repository
- Build and push Docker image to GitHub Container Registry
🤝 Contributing
We welcome contributions! Please ensure your PRs:
- Include relevant tests and pass all CI checks
- Update documentation for new features
- Follow conventional commit format
📚 References
- Model Context Protocol - Official MCP documentation
- FastMCP v2 - High-performance MCP framework
- MCP Example Servers - Community server examples
📜 License
This project is licensed under the Apache License (Version 2.0).
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。