MeSH MCP
Connects Claude to the U.S. National Library of Medicine MeSH APIs to search and retrieve medical authority data, descriptors, and qualifiers. It enables library and metadata staff to perform subject analysis and confirm terminology within an AI-assisted cataloging workflow.
README
MeSH MCP
An experimental MCP (Model Context Protocol) server connecting Claude to the U.S. National Library of Medicine (NLM) Medical Subject Headings (MeSH) linked data APIs, built to investigate the potential of large language models in subject analysis and authority control.
What This Server Does
MeSH MCP connects Claude Desktop to the NLM MeSH APIs, allowing you to search and retrieve MeSH authority data directly within your AI-assisted cataloging workflow.
Once installed, you can ask Claude things like:
- "Search MeSH for terms related to osmotic stress"
- "Find the MeSH descriptor for CRISPR gene editing"
- "What is the scope note for this MeSH descriptor?"
- "Look up the full record for descriptor D011506"
The server handles all the API calls, parses the responses, and returns structured data Claude can reason about.
Who This Is For
- Catalogers and metadata staff using Claude Desktop who want AI-assisted subject description grounded in real MeSH vocabulary data
- Library and repository staff working with health sciences or biomedical research outputs — theses, datasets, grey literature — where MeSH is the preferred controlled vocabulary
- Developers integrating MeSH lookups into MCP-based systems
Tools
| Tool | Description |
|---|---|
search_mesh |
Search MeSH descriptors by label using the NLM lookup autocomplete endpoint. Supports startsWith (default), contains, and exact matching. Returns a list of {label, ui, uri} dicts. |
get_mesh_record |
Retrieve the full record for a MeSH descriptor by UI code or URI. Returns label, annotation (scope note), tree numbers, tree categories, broader descriptors, see-also cross-references, and qualifier count. |
get_mesh_qualifiers |
Retrieve the allowable subheading qualifiers for a descriptor (e.g. Diabetes Mellitus/therapy). Optionally includes per-qualifier indexing annotations. |
get_mesh_tree |
Retrieve the MeSH tree hierarchy for a descriptor: tree numbers, top-level category names, and immediate broader (parent) descriptors. |
Notes on Search Behaviour
search_mesh uses left-anchored matching by default (startsWith), which matches from the beginning of the heading label. Searching diabetes will find Diabetes Mellitus and related headings, but searching mellitus will not. When a startsWith search returns no results, use match="contains" to search anywhere in the label.
For highly specialized or emerging concepts without a direct MeSH equivalent — such as specific protein families or recently coined terminology — search with a broader parent term and review the returned hierarchy to identify the best available descriptor.
Use get_mesh_record to verify before assigning. Retrieve the full
record to confirm the scope note matches the intended concept,
particularly when multiple candidate terms are returned. Tree numbers
indicate where the term sits in the MeSH hierarchy and can guide
selection of broader or narrower terms.
Installation
Requirements
- Python 3.11 or later
- Claude Desktop (or another MCP-compatible host)
Install from GitHub
pip install git+https://github.com/YOUR_USERNAME/mesh-mcp.git
Install from a local clone
git clone https://github.com/YOUR_USERNAME/mesh-mcp.git
cd mesh-mcp
pip install -e .
On Windows with Anaconda, use Anaconda Prompt and add
--break-system-packages if prompted.
Claude Desktop Configuration
After installation, add the server to your claude_desktop_config.json.
Claude Desktop uses a restricted PATH that does not include the Python
bin directory, so the full path to the command is required.
To find your exact path, run the following in Terminal (Mac) or Anaconda Prompt (Windows):
- Mac:
which mesh-mcp - Windows:
where mesh-mcp
The examples below are illustrative only — your actual path will differ depending on your Python version and installation method.
Mac (example):
{
"mcpServers": {
"mesh": {
"command": "/Library/Frameworks/Python.framework/Versions/3.13/bin/mesh-mcp"
}
}
}
Windows/Anaconda (example):
{
"mcpServers": {
"mesh": {
"command": "C:\\Users\\username\\anaconda3\\Scripts\\mesh-mcp.exe"
}
}
}
Always replace the path with the actual output of the which or where
command on your machine.
Finding your config file:
- Mac:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
After editing the config, quit Claude Desktop completely and reopen it. The MeSH tools will be available in your next conversation.
Verifying the installation
Once Claude Desktop is open, ask: "What cataloger tools do you have available?" — you should see all four MeSH tools listed.
Troubleshooting
Tools not appearing in Claude Desktop
- Confirm the package installed without errors:
pip show mesh-mcp - Confirm the command is available:
mesh-mcp --help(should start the server, not throw an error) - Check that the config file path is correct for your OS
- Quit Claude Desktop fully (not just close the window) before reopening
Changes to server.py not taking effect
Python caches compiled bytecode in __pycache__ folders. After editing
server.py, delete any __pycache__ folders in the package directory
and restart Claude Desktop fully.
Data Source
MeSH is produced by the U.S. National Library of Medicine and is freely available with no license required. Attribution is appreciated.
License
GPLv3. See LICENSE.
Development Note
The code in this project was developed in collaboration with Claude, Anthropic's AI assistant. The design decisions — including tool selection, search protocols, and the application of MeSH cataloging practice to the server's behaviour — reflect the author's professional cataloging expertise. Claude handled the implementation of those decisions in Python.
Acknowledgement
This project was inspired by and adapted from KL Tang's cataloger-mcp, extended here to apply to MeSH vocabulary lookup.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。