MCP_Res / mcp /cbio.py
mgbam's picture
Update mcp/cbio.py
3e27bda verified
# mcp/cbio.py
from functools import lru_cache
from mcp.clients import BaseClient
class CbioClient(BaseClient):
def __init__(self):
super().__init__("https://www.cbioportal.org/api", None)
@lru_cache(256)
async def fetch_variants(self, gene: str, profile: str="brca_tcga_pan_can_atlas_2018_mutations"):
path = f"molecular-profiles/{profile}/genes/{gene}/mutations?projection=SUMMARY"
return await self.request("GET", path)
cbio = CbioClient()