BBB Permeability Screening Agent

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.

Category
Visit Server

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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured