hitran-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@hitran-mcpPlot the absorption spectrum of CO2 at 296 K for the 4.3 µm band."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
hitran-mcp
让 AI 直接调用 HITRAN 数据库:查谱线、算截面、画谱图。 一个纯标准库实现的 MCP 服务器(stdio),数据实时取自 HITRANonline(经官方 HAPI),本地不预置任何谱数据。
English | 中文
6 个工具覆盖全链路:物种查询(官方 ISO 表,含同位素丰度)→ 线表抓取 → 强线列表(选线/干扰分析)→ 单/混合气吸收·透过率谱 → 谱图绘制 → 配分函数。
把 HITRAN 数据库的取数、谱计算、绘图封装成 AI 可直接调用的 MCP 服务器。 数据全部实时取自 HITRANonline(经官方 HAPI 1.3.0.0),本地不预置任何谱数据; 物种表、同位素丰度也直接读 HAPI 官方 ISO 表,无硬编码白名单。
一、包含文件
hitran-mcp-kit/
├─ README.md # 本文件
├─ mcp.config.example.json # MCP 客户端注册片段(改路径后合入你的配置)
└─ tools/
├─ hitran_mcp.py # ★ MCP 服务器本体(stdio JSON-RPC,纯标准库)
├─ hitran.py # 官方 HAPI 的统一薄封装(防呆护栏 + 溯源水印)
└─ __init__.py运行期自动生成(不用打包、可随时删):
Hitran_Data/— 线表缓存(体大,可由 fetch 重生)tmp/mcp_out/— 工具产物(CSV/PNG,自带 HITRAN 溯源水印)
Related MCP server: MCP TypeScript NASA Server
二、安装
Python 3.9+,装依赖(官方 HAPI 直接 pip 装):
git clone https://github.com/LKF0402/hitran-mcp.git pip install -r hitran-mcp/requirements.txt或不用 git,直接下载仓库 zip 后
pip install hitran-api numpy matplotlib。把仓库放到任意固定路径,例如
D:\hitran-mcp\(下文以此为例)。API key(可选但建议):到 hitran.org 注册账号获取 API key, 新建
tools\hitran_api_key.txt(与 hitran_mcp.py 同目录)写入 key 即可; 也可设环境变量HITRAN_API_KEY。说明:HAPI 1.3.0.0 的下载接口暂不校验 key,此文件属预置;官方对 fetch 有每日配额, 超限会返回 403,届时等次日或减少抓取(本工具会自动复用缓存,不重复下载)。
三、注册到 AI 客户端(任意支持 MCP 协议的客户端均可)
在客户端的 MCP 服务器配置里(各产品入口不同,通常是设置中的 MCP/工具管理,
或直接编辑其 JSON 配置文件),合入 mcp.config.example.json 的内容,
把 python 与脚本路径改成你的实际路径:
"hitran": {
"command": "python",
"args": ["D:/hitran-mcp-kit/tools/hitran_mcp.py"],
"type": "stdio",
"timeout": 600000,
"disabled": false
}Windows 下若 python 不在 PATH,
command用解释器的完整路径(正斜杠或双反斜杠均可)。
保存后重启客户端,看到 hitran 服务器与 6 个工具即成功。
四、6 个工具速览
工具 | 作用 |
| 官方分子表:分子号 M、主同位素、各同位素自然丰度(支持分子式或分子号) |
| 抓取波数窗口线表;未覆盖窗口自动重抓;0 线/失败会报错,不静默出空谱 |
| 窗口内最强 N 条线(ν、S、γ_air、E″)——选线/干扰分析 |
| 吸收系数 α / 透过率谱(单/混合气、全同位素),CSV 带溯源水印 |
| 谱图 PNG(多物种叠加 + 总谱,ylog 可选) |
| 配分函数 Q(T)(TIPS 2025/2021/2017/2011) |
五、自测
python tools\hitran_mcp.py --selftest # 走真实网络,抓 CO 小窗口 + 出图六、使用纪律(重要,写进了工具的返回值)
单位:默认返回吸收系数 α(cm⁻¹);
hitran_units=true返回截面 σ(cm²/molecule,不按摩尔分数缩放)。混合气:按 α_i = x_i · α_pure_i(T, P, 浴气) 计算,绝不用 x·P 当分压;不给浓度会强提示并按纯气体算。
参数澄清:没给的参数用默认值,但如实列在返回的
assumed_defaults(needs_confirm=true时 AI 应向你确认 T/P/窗口/浓度);strict=true时 T/P 缺失直接报错。线型:
profile可选 voigt(默认)/lorentz/gauss/doppler/ht/sdvoigt(全部直调官方 HAPI 函数)。溯源:任何 CSV/图都能追到 HITRAN2024(Gordon et al., JQSRT 2026, doi:10.1016/j.jqsrt.2026.109807)+ HAPI(Kochanov et al., JQSRT 2016)+ TIPS 版本;论文引用以返回中的 citation 字段为准。
同位素口径:默认主同位素(纯气体权重 1.0);
iso="all"按官方自然丰度加权(更接近真实大气)。
七、常见问题
抓取失败 "daily limit":官方每日配额超限,次日再试;缓存未删的前提下大部分窗口无需重新抓。
改了代码不生效:重启 AI 客户端(MCP 进程随客户端启动)。
想清缓存:删
Hitran_Data/*.data|*.header即可,需要时自动重抓。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Renders interactive Chart.js charts and dashboards inline in AI conversations.
Interact with climate metrics via Riskthinking.AI's CDT Express API in supported AI chat experiences
SEO & marketing toolkit for AI agents: GA4, Search Console, AdSense, GTM, PageSpeed, Trends.
Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables weather data retrieval and visualization with support for geocoding, multi-day forecasts, historical weather queries, and natural language processing through LangChain integration. Supports both current and historical weather data with interactive charts and multiple language support.MIT
- AlicenseAqualityFmaintenanceProvides seamless integration with NASA's public APIs, enabling AI assistants to access space and astronomy data including APOD, Mars rover photos, Near-Earth Objects, space weather events, and Earth imagery.56MIT
- AlicenseNot gradedqualityBmaintenanceEnables natural language interaction with computational chemistry tools including molecule building, electronic structure calculations, geometry optimization, vibrational spectroscopy, and molecular dynamics, powered by RDKit, PySCF, and ASE.MIT
- AlicenseAqualityBmaintenanceEnables thermodynamic property calculations (H, S, G, Cp, reaction equilibrium) using NASA-9 polynomial data through natural language or MCP-compatible clients.101Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/LKF0402/hitran-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server