| name | drugsda-admet |
| description | Predict the ADMET (absorption, distribution, metabolism, excretion, and toxicity) properties of the input molecules. |
| license | MIT license |
| metadata | {"skill-author":"PJLab"} |
Molecular ADMET Properties Prediction
Usage
1. MCP Server Definition
import json
from contextlib import AsyncExitStack
from mcp.client.streamable_http import streamablehttp_client
from mcp import ClientSession
class DrugSDAClient:
def __init__(self, server_url: str):
self.server_url = server_url
self.session = None
async def connect(self):
print()
:
.transport = streamablehttp_client(
url=.server_url,
headers={: }
)
._stack = AsyncExitStack()
._stack.__aenter__()
.read, .write, .get_session_id = ._stack.enter_async_context(.transport)
.session_ctx = ClientSession(.read, .write)
.session = ._stack.enter_async_context(.session_ctx)
.session.initialize()
session_id = .get_session_id()
()
Exception e:
()
traceback
traceback.print_exc()
():
:
(, ):
._stack.aclose()
()
Exception e:
()
():
:
(result, ) result.content:
content = result.content[]
(content, ):
json.loads(content.text)
(result)
Exception e:
{: , : (result)}