evs-cadsr-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
evs-cadsr-mcp (prototype, first pass)
An MCP server over NCI EVS (NCI Thesaurus) and caDSR, built with
FastMCP and hosted in FastAPI. It implements all three
increments of docs/evs-cadsr-mcp-proposal.md except the
local NCIt retrieval index: the shared core platform (envelopes, release resolver, cache,
resilient HTTP client, budgets, cursors), twenty-one read-only evs_* tools over the live
EVS REST API, sixteen cadsr_* tools over the caDSR II APIs, and eleven map_* tools that
compose the two for the primary use case, mapping between CDE content and NCIt concepts
starting with the GDC data dictionary (Phases 0–2, 4 and 5 of the delivery plan).
New here? QUICKSTART.md gets you from clone to asking NCIt questions in VS Code, Claude Code or Claude Desktop in about five minutes. Working with a coding agent? AGENTS.md holds the repo rules, and .github/skills/ the add-a-tool and live-test workflows.
Layout
src/evs_cadsr_mcp/
core/ config.py envelopes.py errors.py release.py cache.py shared_cache.py http_client.py budget.py cursor.py
context.py toolkit.py auth.py ratelimit.py audit.py metrics.py
evs/ client.py models.py content.py service.py traversal.py find_concepts.py tools/
cadsr/ client.py models.py normalise.py search.py service.py tools/
map/ capability.py models.py resolve.py align.py analysis.py icdo_map.py icdo_sync.py service.py tools/ fragments/
(each tools/ package: one module per tool, _args.py, resources.py, prompts.py, __init__.py)
server/ mcp_app.py (FastMCP + wiring) middleware.py (platform chain) app.py (FastAPI host) cli.py
deploy/ Dockerfile docker-compose.yml cdk/ (AWS reference stack)
docs/ deployment.md runbook.md change-control.md user-guide.md traceability.md
retrieval-evaluation-protocol.md upstream-requirements-package.md acceptance-report-template.md
eval/ ncit-retrieval-eval-v1.jsonl (SOW-D5 evaluation set, pending SME validation)
spec/ interface-baseline/v1.0/ (SOW-S16 contract: generated schemas + authored transport/security contract)
tests/ unit/ contract/ conformance/ live/ fixtures/evs/
scripts/ record_fixtures.pyservice.py holds transport-independent handlers; the tools/ modules only validate arguments,
wraps each call in an Envelope, and converts domain errors into MCP tool errors whose
message is a JSON error envelope with a closed code set.
Related MCP server: OntoPortal MCP Server
Install and run
Requires Python 3.11+ and uv (pip works too). The repo-root
.mcp.json registers the stdio server for VS Code (Copilot) and Claude Code.
uv venv && source .venv/bin/activate
uv pip install -e '.[dev]'
# stdio, for Claude Desktop / IDE clients
evs-cadsr-mcp serve --transport stdio
# Streamable HTTP inside FastAPI: MCP at http://127.0.0.1:8000/mcp, plus /healthz and /readyz
evs-cadsr-mcp serve --transport http --port 8000
# quick checks
evs-cadsr-mcp tools # tool catalog
evs-cadsr-mcp releases # live NCIt releases and the active oneClaude Desktop entry (claude_desktop_config.json):
{
"mcpServers": {
"evs": { "command": "/path/to/repo/.venv/bin/evs-cadsr-mcp", "args": ["serve", "--transport", "stdio"] }
}
}Configuration is environment-driven with the ECM_ prefix (see .env.example and
core/config.py): ECM_PROFILE, ECM_EVS_BASE_URL, ECM_RELEASE_PIN,
ECM_BUDGET_MAX_REQUESTS, ECM_LICENSE_KEY, ECM_LICENSE_GATED_TERMINOLOGIES, cache TTLs,
timeouts and retry counts.
Checking the server without an agent
scripts/check_server.py runs the simplest use case from the spec (UC-11 term resolution:
"non-small cell lung carcinoma" → C2926, the synonym "NSCLC" → C2926, its paths to root, and a
negative control) through the MCP client, the same way an agent would. scripts/call_tool.py
calls any single tool. Both default to spawning the server over stdio; --mode fixtures runs
offline over the test fakes, --mode live in-process against EVS, --mode http --url ...
against a running server.
python scripts/check_server.py # exit 0 = server works
python scripts/check_server.py --mode fixtures -v # offline, prints each envelope
python scripts/call_tool.py --list
python scripts/call_tool.py evs_lookup_concept identifier=NSCLCIf the check passes and an agent run fails, look at the client side; if it fails, fix the server first.
Tools
For a plain-language guide to every tool, with two simple examples each, see
docs/tools/.
Tool | Purpose |
| discovery; the only tools that run without a release context |
| roles, associations, properties, qualifiers, term types, sources, statuses |
| one concept; many concepts via the batch |
| exact code, preferred name or synonym with |
| upstream full-text with EVS filters, paged by cursor; typeahead |
| parents/children/roots; flat paged descendants; paths to/from root or to an ancestor |
| roles, associations, inverses, disjointness, with |
| value sets and paged members |
| cross-maps with a license gate for key-gated targets (MedDRA by default) |
| history events and replacements for retired codes |
| bounded multi-hop walk over hierarchy, roles and associations with an explicit budget, fair scheduling across kinds, exclusion polarity, and per-hop provenance |
| depth-capped sub-tree with nodes flagged (or pruned) against property / status / semantic-type criteria |
| concept sets by criteria; a planner picks native routes (search, inverse roles/associations, terminology-wide associations, subset members) and reports |
caDSR tools (profiles cadsr-only and unified)
Tool | Purpose |
| a CDE with NCIt concept annotations by role (object class, property, representation term, value meanings); up to 20 CDEs, one upstream call each (no batch endpoint) |
| version lineage |
| derived views from the one cached expanded CDE; PVs paged server-side |
| native NCIt → CDE reverse lookup ( |
| declared fan-out over alternate name, question text, classification, context, with a |
| Form API 2.0; forms-by-CDE via the legacy query DSL (the only route) |
| LOV API (requires |
| CDE Match 2.0 (credentialed), CDE AI Match API (if configured), VM Match; candidates are resolved against NCI API 1.0 before being cited |
| CRDC harmonized CDE list; registry state ( |
Resources: cadsr://data-element/{publicId}, cadsr://data-element/{publicId}/{version},
cadsr://crosswalk/crdc. Prompts: find_cde_for_question, map_columns_to_cdes.
Mapping tools (profile unified)
Tool | Purpose |
| CDE → NCIt at a pinned release: every annotation's name, status (active / retired / not_found), replacement, name agreement |
| NCIt → CDEs grouped by concept, optional bounded descendant expansion |
| PV → value meaning → NCIt concept, definition, synonyms, status |
| value-by-value alignment (exact / synonym / retired / unmapped / ambiguous) between CDE PVs, plain values, GDC |
| GDC JSON/YAML or MDF YAML fragment → CDE → NCIt → enum/PV alignment (UC-1) |
| candidate CDEs with an evidence chain; caDSR matcher when configured, else term → concepts → annotated CDEs → PV overlap (UC-2) |
| lint: stale/missing/unknown CDEs, invalid or retired NCIt codes at the release, enum/PV mismatches (UC-8) |
| retired / merged / renamed / missing concepts between two live releases and the CDEs they touch (UC-5) |
| same CDE / same concepts / partial / none between two model properties (UC-6) |
| ICD-O-3 code or term → NCIt from EVS's ICD-O-3.1 mapping files (downloaded to a local cache and re-checked daily; |
| the GDC stored string for a concept via |
Prompts: ground_gdc_property, align_enum_to_cde, harmonize_data_dictionary,
release_impact_review. Model fragments are client-supplied (parsed, never fetched or
stored); the mapping module talks to the EVS and caDSR modules only through the capability
interfaces in map/capability.py, so a split deployment can swap in a remote EVS adapter.
Capabilities caDSR lacks (alignment verdicts, lint findings, suggestion ranking) are declared
exceptions and are labelled in meta.exception.
Tool names use underscores because several clients restrict tool names to
[A-Za-z0-9_-]; the proposal's dotted name is carried in each tool's title.
Every result is {result, provenance[], page?, truncation?, warnings[], meta}. Provenance
carries the pinned NCIt release, the source URI, servedBy (live or cache) and license
status. Errors use the closed set from proposal Section 9 (not_found,
release_not_available, release_mismatch, cursor_expired, bound_exceeded,
license_required, upstream_unavailable, ...).
Resources: evs://terminologies, evs://ncit/releases, evs://ncit/{release}/concept/{code}.
Prompts: resolve_term_with_provenance, walk_to_root, expand_value_set, map_across_terminologies, expand_cohort_terms.
Design points carried from the proposal
Release pinning (6.1). A registry polls
/metadata/terminologies; the active release is the latest live monthly release (orECM_RELEASE_PIN). Every EVS call usesncit_<release>in the path; releases EVS no longer serves fail withrelease_not_available; an upstreamversionthat differs from the pinned release fails withrelease_mismatch; cursors and cache keys embed the release.Bounded and batched (6.2, 6.4). Per-invocation outbound budget that counts retries; batch retrieval chunked under the URL limit; all list results paged. The traversal engine expands each depth level in batches of 50 codes (10 when inverse relations are requested), admits edges round-robin across relationship kinds, keeps
Disease_Excludes_*roles aspolarity: negativeedges without expanding them, and reports the first bound hit intruncation(withperKindreached/omitted counts andexact: falsefor lower bounds).Concept sets without SPARQL (6.5).
evs_find_conceptscombines native routes: EVS search for property values, text and subsets (one of each per query), inverse lookups for role/association targets, the terminology-wide associations endpoint for an association type. OR unions enumerated sets; AND intersects them. Combinations only SPARQL can answer returncapability_unavailablewithplan.path = sparql_required— SPARQL is an NCI-approved fallback not enabled here.Good citizen (10.3). Bounded concurrency, retries with backoff and jitter on 429/5xx and connection errors only,
Retry-Afterhonoured, 10 MiB response guard, in-process TTL cache per content class with negative caching.License gate (6.6). Key-gated map targets are withheld (or count-only for mapsets), including maps returned through
include=mapson any concept tool, unlessECM_LICENSE_KEYis set; the key is sent only to gated requests and never appears in logs or provenance URIs.caDSR realities (7.1). Errors arrive as HTTP 200 with
apiResponse.type = "E"and are mapped toinvalid_request/not_found; field-name drift (publicID,latesetVersionIndicator, "Superceded") is normalised in one place; a 45 s deadline with retries on connection errors and 5xx only; one 6–10 s CDE fetch is cached bypublicId + versionand serves every derived view; there is no keyword search, socadsr_find_data_elementsis a declared fan-out that reports what ran; credentialed services returncapability_unavailablewith the reason when no credential is configured, and credentialed results are never cached. Provenance pins caDSR items withregistry {publicId, version, retrievedAt}because caDSR publishes no release identity.Platform chain (10.1, 10.4, 10.6). Every tool call passes through one middleware: correlation id (minted or taken from
_meta, propagated upstream asX-Correlation-ID), authentication binding (OAuth 2.1 resource-server mode viaECM_AUTH_MODE=jwt, with issuer and audience validation), per-namespace scope check (evs:read,cadsr:read,cadsr:match,map:read, intersected with the profile), per-client token-bucket rate limit, then an append-only audit record (free-text parameters hashed) and Prometheus metrics at/metrics. The FastAPI host enforces Host and Origin allow-lists (421) and a 4 MiB body cap (counted as the body streams in). It refuses to serve HTTP on a non-loopback address without JWT auth unlessECM_ALLOW_UNAUTHENTICATED=true, orECM_AUTH_MODE=databricksinside a Databricks App (app.yaml, whose proxy authenticates callers);/metricsand detailed/readyzneedECM_ADMIN_TOKENoff loopback. See SECURITY.md. A Redis-compatible shared cache tier (ECM_CACHE_URL) sits behind the in-process tier; credentialed and negative results never reach it. Seedocs/deployment.mdanddocs/runbook.md.Interface baseline (13, SOW-S16).
evs-cadsr-mcp baseline exportfreezes every tool's input/output schema, resources, prompts, envelope and error schemas and a fixture manifest underspec/interface-baseline/v<INTERFACE_VERSION>/;baseline checkand the T-IFACE test classify drift as non-breaking (additions, text) or breaking (removals, re-typed or new required fields, annotation changes) and fail CI on the latter. Procedure:docs/change-control.md.Acceptance package (14, D4–D9).
tests/acceptance/runs the same SOW-T1..T8 / UC scenarios over the MCP client in fixture and live modes;scripts/run_acceptance.pywrites the results package;docs/traceability.mdmaps every SOW item to tools and tests;docs/upstream-requirements-package.mdis the D7 package;docs/user-guide.mdthe D9 guide.No synthesis. Absent fields stay absent; upstream error text is never echoed.
Keeping secrets out of git
Real credentials go in .env (git-ignored; copy .env.example) or the secrets manager, never
in tracked files. .gitignore also ignores .env.*, key and certificate files and
*credentials*.json. Three checks use the rules in .gitleaks.toml (gitleaks defaults plus
this server's ECM_CADSR_PASSWORD / ECM_CADSR_CREDENTIAL / ECM_LICENSE_KEY settings):
pre-commit install # once per clone: scans staged changes before every commit
gitleaks dir . --redact # on demand: working tree, including untracked files
gitleaks git . --redact # on demand: full historyCI (.github/workflows/secret-scan.yml) scans the full history on every push and pull
request, so git commit --no-verify cannot bypass it. A deliberate dummy test value can be
marked with a trailing # gitleaks:allow comment; a real secret that was committed must be
rotated, not just deleted.
Tests
pytest # unit + contract + conformance + acceptance (fixture mode), offline
ECM_LIVE=1 pytest -m live # live smoke + acceptance scenarios against the live upstreams
python scripts/run_acceptance.py [--live] # all tiers -> reports/<stamp>/{summary.md,junit-*.xml,benchmark.md}
python scripts/evaluate_retrieval.py --retriever upstream_contains --mode live # SOW-D5 scorer (pre-index baseline)
python scripts/generate_tool_reference.py # docs/tool-reference.md from the registered tools
python scripts/record_fixtures.py # refresh tests/fixtures/evs from the live API
python scripts/record_fixtures.py --cadsr # refresh tests/fixtures/cadsr (slow; no credentials needed)
ruff check . # lint (long lines are not enforced yet; see pyproject.toml)CI (.github/workflows/ci.yml) runs ruff check and the offline tests on Python 3.11 and
3.12 on every push and pull request, and checks that uv.lock and deploy/requirements.lock
match pyproject.toml. One contract test is marked xfail(strict=True) for a known open
issue (what to return for an absent code with replacement history); CI fails when it starts
passing, so the marker gets removed.
The fixtures currently in tests/fixtures/evs and tests/fixtures/cadsr are hand-authored from the documented
EVS payload shapes (graph_small.json is a synthetic graph used by the traversal and
planner tests and is meant to stay synthetic) (each file says so in _note), because the environment used to write
this pass had no network egress. Run scripts/record_fixtures.py (and --cadsr) once to replace them
with live recordings. caDSR query-parameter names marked [verify] in cadsr/client.py
(alternate-name, reference-document, context and classification lookups; the LOV path) were
taken from the API summaries, not a live call, and should be checked against the recording; the fake transport in tests/conftest.py derives the release from the
recorded terminologies fixture so the suite keeps working.
License
Not in this pass (next increments)
evs_semantic_search and the NCIt index (Phase 3); the SPARQL fallback for
evs_find_concepts; the remote EVS adapter that would enable map_* in the cadsr-only
profile; server-side GDC dictionary fetch (map://models/gdc/..., needs egress approval);
the ICD-O diagnosis-group table; Form API Form/query; OpenTelemetry spans (metrics and
structured logs are in place); a per-upstream circuit breaker (retries, budgets and
concurrency limits are in place); the SOW acceptance package (Phase 7).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
NCI Thesaurus concepts and the other cancer-research vocabularies served by NCI Enterprise…
Connect AI clients to biomedical data and tools.
Unofficial UMLS MCP — wraps the NLM UMLS Terminology Services REST API (uts-ws.nlm.nih.gov/rest)
Knowledge graph ingestion, entity search, ontology analysis, and CoSync scoring.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables querying and browsing SNOMED CT medical terminology concepts, including search, details, and hierarchy navigation via MCP tools.3MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to search, explore, and interact with ontologies and semantic resources on AgroPortal via the OntoPortal ecosystem.-
- FlicenseNot gradedqualityCmaintenanceEnables LLMs and AI agents to search a biomedical knowledge graph for concepts and study variables, traverse semantic relationships, and look up BioData Catalyst PIC-SURE paths for cohort building.-
- AlicenseNot gradedqualityCmaintenanceEnables searching clinical terms and codes across UMLS vocabularies, retrieving concept details, listing source-asserted atoms, and crosswalking codes between vocabularies via the NLM UMLS Terminology Services REST API.311 npmMIT