galaxy_classification_mcp
Enables classification of galaxy images by Hubble type and answering custom astronomy questions using the Qwen VL vision-language model via DashScope.
README
galaxy_classification_mcp
An MCP (Model Context Protocol) server that lets Claude (or any other MCP-compatible client) classify galaxy images using the Qwen VL (Vision–Language) model hosted on Alibaba Cloud's DashScope platform.
Features
| Tool | Description |
|---|---|
classify_galaxy |
Classifies a galaxy image by Hubble-sequence morphological type (spiral, elliptical, irregular …) and returns key visual features plus a confidence level. |
describe_galaxy |
Lets you ask any custom astronomy question about a galaxy image. |
Both tools accept either a public HTTPS URL or an absolute local file path as the image source.
Prerequisites
| Requirement | Notes |
|---|---|
| Python ≥ 3.10 | Tested with 3.10 – 3.12 |
| DashScope API key | Free tier available at dashscope.aliyun.com |
Installation
# 1. Clone the repository
git clone https://github.com/jyshangguan/galaxy_classification_mcp.git
cd galaxy_classification_mcp
# 2. Create and activate a virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Copy .env.example to .env and add your API key
cp .env.example .env
# Then edit .env and replace sk-your-api-key-here with your actual API key
Configuration
The server reads your Qwen API key from the environment. Choose one of the following methods:
Method 1: Using a .env file (recommended)
Create a .env file in the project root:
DASHSCOPE_API_KEY=sk-your-actual-api-key-here
The .env file is already in .gitignore to prevent accidentally committing
your API key.
Method 2: Environment variable
# Preferred variable name
export DASHSCOPE_API_KEY="sk-..."
# Alternative (both are checked)
export QWEN_API_KEY="sk-..."
You can obtain a free API key from https://dashscope.aliyun.com/ after registering for an Alibaba Cloud account.
Running the server
Stdio transport (default — for Claude Desktop / Claude Code)
python server.py
The server speaks the MCP stdio protocol and is ready to be connected to by Claude Desktop or Claude Code via the configuration below.
SSE transport (for testing with mcp dev)
mcp dev server.py
Connecting to Claude Desktop
Add the following block to your Claude Desktop configuration file
(~/Library/Application Support/Claude/claude_desktop_config.json on macOS,
%APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"galaxy-classification": {
"command": "python",
"args": ["/absolute/path/to/galaxy_classification_mcp/server.py"]
}
}
}
Replace /absolute/path/to/galaxy_classification_mcp/server.py with the
actual path on your machine.
Note: The API key should be stored in a .env file in the project directory
(see Configuration above). Alternatively, you can pass it
directly in the config by adding an "env" block with "DASHSCOPE_API_KEY".
Connecting to Claude Code (CLI)
If you have a .env file with your API key (recommended):
claude mcp add galaxy-classification \
-- python /absolute/path/to/galaxy_classification_mcp/server.py
Alternatively, pass the API key directly:
claude mcp add galaxy-classification \
-e DASHSCOPE_API_KEY=sk-... \
-- python /absolute/path/to/galaxy_classification_mcp/server.py
Example usage in Claude
Once the MCP server is connected you can ask Claude questions like:
Classify the galaxy in this image:
https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/NGC_4414_%28NASA-med%29.jpg/1024px-NGC_4414_%28NASA-med%29.jpg
Claude will call the classify_galaxy tool and return a structured report
such as:
Morphological type : Sc (late-type spiral)
Key visual features: Two loosely wound, patchy spiral arms; bright,
compact nucleus; clumpy star-forming regions along
the arms; no bar visible.
Confidence : High
Available models
| Model | Notes |
|---|---|
qwen-vl-max |
Highest capability (default) |
qwen-vl-plus |
Faster, lower cost |
Pass the model argument to either tool to switch models:
Use qwen-vl-plus to classify: https://example.com/galaxy.jpg
Project structure
galaxy_classification_mcp/
├── server.py # MCP server (FastMCP, Qwen VL tools)
├── requirements.txt # Python dependencies
├── .env.example # Example environment variables template
├── .env # Your actual API key (not in git)
├── pyproject.toml # Project metadata
└── README.md # This file
License
See LICENSE.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。