ImmPort MCP Server
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_LOG_LEVEL | No | Log level (DEBUG, INFO, WARNING, ERROR). | WARNING |
| IMMPORT_API_KEY | No | Your ImmPort API key. Searching and controlled-vocabulary lookups work without a key; study data, assay results and files need one. | |
| IMMPORT_BASE_URL | No | ImmPort Data Query API base URL. | https://immport.org/data/query |
| RESPONSE_CACHE_TTL | No | Seconds to cache API responses (0 turns caching off). | 300 |
| IMMPORT_METRICS_ENABLED | No | Send usage metrics. Set to false to send nothing. | true |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server provides access to the ImmPort immunology data repository. Use search_studies or search_subjects to discover data, then drill into specific studies with get_study_data, retrieve assay results with get_assay_results, and access files with get_study_files. Use lookup_controlled_vocabulary to get valid filter values for any parameter. Refer to the immport://data-model and immport://query-tips resources for guidance on the data model and efficient query patterns, immport://search-fields for the full list of fields searchable/retrievable via search_studies/search_subjects (including nested objects like publications, reagents, and experiments — check this before looping get_study_data over many studies for any cross-study question), and immport://assay-results-reference for the full per-assay-type field list and filter parameters for get_assay_results.
AUTHENTICATION — two layers: • search_studies, search_subjects, lookup_controlled_vocabulary: PUBLIC — no auth needed. • get_study_data, get_assay_results, get_study_files: REQUIRE an ImmPort API key. When connected via mcp.immport.org (claude.ai / AgentCore): the OAuth2 login you completed when adding this server IS your ImmPort API key — it is forwarded automatically on every authenticated tool call. No extra configuration needed. When running locally (stdio): set IMMPORT_API_KEY in .env.
EFFICIENCY RULES — follow these before calling any tool:
DATA AVAILABILITY FIRST: Before calling get_study_data or get_assay_results, call get_study_data_availability(study_accession) to see record counts for every ImmPort data category. This single call (reads a ~5 KB file) tells you exactly which assay types, demographics, and clinical data categories have been parsed into the ImmPort database for this study. For several studies pass them comma-separated (up to 20) in one call. Examples: elisa_result=0 → skip ELISA; hai_result=240 → fetch HAI titers; assessment_component>10000 → use Tab.zip not the API. ⚠️ Counts reflect PARSED data only. Zero does not mean the data doesn't exist — it may be in the study files but not yet extracted into the database. Always check get_study_files when counts are unexpectedly low.
PARALLEL LOOKUPS: lookup_controlled_vocabulary is zero-cost (in-memory cache). Issue lookup calls in parallel with search calls — never wait for a lookup before searching.
TAB.ZIP OVER MULTIPLE API CALLS: If you need more than 2 resources for one study, get a signed URL for the Tab.zip (get_study_files action='manifest', file_type='release_file' → find _Tab.zip → get_study_files action='download') instead of multiple get_study_data calls.
PARALLEL STUDY FETCHES: When fetching data for multiple studies, issue all get_study_data calls in parallel — they are independent.
SOURCE FIELDS: Always set source_fields on search_studies/search_subjects. The default returns full OpenSearch documents (very large). Specify only the fields you need.
PAGINATION: Always check hits.total.value in search results. If total > page_size, issue additional calls with from_record incremented by page_size.
STREAM VS DOWNLOAD: get_study_files action='stream' is for individual TSV/text files only. Use action='download' for any zip file (Tab.zip, ALL_DATA.zip) — it returns a signed URL. ⛔ NEVER attempt to fetch or open a signed CloudFront/S3 URL yourself — you are in a sandbox with no network access to those hosts and it will always fail. Present the URL to the user and let them download it.
SPARSE STUDY DATA: Many ImmPort studies — especially older studies and recently released data — have minimal parsed data in the database. When get_study_data returns very few subjects, missing demographics, or limited assay data, do NOT stop there. Always check the study files for the full picture: a. Call get_study_files(action='manifest', study_accession=...) with NO file_type filter to see everything available. b. Stream individual study or protocol documents (file_type='study_file' or 'protocol_file') using action='stream' — most are plain text or TSV and can be read inline for AI analysis. c. For all structured metadata tables, get a signed URL for the Tab.zip (file_type='release_file' → find fileName ending '_Tab.zip' → action='download') and present that URL to the user — the zip contains every study table as a TSV file. d. For the complete dataset including raw result files, check file_type='zip_file' (SDY##_DR##_ALL_DATA.zip) — but warn the user it can be very large (some studies >100 GB).
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
| resources | {
"subscribe": false,
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| search_studiesA | Full-text and faceted search across all ImmPort studies. Returns a compact shape: {total, returned, studies, facets}. 'studies' is a flat list of study records (no OpenSearch envelope/score/highlight noise). 'facets' is omitted unless you pass the facets parameter. Use this as the entry point for any study discovery workflow. No authentication required. Key parameters:
EFFICIENCY TIPS:
|
| search_subjectsA | Full-text and faceted search across all ImmPort subjects/participants. Returns a compact shape: {total, returned, subjects, facets}. 'subjects' is a flat list of subject records (no OpenSearch envelope/score/highlight noise). 'facets' is omitted unless you pass the facets parameter. Useful for cross-study cohort discovery (e.g. find all female subjects in influenza studies). No authentication required. Key parameters:
EFFICIENCY TIPS:
|
| get_study_dataA | Get any sub-resource for one or more ImmPort studies by specifying the MULTIPLE STUDIES: study_accession may list up to 20 studies separated by commas (e.g. 'SDY1,SDY269,SDY305') to get one combined result — every row carries studyAccession, so rows can be grouped per study. Studies without data for that resource are simply absent. Prefer one multi-study call over one call per study when comparing studies. Every resource returns a JSON array; 'summary' and 'json_ld' return one entry per study. ⚡ EFFICIENCY RULE: Issue multiple resource calls IN PARALLEL — they are independent. This tool returns structured JSON directly and is the preferred approach for AI agents. Only use Tab.zip (get_study_files action='manifest' → action='download') when you need join tables with no API equivalent: reagent specs, expsample-to-reagent mapping, fcs_header_marker, or expsample-to-treatment joins. Available resources: summary: ▶ START HERE for any study workflow. Rich summary: title, PI, description, objectives, endpoints, hypothesis, subjects count, interventions, data completeness, publications, personnel, links basic_info: Basic study fields: title, briefDescription, doi, clinicalTrial, enrollment, age range, start/completion dates, sponsoring org arm: Study arms (cohorts/treatment groups): armAccession, name, description, typeReported, typePreferred (e.g. Placebo Comparator, Experimental) planned_visits: Planned visits (time points): plannedVisitAccession, name, orderNumber, minStartDay, maxStartDay, startRule, endRule conditions: Disease/conditions studied: conditionPreferred, conditionReported personnel: Study personnel: personAccession, firstName, lastName, roleInStudy, titleInStudy, organization, email, orcid protocols: Protocol documents: protocolAccession, type, name, description, fileName contract_program: Contract/funding: contractGrantId, contractGrantName, contractGrantCategory, programId, programCategory, programDescription inclusion_exclusion: Inclusion/exclusion eligibility criteria: criterion text and category (Inclusion or Exclusion) pubmed: PubMed publications: pubmedId, doi, authors, title, journal, year, issue. For cross-study publication analysis (e.g. 'top journals'), use search_studies(source_fields=['pubmed.journal']) in bulk instead of looping this per study — see immport://search-fields file: Study document files (case report forms, data dictionaries, protocols): studyFileAccession, studyFileType, description, fileName. NOT for downloadable result files — use files tool for those json_ld: JSON-LD (schema.org Dataset) structured metadata: title, abstract, DOI, creators, funders, health conditions, measurement techniques, citations, data access conditions links: External links: studyLinkId, name, type, value (URL) experiments: Experiments (assay runs): experimentAccession, name, description, measurementTechnique adverse_events: Adverse events: adverseEventAccession, subjectAccession, namePreferred, severityPreferred, outcomePreferred, causality, organOrBodySystemPreferred, startStudyDay, endStudyDay demographic: ⚠️ LARGE — Subject demographics (one row per subject): subjectAccession, armAccession, armName, ageEvent, ageUnit, minSubjectAge, maxSubjectAge, gender (=sex field), race, ethnicity, ancestral_population, species, strain, subjectLocation. For deep analysis use Tab.zip (subject.txt) instead. (⚠️ may be large) biosample: ⚠️ LARGE — Subject→biosample: subjectAccession, biosampleAccession, biosampleName, type, subtype, plannedVisitAccession. For deep analysis use Tab.zip (biosample.txt) instead. (⚠️ may be large) expsample_mapping: ⚠️ LARGE — Full Subject→BioSample→Experiment→ExpSample hierarchy. Prefer get_assay_results for assay data, or Tab.zip (expsample.txt) for the full hierarchy. (⚠️ may be large) interventions: ⚠️ LARGE — Subject-level interventions: compoundNameReported, compoundRole, dose, doseUnits, routeOfAdminPreferred, startDay, endDay, status. For deep analysis use Tab.zip (treatment.txt) instead. (⚠️ may be large) lab_tests: ⚠️ LARGE — Clinical lab test results (CBC, BMP etc): labTestPanelNamePreferred, labTestNamePreferred, resultValuePreferred, resultUnitPreferred, plannedVisitAccession. For deep analysis use Tab.zip or get_assay_results(assay_type='lab_test') instead. (⚠️ may be large) assessment: ⚠️ LARGE — Questionnaires/clinical assessments: assessmentComponentNamePreferred, resultValuePreferred, resultValueCategory, verbatimQuestion, studyDay. For deep analysis use Tab.zip (assessment_component.txt) instead. (⚠️ may be large) immune_exposure: ⚠️ LARGE — Vaccinations/infections/challenges: exposureMaterialPreferred, exposureProcessPreferred, diseasePreferred, diseaseStagePreferred. For deep analysis use Tab.zip (immune_exposure.txt) instead. (⚠️ may be large) |
| get_study_data_availabilityA | Get a record-count inventory for every ImmPort data category in a study — how many rows have been parsed out of the raw data and stored in the ImmPort database. ⚡ CALL THIS FIRST when assessing what data a study contains. It reads the study's ~5 KB release file listing every ImmPort data category alongside its record count for this specific study. MULTIPLE STUDIES: study_accession may list up to 20 studies separated by commas (e.g. 'SDY180,SDY212') — one call instead of one per study; the result is then a list with one entry per study, in the order given. USE THIS TO AVOID WASTED API CALLS: • elisa_result=0 → skip get_assay_results(assay_type='elisa') • hai_result=240 → study has HAI titer data worth fetching • lab_test=0 → no clinical lab data, don't call get_study_data(resource='lab_tests') • assessment_component=98893 → very large dataset, use Tab.zip instead of the API • immune_exposure=0 → no vaccination/challenge records • fcs_analyzed_result=0 but expsample=500 → raw FCS files exist but no gated data ⚠️ IMPORTANT LIMITATION — PARSED DATA ONLY: These counts reflect only data that ImmPort has parsed and loaded into its relational database. Many studies — especially older studies, recently submitted data, and studies with non-standard formats — contain data exclusively inside their study files that has not been parsed into the database. A count of 0 does NOT mean the data doesn't exist; it means it hasn't been extracted into the ImmPort data model yet. When counts are low or zero for a study you expect to have data:
Returns (one study): {'studyAccession': 'SDY####', 'dataRelease': 'DR##', 'tables': {category_name: record_count, ...}}; a study without the release file gets {'studyAccession', 'error'} instead. Several studies: a list of these. Zero-count categories ARE included — 0 means not parsed into the database, not necessarily absent from the study. Requires authentication. |
| get_release_notesA | ImmPort data releases and the release history of studies. Data releases are named DR (e.g. DR69, DR58, point releases like DR52.1); version also accepts 58 or dr58. Requires authentication. Modes (chosen by which arguments are given): • study_accession only → each study's release history, newest first: [{studyAccession, briefTitle, releases: [{version, releaseDate, status, releaseNotes}]}]. status is 'Initial' (first released) or 'Updated'. releaseNotes is often null for older releases. study_accession may list up to 20 studies separated by commas. • study_accession + version='DR58' → only that release's entry for each study (404 if the study was not in that release). • study_accession + version='latest' → each study's OWN most recent release (e.g. SDY1 → DR58, even if the current release is DR69). • version only (e.g. 'DR69', or 'latest' for the newest release) → the release notes document the data release process published for that release, as is: release_version, release_date, study.studies[] (study_accession, brief_title, description, status, subjects, personnel, publications, assays, programs, release_notes on recent releases) and dataSummary (totals at that release). ⚠️ Large: 100–700 KB. 404 if its notes are not published yet. • neither → list of all data releases, newest first: [{version, releaseDate, initialStudyCount, updatedStudyCount}]. Examples: get_release_notes() # which releases exist get_release_notes(version='latest') # what's in the newest release get_release_notes(study_accession='SDY1') # when was SDY1 released/updated, and why get_release_notes(study_accession='SDY1,SDY269', version='latest') |
| get_assay_resultsA | Retrieve assay results for any ImmPort assay type. Select the assay type via the ⚠️ SCOPE BEFORE CALLING: The upstream ImmPort API returns ALL matching records with no server-side pagination or aggregation. Large studies (e.g. flow cytometry, lab tests) can return tens of thousands of rows from a single visit — and combining a broad filter (arm_accession or study_time_collected alone) with a large study can time out outright. Always narrow with planned_visit_accession + arm_accession together (the most reliable combination) before calling. Use get_study_data(resource='experiments') first to confirm the assay type exists in the study. Required: study_accession (list). Common filters: arm_accession, planned_visit_accession, subject_accession, measurement_technique, study_time_collected(_gte/_lte/_gt/_lt). Response-shrinking options: fields (project columns), name_contains (substring filter), summarize (per-group stats), limit/offset (paging) — these only shrink what's returned, not the upstream query cost, so real filters are still the best way to avoid timeouts. For the full per-assay field list, every filter parameter, and response-shrinking option details, see the immport://assay-results-reference resource. |
| lookup_controlled_vocabularyA | Get valid controlled vocabulary values for any ImmPort lookup table. Results are served from an in-memory cache (pre-fetched at startup, refreshed every 24 hours) — no API call is made at query time. Available tables: lkRace: Race values used in subject demographic data lkEthnicity: Ethnicity values used in subject demographic data lkSpecies: Species values (e.g. Homo sapiens, Mus musculus) lkSubjectLocation: Subject location values used in studies lkAncestralPopulation: Ancestral population values used in subject data lkSex: Sex values (e.g. Female, Male, Not Specified) lkAgeEvent: Age event values (e.g. Age at enrollment) lkDisease: Disease/condition names with disease ontology IDs lkDiseaseStage: Disease stage values lkResearchFocus: Research focus areas (e.g. Vaccine Response, Allergy) lkSampleType: Biosample types (e.g. PBMC, Whole Blood, Serum) lkSourceType: Source types (e.g. File, Public Repository) lkExpMeasurementTech: Measurement techniques (e.g. Flow Cytometry, ELISA, RNA sequencing) lkExpsampleResultSchema: Experiment sample result schema values (e.g. PUBLIC REPOSITORY) lkReagentType: Reagent types used in experiment metadata lkPlateType: Plate types used in experiment/assay metadata lkAnalyte: Analyte reference: gene symbols, gene IDs, UniProt entries, protein ontology IDs, immunology symbols lkProteinName: Protein names with UniProt IDs lkHmdb: HMDB metabolite entries used in metabolomics data lkLocusName: HLA locus names (e.g. HLA-A, HLA-B, HLA-DRB1) lkCellPopulation: Cell populations that appear in flow cytometry (FCS) response data lkCellPopulationMarker: Cell population marker values used in flow cytometry panel metadata lkStudyPanel: Study panel values used in study categorization lkStudyFileType: Study file types (e.g. study_file, protocol, result) lkPublicRepository: Public repository names (e.g. GEO, SRA, ArrayExpress) lkDataCompleteness: Data completeness level descriptions lkVisibilityCategory: Visibility category values lkPersonnelRole: Personnel roles (e.g. Principal Investigator, Co-Investigator) lkUserRoleType: User role types used in system access control lkOrganization: Organization names used in study personnel data lkTimeUnit: Time units (e.g. Days, Hours, Weeks) lkT0Event: T0 event values (study time zero reference events) lkUnitOfMeasure: Units of measure used across all result types lkAdverseEventSeverity: Adverse event severity values (e.g. Grade 1 Mild, Grade 2 Moderate) lkCompoundRole: Compound/intervention roles (e.g. Vaccine, Adjuvant) lkCriterionCategory: Criterion categories used in study eligibility criteria lkExposureProcess: Exposure process values used in immunization/exposure data lkExposureMaterial: Exposure materials (e.g. vaccine names, pathogens) lkVirusStrain: Virus strains with taxonomy IDs used in HAI/neutralization assays lkTranscriptType: Transcript types (e.g. mRNA, microRNA) lkLabTestPanelName: Lab test panel names (e.g. CBC, BMP) — response field only, not filterable lkLabTestName: Lab test names with CDISC codes — response field only, not filterable lkMassSpectrometryType: Mass spectrometry types used in proteomics/metabolomics metadata lkFileDetail: File detail types used in study file metadata lkProtocolType: Protocol types (e.g. Informed Consent, Lab Test) |
| get_data_modelA | Get the ImmPort data model: the tables of the release database (the same tables as the Tab.zip / MySQL release files), with columns, types, descriptions, keys and joins. Public — no authentication needed. • no table → index of all tables: [{name, type, description, columnCount}] (~110 tables) • table='arm_or_cohort' → that table in full: columns [{name, type, nullable, default, description}], primaryKey, foreignKeys [{columns, referencedTable, referencedColumns}], indexes, and referencedBy (tables that point to it) Use it to understand what a column means, which columns hold controlled values (foreign keys to lk_* tables — get the values with lookup_controlled_vocabulary), and how to join tables (e.g. subject → arm_2_subject → arm_or_cohort → study) before analysing Tab.zip or MySQL files or writing SQL. For the overview of entities and API endpoints read immport://data-model. |
| get_study_filesA | Access ImmPort study files, protocol documents, and result files — list, stream, or download. action='manifest' — list all files for a study. Required: study_accession (one, or up to 20 separated by commas, e.g. 'SDY1,SDY269'; each record carries studyAccession) Optional: file_type filter — one of: study_file supplemental study documents protocol_file protocol documents result_file individual assay result files (FCS, CEL, txt, gz, etc.) release_file current DR package: Tab zip, MySQL zip, summary, manifest, subject-to-result mapping files archive_file older DR versions as SDY##-DR{n}.zip (Tab + MySQL, no raw files) zip_file SDY##_DR##_ALL_DATA.zip — ALL metadata + ALL raw result files; can be very large (some studies >100 GB); check filesizeBytes first Returns: list of records with fileUUID, fileName, fileType, filesizeBytes, path. Common patterns: Latest Tab metadata zip: file_type='release_file' → find fileName ending '_Tab.zip' Full data + raw files: file_type='zip_file' → SDY##_DR##_ALL_DATA.zip Older DR versions: file_type='archive_file' → SDY##-DR{n}.zip (Tab nested inside) 💡 SPARSE DATA: Many ImmPort studies — particularly older studies and recently released data — have minimal parsed data in the database. The full study detail (protocol design, subject demographics, assay methodology, investigator notes) is often only available in the study files. When get_study_data returns limited results, call manifest with NO file_type filter to see all available files, then: • stream individual study_file / protocol_file documents (plain text / TSV) using action='stream' for inline AI analysis • provide the signed URL for the _Tab.zip (release_file) which contains every study metadata table as a TSV — complete structured data action='download' — get a signed CloudFront URL for a file. Required: file_uuid (fileUUID from manifest) Returns: {'url': ''} ⛔ DO NOT fetch or open this URL yourself — you are running in a sandbox with no network access to CloudFront/S3 and the request will fail. ONLY present the URL to the user so they can download it in their browser or with curl/wget. Your job is done once you return the URL. Use for: zip files, large binaries, any file the user wants to fetch themselves. action='stream' — fetch file content inline for AI analysis. Required: file_uuid (fileUUID from manifest) Optional: max_bytes (default 2 MB) Returns: {'content': ''} for text/CSV/TSV/JSON files, {'content_base64': '...'} for binary files. ⚠️ Do NOT stream zip files — they are binary and will be truncated uselessly. Use action='download' for any zip file. ⚠️ ImmPort enforces a per-file daily download limit — avoid redundant calls. Examples: get_study_files('manifest', study_accession='SDY61', file_type='release_file') get_study_files('download', file_uuid='97a310f6-405d-45c9-8ce9-75f7ccac4ffb') get_study_files('stream', file_uuid='325b0667-59d8-4838-8bd7-5b0a5840a3e6') |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| explore_disease_area | Discover and summarize ImmPort studies for a disease or research topic. |
| study_deep_dive | Comprehensive deep-dive analysis of a single ImmPort study. |
| compare_immune_responses | Compare immune responses across multiple ImmPort studies for a vaccine or pathogen. |
| build_cohort | Build a cross-study subject cohort matching specific demographic and clinical criteria. |
| download_study_files | Find and download data files for a study. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| assay_results_reference | Full field/filter/post-processing reference for get_assay_results, by assay_type. |
| data_model | ImmPort data model: entity hierarchy, accession formats, API endpoint map, auth guide. |
| query_tips | Best practices, workflow patterns, and filter tips for querying ImmPort efficiently. |
| search_fields | Full field reference for search_studies/search_subjects: source_fields, nested objects, facets, sort_field. |
| api_schema | Full OpenAPI v3 spec for the ImmPort Data Query API — endpoint paths, parameters, and response schemas. |
TDQS
Scored across 9 tools
Most tools have clearly distinct targets: study search vs. subject search, metadata retrieval vs. assay results, availability counts vs. actual data, and file access vs. data-model introspection. However, get_study_data is a large multi-resource tool that overlaps somewhat with get_assay_results and get_study_files, and search_studies references nonexistent lookup_research_focus/lookup_disease tools, which slightly muddies tool selection.
All tool names use consistent snake_case with predictable verb_noun patterns (search_studies, get_study_data, lookup_controlled_vocabulary). The get_/search_/lookup_ prefixes map cleanly to retrieval actions, and no mixed camelCase or vague names appear.
Nine tools is well-scoped for an ImmPort data-access server. The set consolidates many resources and lookup tables behind parameterized tools rather than exploding into dozens of near-duplicate endpoints.
The surface covers the full read-only workflow: controlled vocabulary lookup, study and subject discovery, data availability, study metadata subresources, assay results, release history, data-model inspection, and study file access. There are no obvious dead ends for the stated ImmPort retrieval domain.