File size: 481 Bytes
3e27bda
 
 
e5ff04a
3e27bda
 
 
64eb751
3e27bda
 
 
 
6fe33f5
3e27bda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 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()