rnaseq-mcp
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., "@rnaseq-mcpCompare treated vs control and show volcano plot"
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.
rnaseq-mcp
Server MCP per l'analisi di dati Bulk RNA-seq tramite agenti LLM. Permette di interrogare un dataset in linguaggio naturale. Esegue codice R e Python in un container Docker isolato, con anonimizzazione automatica dei campioni e controllo sulla privacy degli output.
Prerequisiti
Docker
Python ≥ 3.11
Un client MCP compatibile (es. Claude Code, Mistral Vibe o qualsiasi agente che supporti il protocollo MCP)
Related MCP server: DROMA MCP Server
Quickstart
1. Build del container
cd container
docker build -t rnaseq-executor:latest .Nel container vengono installati pacchetti di R (DESeq2, edgeR, limma, clusterProfiler, fgsea) e le librerie di annotazione (org.Hs.eg.db, org.Mm.eg.db) per garantire funzionalita offline.
2. Installazione del server
pip install -e .3. Configurazione del client MCP
Registra il server nel tuo client MCP con questi parametri:
Parametro | Valore |
Comando |
|
| percorso assoluto a |
| percorso assoluto a |
I file di input consistono in 2 CSV:
counts.csv— matrice geni × campioni (gene ID come indice di riga)metadata.csv— tabella campioni × variabili (stesso indice dicounts.csv)
4. Utilizzo
Una volta connesso il server, i tool disponibili sono:
Tool | Descrizione |
| Elenca i file in |
| Anteprima di un CSV |
| Esegue codice R (sessione persistente) |
| Esegue codice Python (namespace persistente) |
| Recupera i risultati da |
| Stato della sessione e pacchetti disponibili |
| Azzera container, stato e output |
Esempio di sessione:
Analizza i dati RNA-seq in /data confrontando treated vs control,
correggi per batch e genera volcano plot e heatmap.Viene fornito un esempio prompt di sistema in prompts/system_prompt.md.
Privacy
All'avvio, il server:
Rimuove le colonne di metadati con identificatori personali (nomi, ID campione, barcode, ecc.)
Rinomina i campioni con alias anonimi
S1, S2, ..., SNBlocca l'esportazione di matrici per-campione (count, PCA) come CSV
Mappatura dei campioni
La corrispondenza S1 → nome_reale viene scritta su host nel file:
/tmp/rnaseq-<session_id>/host_only/sample_mapping.jsonIl file non è montato nel container e non è accessibile tramite i tool MCP — il modello non può mai risalire ai nomi originali. Il formato è:
{ "S1": "nome_originale_1", "S2": "nome_originale_2", ... }Il file viene eliminato alla chiusura del server (o alla chiamata di reset_session). Per conservarlo, copialo manualmente prima di terminare la sessione:
cp /tmp/rnaseq-*/host_only/sample_mapping.json ./sample_mapping.jsonOutput
I file scritti in /output dal codice R/Python sono montati su host nella directory:
/tmp/rnaseq-<session_id>/output/Sono accessibili direttamente dal filesystem dell'host durante tutta la sessione, senza dover passare per il tool get_outputs. Quest'ultimo è utile principalmente per restituire i risultati al modello (ad es. per leggere una tabella CSV o visualizzare un plot nel contesto della conversazione).
I file vengono eliminati alla chiusura del server o alla chiamata di reset_session. Per conservarli:
cp -r /tmp/rnaseq-*/output/ ./risultati/Pacchetti R disponibili
DESeq2, edgeR, limma, ggplot2, pheatmap, ComplexHeatmap, EnhancedVolcano, clusterProfiler, fgsea, msigdbr, org.Hs.eg.db, org.Mm.eg.db, AnnotationDbi
Licenza
MIT License — Copyright (c) 2026 Stefano Barbi
Available Tools
7 toolsdescribe_sessionA
Return R sessionInfo(), available Python symbols, and files already produced in /output. Useful at the start of a session to confirm what packages are available.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It describes the output (R sessionInfo, Python symbols, files) without hinting at destructive effects. Could explicitly state non-mutating nature, but plausible read-only.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences: first sentence lists what it does, second provides usage context. No redundancy, highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given output schema exists, description adequately summarizes return values. Covers all relevant aspects for a session introspection tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters, schema coverage 100%. Description adds value by detailing the three specific return components (R session, Python symbols, files), which goes beyond the empty schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states it returns R sessionInfo, Python symbols, and files in /output. Differentiates from sibling tools like execute_python and get_outputs by focusing on session introspection.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly notes usefulness at start of session to check available packages, providing clear context. Does not mention alternatives or exclusions, but sufficient for the intended use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
execute_pythonA
Execute Python code in the isolated analysis container. The Python namespace is PERSISTENT across calls.
OUTPUT RULES (same as execute_r):
Write to /output ONLY aggregated results (gene/pathway level).
Do NOT write per-sample matrices as CSV.
Plots saved with matplotlib/seaborn: plt.savefig("/output/.png").
If the server blocks a CSV, produce an aggregated equivalent instead.
Available packages: pydeseq2, pandas, numpy, matplotlib, seaborn, scipy, statsmodels.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses persistent Python namespace across calls, isolated container, and output directory constraints. No annotations are provided, so the description carries the full burden; it does not cover error handling or resource limits but covers key behavioral traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Information is front-loaded with the core action, followed by important details on namespace persistence and output rules. Some repetition from execute_r (same rules) is acceptable for completeness; not overly verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (isolated container, persistent namespace, output constraints) and the presence of an output schema, the description covers essential aspects for correct usage, though it omits error handling or performance notes.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Only one parameter 'code' with 0% schema coverage, but the name is self-explanatory. The description adds context about what to include (import packages, ensure output rules) and the environment, compensating for the lack of schema detail.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Execute Python code in the isolated analysis container,' specifying the verb (execute) and resource (Python code). It distinguishes from execute_r by noting persistent namespace and referencing common output rules.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides detailed output rules (aggregated results only, avoid per-sample CSVs, plot saving convention) and lists available packages. However, it does not explicitly state when to prefer Python over R or when not to use the tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
execute_rA
Execute R code in the isolated analysis container. The R session is PERSISTENT: objects defined in earlier calls remain available.
OUTPUT RULES (enforced server-side — follow them in your code):
Write to /output ONLY aggregated results: DE tables (log2FC, pvalue, padj per gene), pathway scores, group-level summary statistics, model coefficients.
Do NOT write per-sample matrices (normalized counts, raw counts, PCA coordinates) as CSV/TSV to /output. Keep them in R memory for intermediate computation.
Plots (PNG) showing sample-level data are permitted — use anonymous labels (S1, S2, ...).
ggsave() and png() write to /output/; use descriptive names.
If the server blocks a CSV file, revise your code to export an aggregated version.
Available R packages: DESeq2, edgeR, limma, ggplot2, pheatmap, ComplexHeatmap, EnhancedVolcano, ggrepel, patchwork, clusterProfiler, fgsea, msigdbr, org.Hs.eg.db, org.Mm.eg.db, AnnotationDbi. No internet access — use org.Hs.eg.db instead of biomaRt for gene annotation.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description thoroughly discloses behavioral traits: persistent R session, output rules (aggregated results only, no per-sample matrices), plot restrictions (anonymous labels), server-side enforcement, and limited package availability. This fully informs the agent of important constraints.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections, but it is somewhat lengthy. It front-loads the purpose and uses bullet points for output rules, making it scannable. A slight reduction in verbosity could improve conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the persistent session, output restrictions, available packages, and connectivity limitations. Given the presence of an output schema (not shown), it does not need to explain return values. It is complete for a tool of this complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The single 'code' parameter is minimally described but its purpose is implied by 'Execute R code'. The description compensates for 0% schema coverage by explaining the execution context and constraints, though it does not explicitly define the parameter format or length.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Execute R code in the isolated analysis container.' It specifies the persistent R session, output rules, and available packages, distinguishing it from sibling tools like execute_python.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides detailed guidelines on output rules, prohibited file types, and package choices (e.g., use org.Hs.eg.db instead of biomaRt). However, it does not explicitly contrast with execute_python or state when to choose R over Python.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_outputsA
Retrieve all files written to /output during this session. CSV files containing per-sample data are blocked and replaced with an explanatory message. Images (PNG) are returned as base64-encoded strings.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses that CSVs are blocked with a message and PNGs are returned as base64. Could mention other file types or that output is session-specific.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three concise sentences, front-loaded with main purpose, no waste.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no parameters and presence of an output schema, the description is largely complete. Minor gap on handling of non-CSV/non-PNG files.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters, so schema is trivially covered. Description adds value by explaining behavior of the tool beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the tool retrieves all files from /output during the session. Differentiates from siblings like list_data_files by specifying the output directory and session context.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use vs alternatives, but the purpose is implied. Could improve by stating not to use for data files outside output.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_data_filesA
List files available in /data (anonymized counts and metadata).
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description carries the full burden. It discloses that it returns anonymized counts and metadata, but does not state side effects, authorization needs, or rate limits. As a listing operation it is likely safe, but more transparency would improve the score.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single, front-loaded sentence with no superfluous words. Every part contributes to understanding the tool's purpose and output.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is sufficient for a simple zero-parameter listing tool. It explains what the output contains. However, it could mention if the listing is sorted or if there are any filtering capabilities, though not strictly necessary given the lack of parameters and presence of an output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are zero parameters, so schema coverage is 100%. The description adds value by explaining the output content (anonymized counts and metadata), which is not in the input schema. Baseline for 0 params is 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'list', the resource 'files available in /data', and specifies the output nature 'anonymized counts and metadata'. It distinguishes itself from sibling tools like describe_session or read_table.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit when-to-use or when-not-to-use guidance is given. The description implies usage for browsing available files, but does not mention alternatives or prerequisites given the sibling set.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_tableA
Read the first n_rows of a CSV/TSV file from /data and return it as a markdown table. Useful for inspecting column names, sample aliases, and group labels before writing analysis code.
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| n_rows | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It states the tool is read-only, operates on files in /data, and returns a markdown table. It does not cover error cases or permissions, but for a simple read tool this is adequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no wasted words. The purpose is front-loaded and every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity, the description covers the key aspects: what it reads, from where, and for what purpose. The existence of an output schema further reduces the need to describe return values.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% description coverage, but the description adds meaning by specifying that the file is a CSV/TSV from /data and that n_rows refers to 'first n_rows'. This compensates well for the lack of schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool reads the first n_rows of a CSV/TSV file from /data and returns a markdown table. The verb 'Read' and resource 'CSV/TSV file' are specific and distinct from sibling tools like list_data_files or execute_python.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage context: 'Useful for inspecting column names, sample aliases, and group labels before writing analysis code.' However, it does not explicitly mention when not to use it or suggest alternatives, though the sibling tools implicitly provide options.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
reset_sessionA
Destroy the current Docker container and start a fresh one with the same anonymized data. Use this to clear all in-memory R/Python state and /output files.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description fully discloses the destructive nature ('Destroy the current Docker container') and the effects ('clear all in-memory R/Python state and /output files'). It lacks details on whether the action is irreversible or if other sessions are affected, but overall provides good behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences with no fluff. The first states the action, the second provides usage context. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the core functionality and gives a clear usage context. It mentions that anonymized data is retained and that output files are cleared. However, it does not mention if there is any confirmation step or undo capability, which might be relevant for a destructive action. Overall, sufficiently complete for a simple tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the schema coverage is 100%. The description does not need to add parameter information. Baseline for zero-parameter tools is 4, and the description meets that without needing to elaborate on parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Destroy the current Docker container and start a fresh one with the same anonymized data.' It uses a specific verb (destroy, start) and names the resource (Docker container). It also distinguishes from sibling tools like execute_python and execute_r, which run code rather than resetting the environment.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description says 'Use this to clear all in-memory R/Python state and /output files,' which implies when to use. However, it provides no guidance on when not to use, no mention of prerequisites or consequences, and no alternatives listed. This is implied usage without explicit exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
7 tool updates
v0.1.0- First observed
describe_session - First observed
execute_python - First observed
execute_r - First observed
get_outputs - First observed
list_data_files - First observed
read_table - First observed
reset_session
TDQS
Scored across 7 tools
Each tool has a clear, distinct purpose: environment inspection, code execution per language, output retrieval, data exploration (listing and reading), and session reset. No two tools overlap in functionality.
All tool names follow a consistent verb_noun pattern (e.g., describe_session, execute_python, list_data_files). The naming is predictable and easy to interpret.
With 7 tools, the server covers all essential activities for RNA-seq analysis: environment setup, code execution, data exploration, output retrieval, and session management. The count is well-scoped and not excessive.
The tool surface provides a solid foundation for RNA-seq analysis: data listing, reading, execution in both R and Python with relevant packages, output retrieval, and reset. A minor gap is the lack of a direct quality control or standard pipeline tool, but the execution tools suffice.
Maintenance
Related MCP Connectors
Ask questions in plain language, get answers from your business database. No SQL required.
Ask data questions in natural language. Get SQL, insights, and charts from your databases.
Knowledge graph ingestion, entity search, ontology analysis, and CoPass scoring.
The statistical analyst in your AI chat — validated, citable, re-runnable analysis of your data.
Related MCP Servers
- AlicenseCqualityCmaintenanceAn MCP server that enables single-cell RNA sequencing analysis through natural language, supporting data processing, visualization, and analysis tasks without requiring coding knowledge.5212BSD 3-Clause
- AlicenseNot gradedqualityDmaintenanceEnables natural language interactions with cancer pharmacogenomics data through the DROMA platform, supporting drug-omics association analysis, dataset management, molecular profile loading, and treatment response analysis across multiple research projects.1Mozilla Public 2.0
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables scRNA-Seq analysis through natural language, providing tools for data preprocessing, clustering, and biological visualization. It supports both predefined function execution and a flexible code mode powered by a Jupyter backend for automated single-cell transcriptomics workflows.16BSD 3-Clause
- FlicenseNot gradedqualityCmaintenanceProvides a natural language interface for single-cell RNA-Seq analysis using the decoupleR framework. It enables users to perform biological pathway inference, data clustering, and visualization through MCP-compatible AI clients.4-