这是一个全面的模型上下文协议(MCP)服务器,用于访问PubChem化学数据库。该服务器可让用户访问超过1.1亿种化合物,提供丰富的分子属性、生物测定数据和化学信息学工具。
# 克隆或创建服务器目录
cd pubchem-server
# 安装依赖
npm install
# 构建服务器
npm run build
# 运行服务器
npm start
// 按名称搜索化合物
{
"tool": "search_compounds",
"arguments": {
"query": "aspirin",
"max_records": 10
}
}
// 获取详细的化合物信息
{
"tool": "get_compound_info",
"arguments": {
"cid": 2244
}
}
// 查找相似化合物
{
"tool": "search_similar_compounds",
"arguments": {
"smiles": "CC(=O)OC1=CC=CC=C1C(=O)O",
"threshold": 85,
"max_records": 50
}
}
// 分析分子性质
{
"tool": "get_compound_properties",
"arguments": {
"cid": 2244,
"properties": ["MolecularWeight", "XLogP", "TPSA"]
}
}
// 获取生物测定信息
{
"tool": "get_assay_info",
"arguments": {
"aid": 1159607
}
}
// 按靶点搜索化合物
{
"tool": "search_by_target",
"arguments": {
"target": "cyclooxygenase",
"max_records": 100
}
}
// 获取安全分类信息
{
"tool": "get_safety_data",
"arguments": {
"cid": 2244
}
}
// 处理多个化合物
{
"tool": "batch_compound_lookup",
"arguments": {
"cids": [2244, 5090, 3672],
"operation": "property"
}
}
// 1. 搜索抗炎化合物
{
"tool": "search_compounds",
"arguments": {
"query": "anti-inflammatory",
"max_records": 100
}
}
// 2. 分析类药性
{
"tool": "assess_drug_likeness",
"arguments": {
"cid": 2244
}
}
// 3. 检查安全概况
{
"tool": "get_safety_data",
"arguments": {
"cid": 2244
}
}
// 4. 查找生物活性数据
{
"tool": "search_by_target",
"arguments": {
"target": "COX-2",
"activity_type": "IC50"
}
}
// 1. 查找相似化合物
{
"tool": "search_similar_compounds",
"arguments": {
"smiles": "your_query_smiles",
"threshold": 90
}
}
// 2. 比较分子性质
{
"tool": "batch_compound_lookup",
"arguments": {
"cids": [1234, 5678, 9012],
"operation": "property"
}
}
// 3. 分析结构特征
{
"tool": "analyze_stereochemistry",
"arguments": {
"cid": 1234
}
}
可通过以下URI模式访问PubChem数据:
pubchem://compound/{cid}:获取完整的化合物数据。pubchem://structure/{cid}:获取2D/3D结构信息。pubchem://properties/{cid}:获取分子性质信息。pubchem://bioassay/{aid}:获取生物测定数据。pubchem://similarity/{smiles}:获取相似性搜索结果。pubchem://safety/{cid}:获取安全和毒性数据。该PubChem服务器可与其他化学/生物数据库完美集成:
1. 靶点发现:UniProt → STRING → AlphaFold
2. 化学发现:PubChem ← → ChEMBL
3. 完整工作流:蛋白质 → 结构 → 相互作用 → 小分子 → 生物活性
PubChem API指南:
服务器具备全面的错误处理机制:
该服务器使用了以下技术:
本项目采用MIT许可证,详情请参阅LICENSE文件。
若遇到以下问题:
服务器采用模块化架构构建:
这使其成为目前最全面的化学信息学MCP服务器!
本项目遵循MIT许可证,具体细节请查看LICENSE文件。
如果您在研究或出版物中使用了本项目,请按以下格式引用:
@misc{pubchemmcp2025,
author = {Moudather Chelbi},
title = {PubChem MCP Server},
year = {2025},
howpublished = {https://github.com/Augmented-Nature/PubChem-MCP-Server},
note = {Accessed: 2025-06-29}
}