QS World University Rankings MCP Server
This is a QS World University Ranking query server based on FastMCP, providing intelligent multi-dimensional query functions such as university search, ranking query, and national statistics.
Features
This MCP server provides the following nine tools:
1. search_university - University Search
Search for universities based on keywords to view their rankings and various indicators.
parameter
keywordKeywords for university names (supports fuzzy matching, case insensitive), such as "MIT", "Peking", "Tsinghua"year: Year (optional, such as 2024, 2025, 2026), if not specified, all years will be displayed
return:
- Match university ranking information and various indicators
- Multi year ranking trend analysis
2. get_top_universities - Ranking Query
Search for the top N universities by year and country/region.
parameter
yearYear (required, such as 2024, 2025, 2026)country: Country/region code or name (optional, such as CN, US, UK, China)top_nDisplay the top N names (default 10, maximum 100)
return:
- List of top N ranked universities
- Includes various scoring indicators
3. get_comcounty_stats - National Statistics
Count the number and distribution of universities by country/region.
parameter
year: Year (required)top_nDisplay the top N countries (default 20)
return:
- Statistics on the number of universities in each country/region
- Number of ranked universities
- percentage share
4. get_country_stores - Comparison of National Average Scores
Calculate the average score by country/region.
parameter
year: Year (required)top_nDisplay the top N countries (default 15)
return:
- Average score, highest score, and lowest score of each country
- Best ranked universities
5. get_rank_changes - Rank Changes
View the universities with the largest changes in rankings.
parameter
yearYear (required, will be compared with the previous year)top_nDisplay the top N universities (default 20)directionChange direction, "rise" rising or "fall" falling
return:
- List of universities with the largest ranking changes
- Including a comparison of rankings between last year and this year
6. get_top100_dedistribution - Top 100 distribution
View the national distribution of the top 100 universities.
parameter
year: Year (required)
return:
- Statistics on the National Distribution of Top 100 Universities
- Proportion of each country
7. get_Summary - Comprehensive Statistics
Obtain a comprehensive statistical summary for the specified year.
parameter
year: Year (required)
return:
- Basic information (total number of universities, ranking, number of countries)
- Top 10 universities
- Top 5 countries
- score statistics
- Compared to last year
8. list\_ available years - View available years
List all available years in the data.
return:
- List of available years
- latest year
9. list_comountries - View country list
List all available countries/regions in the data.
parameter
year: Year (optional)
return:
- List of available countries/regions
Data source
Using QS World University Ranking data (2024-2026), including the following indicators:
- Overall Score
- Academic Reputation
- Employer Reputation
- Faculty Student Ratio
- Citations per Faculty
- International Faculty (International Teachers)
- International Students
- International Research Network
- Employment outcomes
- Sustainability (Sustainable Development)
Installation and operation
local run
# 安装依赖
pip install -r requirements.txt
# 启动服务器
python mcp_server.pyAlibaba Cloud Function Computing Deployment
- ensure
qs_cleaned.csvThe data file is located in the root directory of the project - Run the build script:
chmod +x build.sh
./build.sh- Package and upload to Alibaba Cloud for function calculation
- Set the startup command to
./run.sh
environment variable
QS_CSV_PATH: Data file path (optional, automatically searched by default)PORT/MCP_PORTService port (default 9001)
API interface
The server runs in SSE (Server Send Events) mode, with the default listening address being:
- 本地:
http://localhost:9001/sse - Internet
http://0.0.0.0:9001/sse
Usage example
Search for universities
{
"tool": "search_university",
"arguments": {
"keyword": "MIT",
"year": 2026
}
}Search for the ranking of Chinese universities
{
"tool": "get_top_universities",
"arguments": {
"year": 2026,
"country": "CN",
"top_n": 20
}
}View ranking changes
{
"tool": "get_rank_changes",
"arguments": {
"year": 2026,
"top_n": 10,
"direction": "rise"
}
}project structure
qs_mcp/
├── mcp_server.py # MCP 服务器主程序
├── qs_cleaned.csv # QS 排名数据文件
├── qs_search.py # 原控制台搜索程序
├── qs_stats.py # 原控制台统计程序
├── qs_top.py # 原控制台排名程序
├── requirements.txt # Python 依赖
├── build.sh # 构建脚本
├── run.sh # 启动脚本
└── README.md # 项目说明license
MIT License
