# mcp/mygene.py | |
from functools import lru_cache | |
from mcp.clients import BaseClient | |
from typing import Dict | |
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() | |