Purpose
Enrichr MCP Server is a Model Context Protocol (MCP) server for providing gene set enrichment analysis, calling the Enrichr API under the hood. It is aimed at research scenarios that require enrichment analysis through large language model tools, supports all gene set libraries currently provided by Enrichr, and returns only statistically significant results (adjusted p-value < 0.05) for interpretation by LLM tools.
Main capabilities
- Two tools:
enrichr_analysisfor running enrichment analysis,suggest_librariesfor discovering relevant gene set libraries. - Custom background correction: can test against your own background gene set (e.g., genes expressed in the assay only), rather than using the whole genome.
- Real-time library catalog: the library list is fetched from Enrichr at runtime, newly released libraries appear automatically, and retired libraries are not recommended.
- Guided workflow: provides the
enrichment_analysisprompt, supporting an end-to-end process from library selection and analysis to interpretation. - 22 library categories: provides programmatic category mapping for all libraries (pathways, cancer, kinases, etc.).
- Parallel library queries: all libraries are queried in parallel, enabling fast multi-database analysis.
- Structured output: returns both human-readable text and structured JSON for programmatic use.
- Configurable output format: detailed, compact, or minimal, for managing token usage.
- TSV export: can save complete results as a TSV file.
Tool descriptions
suggest_libraries
Discovers the most relevant Enrichr libraries for a research question. Recommended for use before enrichr_analysis to select the most appropriate libraries for a specific topic. It searches Enrichr's real-time library catalog, so it will not recommend libraries that Enrichr has retired. When two libraries are equally relevant, the newer version is ranked first (e.g., GO_Biological_Process_2026 before ..._2021).
Parameters:
- query (required): research context (e.g., "DNA repair", "breast cancer drug resistance").
- category (optional): filter by category (e.g., cancer, pathways, kinases).
- maxResults (optional): maximum number of results to return (default: 10, maximum: 50).
Returns: a ranked list of libraries with relevance scores, categories, and descriptions, as well as structured JSON containing a suggestions array.
enrichr_analysis
Performs enrichment analysis in parallel across multiple Enrichr libraries.
Parameters:
- genes (required): array of gene symbols (e.g., ["TP53", "BRCA1", "EGFR"]) — at least 2.
- libraries (optional): array of Enrichr library names to query (defaults to the configured libraries).
- background (optional): custom background gene set — at least 20 genes. See below.
- description (optional): description of the gene list.
- maxTerms (optional): maximum number of terms per library (default: 50).
- format (optional): output format: detailed, compact, minimal.
- outputFile (optional): path to save the complete results as a TSV file.
Returns: text content with formatted significant terms (name, p-value, odds ratio, combined score, overlapping genes), as well as structured JSON output containing the complete result data, in which each library has a backgroundCorrected field.
Background correction
By default, Enrichr tests your gene list against the whole genome. If your genes come from a restricted gene set — for example, tissue-expressed genes only, or a targeted panel — the whole-genome default will inflate significance, often by many orders of magnitude. This can be done through background The gene set (universe) extracted from the passed-in list:
The difference is not superficial. For a 16-gene DNA damage list, the adjusted p-value of the top GO term goes from 1.2e-16 (genome-wide) to 1.8e-5 (48-gene background), and the number of "significant" terms drops from 359 to 10.
Background correction runs against Enrichr's separate speedrichr service, which is intermittently unavailable. Failures are automatically retried; if failures persist, the library falls back to uncorrected genome-wide p-values, the results are marked as backgroundCorrected: false, and a prominent WARNING is given in the text output. Fallback results are never presented as having undergone background correction.
Guided workflow
enrichment_analysis Provides a guided workflow for gene set enrichment analysis. Accepts a gene list and an optional research context, then sequentially completes library selection, analysis, and interpretation.
- genes (required): gene symbols, separated by commas or newlines.
- context (optional): the research context used for library selection (triggers the suggest_libraries step).
Library categories
All 200+ libraries are organized into 22 categories. Use suggest_libraries to search all categories, or read enrichr://libraries/{category} to get the complete list for any category.
Usage
Download the latest MCPB bundle (.mcpb file), install it via ☰ (top left) -> File -> Settings, then drag and drop the file onto the Settings window.
Cursor / VS Code: install with default settings.
It can also be installed as a Claude Code plugin.
Manual configuration: add it to the MCP client configuration (e.g. .cursor/mcp.json).
Command-line options
- detailed: full detail, including p-values, odds ratios, and gene lists (default).
- compact: term names + p-values + gene counts (saves about 50% tokens).
- minimal: term names + p-values only (saves about 80% tokens).
Environment variables
Note: CLI arguments take precedence over environment variables.
Multiple server instances
Different instances can be set up for different research contexts.
Common libraries (default)
Applies when using the default -l pop configuration.
Dependent Enrichr APIs
- Add list:https://maayanlab.cloud/Enrichr/addList
- Enrich:https://maayanlab.cloud/Enrichr/enrich
- Library directory:https://maayanlab.cloud/Enrichr/datasetStatistics — fetched at runtime and cached for 24 hours, so the library list does not go stale
- Background-corrected enrichment:https://maayanlab.cloud/speedrichr/api/{addList,addbackground,backgroundenrich}
- Supported libraries: all libraries currently offered by Enrichr (228 at the time of writing)
Note: when a term completely overlaps with the background, Enrichr outputs a bare Infinity literal as the odds ratio, which is not valid JSON. This server can correctly parse these responses; directly using JSON.parse on the raw response will throw an error.
Use cases
- Perform gene set enrichment analysis in LLM tools/clients.
- Multi-database enrichment analysis across multiple Enrichr databases.
- Enrichment analysis that requires custom background gene set correction.
- Discovering gene set libraries suitable for a specific research topic.
Limitations
- Requires network access to the Enrichr API.
- Background correction depends on the speedrichr service, which is intermittently unavailable; on failure it falls back to uncorrected results and marks them.
- Some features and configuration details (such as specific environment variable names, the complete default library list, the range of supported MCP clients, etc.) are not yet provided in the materials.