Token导航 LogoToken导航TokenDH.com
Uniprot MCP (uniprot-mcp) logo
运维云端stdio官方级别未说明来源级核验

Uniprot MCP (uniprot-mcp)

MCP Server

UniProt MCP Server是一个提供无缝访问UniProtKB蛋白质数据的协议服务器,支持蛋白质条目查询、序列获取、基因本体注释和ID映射等功能,专为LLM代理设计。

工具数

0

提示词数

0

GitHub Stars

2

资源数

0
Python生物信息学数据访问

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

josefdc

提供方

josefdc

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install uniprot-mcp

详细介绍

UniProt MCP服务器

](https://pypi.org/project/uniprot-mcp/) ](https://pypi.org/project/uniprot-mcp/) ![License: MIT](https://opensource.org/licenses/MIT) ![MCP Registry](https://registry.modelcontextprotocol.io/v0/servers?search=uniprot-mcp)

提供无缝访问的模型上下文协议(MCP)服务器 UniProtKB 蛋白质数据。查询蛋白质条目、序列、基因本体注释,并通过为LLM代理设计的类型化、弹性接口执行ID映射。

✨ 特性

  • 🔌 双重运输:Stdio用于本地开发,Streamable HTTP用于远程部署
  • 📊 丰富的数据访问:获取包含序列、特征、GO注释、交叉引用和分类学的完整蛋白质条目
  • 🔍 高级搜索:全文搜索,按评论状态、生物、关键字等进行过滤
  • 🔄 ID映射:使用进度跟踪在200多种数据库标识符类型之间进行转换
  • 🛡️ 生产就绪:指数回退自动重试,CORS支持,Prometheus指标
  • 📝 键入响应:结构化Pydantic模型确保数据一致性
  • 🎯 MCP图元:为代理工作流设计的资源、工具和提示

🚀 快速开始

安装

pip install uniprot-mcp

运行服务器

地方发展(stdio):

uniprot-mcp

远程部署(HTTP):

uniprot-mcp-http --host 0.0.0.0 --port 8000

HTTP服务器提供:

  • MCP端点: http://localhost:8000/mcp
  • 健康检查: http://localhost:8000/healthz
  • 韵律学: http://localhost:8000/metrics (普罗米修斯格式)

使用MCP检查员进行测试

npx @modelcontextprotocol/inspector uniprot-mcp

📚 MCP图元

资源

通过URI模式访问静态或动态数据:

URI描述
uniprot://uniprotkb/{accession}用于任何登录的原始UniProtKB条目JSON
uniprot://help/search搜索查询语法文档

工具

执行操作并检索键入的数据:

工具参数返回描述
fetch_entryaccession, fields?Entry获取包含所有注释的完整蛋白质条目
get_sequenceaccessionSequence获取具有长度和元数据的蛋白质序列
search_uniprotquery, size, reviewed_only, fields?, sort?, include_isoformSearchHit[]具有高级过滤功能的全文搜索
map_idsfrom_db, to_db, idsMappingResult在200多个数据库之间转换标识符
fetch_entry_flatfileaccession, version, formatstring检索历史条目版本(txt/fasta)

进度跟踪: map_ids 报告长时间运行的作业的进度(0.0→1.0)。

提示

常见工作流的预构建模板:

  • 蛋白质概述:根据UniProt登录生成结构化摘要,包括生物体、功能、GO术语和显著特征。

🔧 配置

环境变量

变量默认值描述
UNIPROT_ENABLE_FIELDSunset请求最小字段子集以减小有效载荷大小
UNIPROT_LOG_LEVELinfo日志记录级别: debug, info, warning, error
UNIPROT_LOG_FORMATplain日志格式: plainjson
UNIPROT_MAX_CONCURRENCY8最大并发UniProt API请求数
MCP_HTTP_HOST0.0.0.0HTTP服务器绑定地址
MCP_HTTP_PORT8000HTTP服务器端口
MCP_HTTP_LOG_LEVELinfoUvicorn测井水位
MCP_HTTP_RELOAD0启用自动重新加载: 1true
MCP_CORS_ALLOW_ORIGINS*CORS允许的来源(逗号分隔)
MCP_CORS_ALLOW_METHODSGET,POST,DELETECORS允许的方法
MCP_CORS_ALLOW_HEADERS*CORS允许的标头

CLI标志

# HTTP server flags
uniprot-mcp-http --host 127.0.0.1 --port 9000 --log-level debug --reload

📖 使用示例

摄入蛋白质

# Using MCP client
result = await session.call_tool("fetch_entry", {
    "accession": "P12345"
})

# Returns structured Entry with:
# - primaryAccession, protein names, organism
# - sequence (length, mass, sequence string)
# - features (domains, modifications, variants)
# - GO annotations (biological process, molecular function, cellular component)
# - cross-references to other databases

寻找蛋白质

# Search reviewed human proteins
result = await session.call_tool("search_uniprot", {
    "query": "kinase AND organism_id:9606",
    "size": 50,
    "reviewed_only": True,
    "sort": "annotation_score"
})

# Returns list of SearchHit objects with accessions and scores

映射标识符

# Convert UniProt IDs to PDB structures
result = await session.call_tool("map_ids", {
    "from_db": "UniProtKB_AC-ID",
    "to_db": "PDB",
    "ids": ["P12345", "Q9Y6K9"]
})

# Returns MappingResult with successful and failed mappings

🛠️ 发展

先决条件

  • Python 3.11或3.12
  • 紫外线 (推荐)或pip

设置

# Clone the repository
git clone https://github.com/josefdc/Uniprot-MCP.git
cd Uniprot-MCP

# Install dependencies
uv sync --group dev

# Install development tools
uv tool install ruff
uv tool install mypy

运行测试

# Run all tests with coverage
uv run pytest --maxfail=1 --cov=uniprot_mcp --cov-report=term-missing

# Run specific test file
uv run pytest tests/unit/test_parsers.py -v

# Run integration tests only
uv run pytest tests/integration/ -v

代码质量

# Lint
uv tool run ruff check .

# Format
uv tool run ruff format .

# Type check
uv tool run mypy src

# Run all checks
uv tool run ruff check . && \
uv tool run ruff format --check . && \
uv tool run mypy src && \
uv run pytest

本地开发服务器

# Stdio server
uv run uniprot-mcp

# HTTP server with auto-reload
uv run python -m uvicorn uniprot_mcp.http_app:app --reload --host 127.0.0.1 --port 8000

🏗️ 建筑

src/uniprot_mcp/
├── adapters/           # UniProt REST API client and response parsers
│   ├── uniprot_client.py  # HTTP client with retry logic
│   └── parsers.py         # Transform UniProt JSON → Pydantic models
├── models/
│   └── domain.py       # Typed data models (Entry, Sequence, etc.)
├── server.py           # MCP stdio server (FastMCP)
├── http_app.py         # MCP HTTP server (Starlette + CORS)
├── prompts.py          # MCP prompt templates
└── obs.py              # Observability (logging, metrics)

tests/
├── unit/               # Unit tests for parsers, models, tools
├── integration/        # End-to-end tests with VCR fixtures
└── fixtures/           # Test data (UniProt JSON responses)

📦 出版

此服务器发布到:

建筑与出版

# Build distribution packages
uv build

# Publish to PyPI (requires token)
uv publish --token pypi-YOUR_TOKEN

# Publish to MCP Registry (requires GitHub auth)
mcp-publisher login github
mcp-publisher publish

docs/register.md 有关注册表发布的详细说明。

🤝 贡献

欢迎投稿!拜托:

  1. 阅读我们的 贡献指南
  2. 关注我们 行为准则
  3. 检查 安全策略 用于漏洞报告
  4. 查看 更新日志 最近的变化

贡献者快速入门:

  1. 复刻仓库
  2. 创建要素分支(git checkout -b feature/amazing-feature)
  3. 通过测试进行更改
  4. 运行质量检查: uv tool run ruff check . && uv tool run mypy src && uv run pytest
  5. 使用提交 约定式提交 (feat:, fix:, docs:等等)
  6. 推送并打开拉取请求

📄 许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

🙏 致谢

  • UniProt联盟:通过其REST API提供全面、高质量的蛋白质数据
  • Anthropic:用于模型上下文协议规范和Python SDK
  • 社区:用于反馈、错误报告和贡献

🔗 链接

⚠️ 免责声明

这是一个独立的项目,与UniProt联盟没有正式联系或认可。请查看UniProt的 使用条款 当使用他们的数据时。

______________________________________________________________________

内置于❤️ 面向生物信息学和人工智能社区

目录标签

目录标签

Python生物信息学数据访问蛋白质数据本地部署基因注释ID映射

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotoken部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP