Biomedical Research MCP Server
This server provides MCP tools for biomedical research, covering dilution calculations, experiment management, research document handling, PDF text extraction, and local evidence retrieval.
Calculate dilutions using C1V1 = C2V2 (stock, desired, final volume).
Retrieve experiment details by experiment ID.
Search experiments by query, cell type, treatment, organism, test, duration, and limit.
Add new experiments with metadata to the database.
Get research document metadata by document ID.
Add research document metadata (title, file name, description, type).
Extract PDF text from a document and store content/pages.
Retrieve extracted research content by document ID.
Search extracted content using SQL text matching (query, document, limit).
Search biomedical evidence via local retrieval system with question, top_k, and document filtering.
Provides tools for searching, retrieving, and adding biomedical experiment records stored in a local SQLite database.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Biomedical Research MCP Server Search experiments for doxorubicin toxicity in cardiac cells"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Biomedical AI MCP
A local Biomedical Research Assistant and Model Context Protocol (MCP) server for structured experiment data and evidence-based research-document retrieval.
Overview
This project combines a Python MCP server, a deterministic research agent, a SQLite database, PDF extraction, and local evidence retrieval.
The system is designed as a portfolio project demonstrating practical skills in:
Python application design
MCP server/tool development
Biomedical research data handling
SQLite database integration
PDF text extraction
Local evidence retrieval
Deterministic tool planning
Multi-tool execution and failure isolation
Evidence provenance and validation
Production-oriented logging
Automated testing
The current implementation is intentionally local and does not require a paid external LLM or paid embedding API.
Related MCP server: OpenPapers
Architecture
User
|
v
Biomedical Research Agent
|
+--> Planner
| |
| +--> selects MCP tools
|
+--> Executor
| |
| +--> executes tools
| +--> isolates failures
| +--> records execution status
| +--> logs execution events
|
+--> Validator
| |
| +--> checks cross-tool alignment
|
+--> Answer Generator
|
+--> evidence
+--> experiments
+--> document metadata
+--> provenance
|
v
MCP Server
|
+----------+-----------+
| | |
v v v
Research Experiment Document
Tools Tools Tools
| | |
+----------+-----------+
|
+-------+-------+
| |
v v
SQLite DB Research PDFs
|
v
PDF text extraction
|
v
Local evidence retrievalSee docs/architecture.md for the detailed architecture description.
Main Components
MCP Server
server.py exposes the biomedical capabilities through MCP.
Current MCP tools:
calculate_dilutionget_experimentsearch_experimentsadd_experimentget_research_documentadd_research_documentextract_pdf_textget_research_contentsearch_research_contentsearch_research_evidence
Current MCP resources:
research://experimentsresearch://experiments/{experiment_id}research://documentsresearch://documents/{document_id}research://documents/{document_id}/contentresearch://documents/{document_id}/pages/{page_number}
Agent
The agent is split into focused modules:
agent.py— compatibility entry pointagent_app.py— application flow and MCP connectionagent_planner.py— deterministic intent detection and tool planningagent_executor.py— MCP tool execution and failure isolationagent_validator.py— cross-tool validationagent_answer.py— research-answer formatting
Data Layer
database.py— SQLite database operationsbiomedical.db— project databasedocuments/— research PDFsretrieval.py— local evidence retrieval
Research Workflow
A research question follows this general path:
The user submits a biomedical research question.
The planner identifies the required tool domain.
The planner selects one or more MCP tools.
The executor calls the selected tools.
Individual tool failures are isolated so successful results can still be used.
Research evidence is retrieved from extracted document pages.
Experiment data can be retrieved from SQLite.
The validator checks relationships between retrieved evidence and database experiments.
The answer generator produces a structured response with evidence and provenance.
For combined questions, the planner can execute multiple domains in a deterministic order.
Example:
What mechanisms are involved in copper nanoparticle toxicity, and what related experiments are in the database?
This can result in:
search_research_evidence
search_experimentsThe answer can then distinguish literature evidence from database experiment metadata instead of treating them as the same source.
Local Evidence Retrieval
The project uses a local retrieval implementation in retrieval.py.
It:
loads extracted document pages
tokenizes and expands research questions
detects biomedical concepts and mechanisms
scores relevant pages
creates evidence snippets
returns page-level provenance
The current implementation is deliberately lightweight and deterministic. It does not depend on a paid external embedding service.
This makes the project reproducible in a local development environment, while also making its limitations explicit: the retrieval system is not equivalent to a large-scale neural semantic-search stack.
Example Evidence Domains
The current research workflow includes concepts such as:
oxidative stress
reactive oxygen species (ROS)
mitochondrial damage
lipid peroxidation
DNA damage
apoptosis
cell membrane damage
cell death and reduced viability
The answer layer preserves the distinction between direct and supporting evidence where available.
Database
The SQLite database contains structured experiment metadata.
The current experiment schema includes:
experiment_idnamecell_typetreatmentorganismtestduration_hours
The database layer uses parameterized SQL and validation rather than interpolating user-controlled values directly into SQL statements.
PDF Research Pipeline
Research documents are registered in the database and can be processed through the MCP server.
The extraction workflow is:
PDF
|
v
PDF metadata
|
v
pypdf text extraction
|
+--> full document content
|
+--> page-level content
|
v
SQLite storage
|
v
local evidence retrievalThe project includes a research PDF related to copper nanoparticle toxicity.
Error Handling
The agent is designed so that one failed tool does not necessarily invalidate the complete request.
Execution status is tracked separately:
_execution_status
|
+--> tool A: SUCCESS
|
+--> tool B: FAILEDThis allows the answer layer to distinguish complete and partial results.
MCP-level error results are also detected explicitly.
Observability
Logging is centralized through config.py.
The application records operational events such as:
tool-plan start and completion
individual tool start and completion
execution duration
successful tool execution
failed tool execution
MCP errors
unsupported tool requests
The executor intentionally avoids logging the complete research question.
Logging configuration is not duplicated across individual modules.
Configuration
Configuration is centralized in config.py and can be controlled through environment variables.
Important settings include:
BIOMED_DATABASE_PATHBIOMED_DOCUMENTS_DIRBIOMED_DEFAULT_DOCUMENT_IDBIOMED_RESEARCH_TOP_KBIOMED_MAX_QUESTION_LENGTHBIOMED_LOG_LEVELBIOMED_MCP_SERVER_COMMANDBIOMED_MCP_SERVER_SCRIPT
See .env.example for the supported configuration pattern.
Requirements
The current project targets:
Python 3.14
MCP Python SDK 2.1.1
pypdf 6.17.0
SQLite
uv (recommended for environment management)
The MCP server can be inspected with the MCP development tooling.
Setup
From the project directory:
uv syncOr, if the existing virtual environment is already configured:
.venv\Scripts\activateThe project currently uses a local SQLite database and local PDF files.
Run the MCP Server
The standard development command is:
uv run mcp dev server.pyThis opens the MCP development/inspection workflow and allows the exposed tools and resources to be inspected.
Run the Agent
From the project directory:
.venv\Scripts\python.exe agent.pyThe agent connects to the MCP server using the current Python interpreter.
Run Tests
Run the complete suite:
.venv\Scripts\python.exe run_all_tests.pyThe current verified baseline is:
Tests run: 126
Failures: 0
Errors: 0The test suite covers configuration, security, SQL safety, PDF limits, MCP behavior, planning, execution failure handling, answer quality, logging, and observability.
Example Questions
Research evidence
What mechanisms are involved in copper nanoparticle toxicity?Research + experiments
What mechanisms are involved in copper nanoparticle toxicity, and what related experiments are in the database?Experiment search
Which experiments use doxorubicin?Document information
Show me the research document.Combined document + evidence
Show me the paper and tell me what it says about apoptosis.Security and Safety Considerations
The project includes defensive controls around:
SQL query construction
input validation
numeric validation
document identifiers
PDF processing
tool limits
MCP errors
unsupported tools
execution failures
The system should still be treated as a research-support prototype rather than a clinical decision-support system.
It does not establish clinical efficacy, safety, diagnosis, or treatment recommendations.
Current Limitations
This is a portfolio/research prototype.
Known limitations include:
local deterministic retrieval rather than a production-scale vector database
limited document corpus
SQLite rather than a production database service
deterministic planning rather than a general-purpose LLM planner
no authentication layer for a deployed multi-user service
no production web UI
no clinical validation
evidence retrieval quality depends on the indexed document content
These limitations are intentional and documented rather than hidden.
Project Structure
biomedical-ai-mcp/
|
+-- agent.py
+-- agent_app.py
+-- agent_answer.py
+-- agent_executor.py
+-- agent_planner.py
+-- agent_validator.py
|
+-- server.py
+-- database.py
+-- retrieval.py
+-- config.py
|
+-- biomedical.db
+-- documents/
|
+-- tests/
+-- docs/
|
+-- .env.example
+-- .gitignore
+-- CONTRIBUTING.md
+-- LICENSE
+-- pyproject.toml
+-- README.md
+-- run_all_tests.pyLegacy and experimental files are kept separately under archive/legacy/ rather than mixed into the production-facing project structure.
Roadmap
The project roadmap includes:
production documentation
architecture documentation
Git/GitHub preparation
final end-to-end demonstration
stronger retrieval strategies
broader document collections
additional biomedical tools
optional LLM-based agent orchestration
deployment hardening
Portfolio Positioning
This project demonstrates an end-to-end biomedical AI engineering workflow rather than a single isolated model.
The strongest portfolio themes are:
MCP protocol implementation
biomedical research workflows
tool-using agent architecture
local retrieval/RAG concepts
structured data + unstructured documents
multi-tool orchestration
evidence provenance
defensive engineering
automated testing
production-oriented observability
License
See LICENSE.
Available Tools
10 toolsadd_experimentC
Add a new experiment to the database.
Inputs: experiment_id (required), experiment_name (required), test, organism, +3 more.
add_research_documentC
Add research document metadata.
Inputs: title (required), file_name (required), document_id (required), description, +1 more.
calculate_dilutionC
Calculate dilution using C1V1 = C2V2.
Inputs: stock (required), desired (required), final_volume (required).
extract_pdf_textB
Extract text from a PDF and save it into research_content and research_pages.
Inputs: document_id (required).
get_experimentB
Retrieve one experiment by experiment ID.
Inputs: experiment_id (required).
get_research_contentC
Retrieve extracted research document content.
Inputs: document_id (required).
get_research_documentB
Retrieve research document metadata.
Inputs: document_id (required).
search_experimentsC
Search experiments using:
general text query
cell type
treatment
organism
test
duration in hours
Inputs: test, limit, query, organism, +3 more.
search_research_contentC
Search extracted research pages using SQL text matching.
Inputs: query (required), limit, document_id.
search_research_evidenceC
Retrieve relevant biomedical evidence using the local retrieval system.
Inputs: question (required), top_k, document_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools have clearly distinct purposes: experiment operations, document metadata, extracted content, evidence search, and calculation are separated by domain object. The only mild ambiguity is between search_research_content and search_research_evidence, but their descriptions indicate different search mechanisms.
All tool names follow a consistent snake_case verb_noun pattern using get, add, search, extract, and calculate. The naming is predictable and makes the action and target clear across the entire set.
Ten tools is well within the ideal range for a domain-specific server. Each tool covers a distinct aspect of experiment management, research document handling, content extraction, evidence retrieval, or calculation without unnecessary overlap.
The server supports creating, retrieving, and searching experiments and research documents, plus PDF content extraction and evidence lookup, which covers primary workflows. However, there are no update or delete operations for experiments or documents, and research document metadata cannot be searched directly, leaving notable lifecycle gaps.
Maintenance
Related MCP Connectors
Auditable MCP server for PubMed, Europe PMC, ClinicalTrials.gov, and bioRxiv/medRxiv queries
Public MCP endpoint for collaborative research and knowledge discovery.
Entity-resolved NIH grant corpus (FY1985-2026) via 14 read-only, provenance-carrying MCP tools.
MCP gateway federating 30 biomedical MCP servers behind one endpoint: gnomAD, ClinVar, HPO, VEP.
Related MCP Servers
- FlicenseCqualityDmaintenanceExposes a local biomedical literature pipeline as MCP tools for automated research workflows. Enables literature search, open-access paper retrieval, and draft generation for biomedical and pathology domains through standard MCP clients.6-
- AlicenseBqualityBmaintenanceEnables provenance-first scholarly retrieval, paper ingestion, and reproducible research workflows by searching academic and developer sources, extracting source-located facts and claims, and preserving evidence and provider uncertainty for MCP clients.371Apache 2.0
- FlicenseNot gradedqualityCmaintenanceEnables searching a synthetic healthcare document repository and saving validated document metadata through MCP tools.-
- AlicenseNot gradedqualityBmaintenanceEnables life-science research by providing search and retrieval across linked publications, clinical trials, drugs, genes, regulatory approvals, and patents through MCP clients.1Apache 2.0