ChEMBL数据库API服务

基于FastMCP框架的ChEMBL数据库API访问服务,提供异步API调用、内置错误处理及多种传输方式支持。

  • by BioMCP-Hub
  • Jupyter Notebook
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 BioMCP-Hub/ChEMBL-MCP-Server

使用说明

ChEMBL MCP服务器

一个基于chembl_webresource_client包的FastMCP包装服务器,提供对chembl数据库的API访问。

特性

  • 完成API对ChEMBL数据库的访问
  • 使用FastMCP框架实现的异步API调用
  • 内置错误处理和超时机制
  • 支持HTTP和stdio传输方法
  • 完整的类型注释和文档字符串

安装

# Clone repository
git clone https://github.com/yourusername/ChEMBL-MCP-Server.git
cd ChEMBL-MCP-Server

# Install dependencies
pip install -r requirements.txt

用法

启动服务器

# Start HTTP server with default configuration
python chembl_searver.py

# Specify host and port
python chembl_searver.py --host 0.0.0.0 --port 8080

# Use stdio transport
python chembl_searver.py --transport stdio

# Set log level
python chembl_searver.py --log-level DEBUG

可用参数

  • --host:服务器主机地址,默认为127.0.0.1
  • --port:服务器端口,默认为8000
  • --transport:传输方式,在http或stdio之间选择,默认为http
  • --log-level:日志级别,从调试、信息、警告、错误、关键中选择,默认为信息

API函数

服务器提供以下API函数:

数据实体API

  • example_activity:获取活动数据
  • example_assay:获取化验数据
  • example_target:获取目标数据
  • example_molecule:获取分子数据
  • example_drug:获取药物数据
  • 更多数据实体API。..

化学工具API

  • example_canonicalizeSmiles:将微笑字符串规范化
  • example_smiles2inchi:将SMILES转换为InChI
  • example_smiles2svg:将SMILES转换为SVG图像
  • example_structuralAlerts:获取结构警报
  • 更多化学工具API。..

例子

检查 chembl_search.py 文件中显示了使用各种API的示例。

依赖项

  • chemble_webresource_client:chembl Web服务客户端
  • mcp:mcp框架
  • FastAPI框架
  • uvicorn:ASGI服务器
  • asyncio:异步I/O库

许可证

麻省理工学院