Download mcp/mygene.py from mgbam/MCP_Res: direct link, hf CLI and curl.
- Browser
- Download file 480 Bytes
-
https://huggingface.co/spaces/mgbam/MCP_Res/resolve/1f7d1c0d89b17a6183262c4cefdae7ac182f97fd/mcp/mygene.py
- Command line
-
hf download hf://spaces/mgbam/MCP_Res@1f7d1c0d89b17a6183262c4cefdae7ac182f97fd/mcp/mygene.py
-
curl -L -o mygene.py https://huggingface.co/spaces/mgbam/MCP_Res/resolve/1f7d1c0d89b17a6183262c4cefdae7ac182f97fd/mcp/mygene.py
480 Bytes
| # mcp/mygene.py | |
| from functools import lru_cache | |
| from mcp.clients import BaseClient | |
| class MyGeneClient(BaseClient): | |
| def __init__(self): | |
| super().__init__("https://mygene.info/v3", api_key_env="MYGENE_KEY") | |
| async def fetch(self, symbol: str) -> Dict: | |
| q = {"q": symbol, "fields": "symbol,name,summary,alias,entrezgene,location", "size": 1} | |
| return (await self.request("GET", "query", params=q))["hits"][0] | |
| mygene = MyGeneClient() | |