BBB Permeability Screening Agent
Enables prediction of blood-brain barrier permeability for drug molecules via machine learning, with molecule name lookup, plain-language explanations, similar drug search, and applicability domain checks. Exposes these as MCP tools and orchestrates them via a LangGraph agent.
README
BBB Permeability Screening Agent
An agentic AI system that predicts whether a drug molecule can cross the blood-brain barrier (BBB) — a key early-stage filter in CNS (brain-related) drug discovery — combining a benchmarked machine learning classifier with agent orchestration, molecular similarity search, and uncertainty awareness.
What it does
Given a medicine name (e.g. "paracetamol") or a raw SMILES structure, the system:
Resolves the name to its chemical structure via PubChem Predicts BBB permeability using a machine learning classifier trained on real, lab-verified data Explains the prediction in plain language, grounded in the molecule's actual physicochemical properties Finds structurally similar known drugs and their known BBB status Flags when the molecule is unlike anything the model was trained on (applicability domain check), so predictions aren't silently overconfident Why this matters
Your brain is protected by a natural barrier that blocks most substances — including roughly 98% of small-molecule drugs — from reaching it. This is why treating brain conditions (epilepsy, depression, Alzheimer's, brain tumors) is far harder than treating most other illnesses: pharmaceutical companies often discover a promising drug candidate can't reach the brain only after years of expensive development. Early computational screening, like this project does at small scale, is a real, established step in actual drug discovery pipelines.
Who this is for Primary: drug discovery researchers/students doing early-stage screening of candidate compounds for CNS drug development Secondary: as a demonstration of applying current agentic AI engineering (tool orchestration, MCP, explainability, uncertainty quantification) to a real scientific problem
The simplified conversational UI (common medicine name buttons, plain-English explanations) is a presentation layer built to make the underlying science accessible for demos — the underlying tool is built for the researcher use case above.
Related work
BBB permeability prediction is an active, published research area — this project is not a novel scientific contribution, and doesn't claim to be. Existing tools and research include:
BBBper — a live, public ML-based web tool (random forest, ~97% accuracy on its external test set) — http://bbbper.mdu.ac.in DeePred-BBB (Kumar et al., 2022, Frontiers in Neuroscience) — a deep learning model for improved BBB prediction accuracy Ensemble ML approaches combining random forest with molecular fingerprints, reporting ROC-AUC around 0.957 in 5-fold cross-validation Recent work combining LLMs (transformer-based SMILES encoders) with gradient boosting, validated against real lab experiments
This project's differentiation isn't raw accuracy — it's the engineering approach: an agentic system (LangGraph orchestration, MCP tool exposure, similarity search, applicability domain awareness) wrapped around the prediction task, rather than a standalone prediction webpage.
Architecture BBBP.csv (2039 real, lab-verified molecules) | v RDKit featurization (molecular weight, LogP, TPSA, H-bond counts, etc.) | v Model comparison: Logistic Regression, SVM, Random Forest, XGBoost | (5-fold cross-validation) v Random Forest selected (best cross-validated ROC-AUC) | v [MCP tools] lookup_smiles / predict_bbbp / explain_prediction | v LangGraph agent (route -> lookup -> predict -> explain) | v FastAPI backend (+ molecule structure images, similarity search, applicability domain check) | v Streamlit frontend (plain-language UI, similar-drugs, comparison mode) Results
Evaluated with 5-fold stratified cross-validation, then confirmed on a held-out test set (20% of data, never seen during training or model selection):
Model CV ROC-AUC (mean ± std) Random Forest (selected) 0.881 ± 0.014 XGBoost see results/model_comparison.csv SVM (RBF kernel) see results/model_comparison.csv Logistic Regression see results/model_comparison.csv
Held-out test set performance (Random Forest): 0.923 ROC-AUC, 88% accuracy. Confusion matrix and ROC curve figures in results/.
How this compares to published work: consistent with a 2026 study using an identical setup (random forest, 2048-bit Morgan fingerprints, 5-fold CV) that also found random forest to be the top classical-ML performer on BBBP. Above typical fingerprint-based baseline ranges (~0.80–0.85) reported in the literature; below state-of-the-art graph neural network approaches (~0.96), which use 3D structural information beyond this project's scope.
Note on evaluation methodology: this project uses a random train/test split. The official MoleculeNet BBBP benchmark uses a scaffold split (test molecules have structurally distinct scaffolds from training), which is a harder, more realistic evaluation setting.
Project structure src/ features.py RDKit featurization train.py Initial model training model_comparison.py Multi-model comparison + evaluation figures build_similarity_index.py Precomputes fingerprints for similarity search similarity_search.py Similarity search + applicability domain check pubchem_lookup.py Molecule name -> SMILES resolution mcp_server.py MCP tool exposure agent.py LangGraph orchestration api.py FastAPI backend app.py Streamlit frontend data/BBBP.csv Source dataset models/ Trained model, scaler, similarity index results/ Evaluation figures and comparison table Setup bash pip install -r requirements.txt Train the model bash cd src python train.py # initial baseline model python build_similarity_index.py python model_comparison.py # multi-model comparison, selects best model Run
Two terminals:
bash cd src uvicorn api:app --reload bash cd src streamlit run app.py
Or as a standalone MCP server (for use with Claude Desktop or another MCP client):
bash cd src python mcp_server.py Limitations Trained on 2039 molecules — small relative to production-scale datasets Uses 10 hand-picked physicochemical descriptors, not full molecular fingerprints or 3D structure Predictions are pattern-matches against historical lab data, not simulations of biology — the applicability domain check flags when a molecule is too unlike anything in training data to trust the prediction Not validated against real lab experiments — a research/demo project, not a clinical or production tool Disclaimer
This is a student research/demonstration project. It is not medical advice and should not be used to make real medical or pharmaceutical decisions.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。