Part of ToxMCP Suite → https://github.com/ToxMCP/toxmcp
Public MCP endpoint for Adverse Outcome Pathway (AOP) discovery, scientific review, and draft-to-publication workflows.
Expose AOP-Wiki, AOP-DB, CompTox, semantic tooling, quantitative review helpers, and draft review/export flows to any MCP-aware agent (Codex CLI, Gemini CLI, Claude Code, etc.).
flowchart LR
subgraph Clients["Clients and Agents"]
Codex["Codex CLI / Desktop"]
Gemini["Gemini CLI"]
Claude["Claude Code"]
Scripts["Scripts / notebooks"]
end
subgraph API["FastAPI MCP Service"]
Router["HTTP entrypoints\n/health and /mcp"]
Registry["Tool registry\ninputSchema + outputSchema"]
Tools["Tool handlers\nread, review, assay, draft"]
end
subgraph Semantics["Semantic and Contract Layer"]
Normalizers["OECD-aligned normalizers\nontology terms, applicability,\nevidence blocks, provenance"]
Contracts["JSON Schemas\n/docs/contracts/schemas"]
end
subgraph Adapters["External Adapters"]
AOPWiki["AOP-Wiki RDF / SPARQL"]
AOPDB["AOP-DB SPARQL"]
CompTox["EPA CompTox\nDashboard + CTX APIs"]
end
subgraph Authoring["Draft and Authoring Path"]
Drafts["Draft graph store\nKE / KER / stressor edits"]
Validation["OECD draft validation\ncompleteness checks"]
end
subgraph Offline["Offline and QA Paths"]
Fixtures["Fixture fallback\nAOP_MCP_ENABLE_FIXTURE_FALLBACK=1"]
Tests["Pytest + MCP smoke\nschema regression checks"]
end
Clients --> Router
Router --> Registry
Registry --> Tools
Tools --> Normalizers
Normalizers --> Contracts
Tools --> AOPWiki
Tools --> AOPDB
Tools --> CompTox
Tools --> Drafts
Drafts --> Validation
Tools -. fixture mode .-> Fixtures
Contracts --> Tests
Fixtures --> Tests
The current implementation follows a layered model:
FastAPI + JSON-RPCexpose/mcpand/health, and keep transport concerns separate from domain logic.Tool handlersare the agent-facing API. They validate inputs, call adapters, and emit structured responses with JSON Schemas.Semantic normalizersreshape upstream RDF/API payloads into OECD-aligned objects such asevent_components,applicability,evidence_blocks, andprovenance.Adaptersisolate AOP-Wiki, AOP-DB, and CompTox specifics so upstream changes do not leak into MCP contracts.Draft toolingremains separate from the read/review path, which keeps pathway evidence, assay discovery, and authoring concerns from collapsing into one surface.Fixture fallback + smoke testslet the server degrade cleanly in offline development and keep the public MCP contract regression-tested.
See docs/architecture.md for the fuller narrative and docs/contracts/oecd-aligned-schema.md for the OECD read-contract targets that now shape get_aop, get_key_event, get_ker, and assess_aop_confidence.
For task-oriented walkthroughs, see docs/quickstarts/README.md, especially docs/quickstarts/oecd-draft-authoring.md for the governed draft essentiality flow.
- Hardened SPARQL query construction (AOP-01) — replaced unsafe
template.format(**params)interpolation withTemplateCatalog.render_safe(), which escapes string literals, validates URI schemes, and separates trusted structural fragments from user-facing parameters. Fixed a CAS-URI injection path inmap_chemical_to_aops. - Added circuit-breaker resilience (AOP-02) — per-endpoint circuit breaker with CLOSED/OPEN/HALF_OPEN states, exponential backoff + jitter between retries, and immediate surfacing of non-retryable 4xx errors.
- Strengthened draft audit chain (AOP-03 / AOP-04) —
VersionMetadatanow enforceschecksumandprevious_checksum, recordschecksum_algorithm(defaultsha256-v1), and supportsElectronicSignaturerecords withauthored/reviewed/approved/rejectedsemantics.verify_audit_chain()rejects unsupported algorithms, empty checksums, and broken chains. - Ontology drift protection scaffold (AOP-05) — replaced hardcoded
_iri_to_curie()logic with configurableCurieResolver, and added anOntologyMigratorframework with BFS pathfinding and term-mapping support.
- Expanded the scientific review surface beyond the original read path with specificity-aware assay ranking, HGNC-backed KE assay search, KER citation concordance, conservative taxonomic LCA inference, draft topology validation, directional concordance checks, and supplemental assay-cutoff ordering review.
- Added a coherent draft review workflow:
review_draft_bundle,review_draft_evidence_gaps,export_draft_review_artifact,save_draft_review_artifact,list_saved_draft_review_artifacts, andplan_linear_draft_review_document. - Added mechanistic discovery tooling for orphan stressor discovery across one AOP, multiple AOPs, and phenotype or mechanism queries, plus chemical trace overlays on draft graphs.
- Hardened live operations with a refreshed MCP smoke script, stronger CompTox caching and bounded concurrency, and real-server validation for KE assay search, orphan discovery, confidence review, and draft review/export flows.
- Added release-facing documentation for validated scientific examples in docs/quickstarts/live-scientific-examples.md.
v0.8.0 focused on draft-store hardening, broader schema/runtime contract coverage, improved assay-tool steering and diagnostics, and expanded regression coverage across the assay and draft integrity surfaces.
AOP research depends on stitching together heterogeneous sources (AOP-Wiki, AOP-DB, CompTox, AOPOntology, MediaWiki drafts) while enforcing ontology, provenance, and publication rules. Traditional pipelines are bespoke notebooks or scripts that agents cannot safely reuse.
The AOP MCP server wraps those workflows in a secure, programmable interface:
- Unified MCP surface – discovery, semantics, scientific review, draft authoring, and handoff utilities share a single tool catalog exposed over JSON-RPC.
- Semantic guardrails – applicability/evidence helpers normalize identifiers and validate responses against JSON Schema.
- Draft-to-publish path – create drafts, edit key events and KERs, run topology/evidence review, export publication-style artifacts, and feed publish planners without leaving MCP.
Already using the O-QT MCP server? This project mirrors that experience with domain adapters tuned for AOP evidence and authoring.
| Capability | Description |
|---|---|
| 🧬 AOP discovery adapters | Schema-validated tooling for AOP-Wiki, AOP-DB, and CompTox federation with improved phenotype search ranking, synonym expansion, and curated AOP retrieval. |
| 🧪 Assay and chemical discovery | Reverse AOP-to-assay lookup, KE-centered CompTox assay search with HGNC-backed gene resolution, phrase-only assay fallback, specificity-aware ranking, multi-AOP aggregation, orphan stressor discovery, and query-driven assay or chemical triage. |
| 🧭 Semantic services | CURIE normalization, applicability helper, and evidence matrix builder; enforced via JSON Schema responses. |
| 🔬 Scientific review | OECD-oriented KE/KER review helpers, citation concordance, conservative taxonomic LCA inference, supplemental assay-cutoff ordering checks, and confidence review surfaces that combine narrative and assay-derived signals. |
| ✍️ Draft review and authoring | Create/update drafts, key events, relationships, and stressor links with provenance and diff support, plus topology validation, directional concordance review, evidence-gap analysis, quantitative KER review, and chemical trace overlays. |
| 📦 Artifacts and handoff | Export review bundles as JSON or Markdown, save indexed local review artifacts, build publication-style reports, produce Linear-ready document payloads, and export assay tables in csv/tsv. |
| ⚙️ Configurable transports | FastAPI JSON-RPC service with configurable endpoints, retries, and observability hooks. |
| 🤖 Agent friendly | Verified with Codex CLI, Gemini CLI, and Claude Code; includes quick-start snippets, live scientific examples, and an end-to-end MCP smoke script. |
- Architecture
- Quick start
- Configuration
- Tool catalog
- Running the server
- Integrating with coding agents
- Output artifacts
- Security checklist
- Current limitations
- Development notes
- Contributing
- Security policy
- Code of conduct
- Citation
- Roadmap
- License
# 1) install
python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
# 2) configure
cp .env.example .env
# 3) run
uvicorn src.server.api.server:app --reload --host 0.0.0.0 --port 8003
# 4) verify
curl -s http://localhost:8003/health | jq .
BASE_URL=http://localhost:8003 ./scripts/test_mcp_endpoints.shgit clone https://github.com/ToxMCP/aop-mcp.git
cd aop-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
cp .env.example .env
uvicorn src.server.api.server:app --reload --host 0.0.0.0 --port 8003Heads-up: Federated SPARQL queries benefit from internet access. When offline, enable fixture fallbacks in
.env(see Configuration).
Once the server is running:
- HTTP MCP endpoint:
http://localhost:8003/mcp - Health check:
http://localhost:8003/health - Task walkthroughs:
docs/quickstarts/find-aop.md,docs/quickstarts/live-scientific-examples.md,docs/quickstarts/oecd-draft-authoring.md, anddocs/quickstarts/publish.md
Once the server is running, use the scripted smoke run first:
BASE_URL=http://localhost:8003 ./scripts/test_mcp_endpoints.shThat smoke script validates the modern draft-review workflow end to end, including:
tools/list- draft creation and editing
review_draft_bundleexport_draft_review_artifactsave_draft_review_artifactlist_saved_draft_review_artifactsplan_linear_draft_review_document
If you only want a lightweight manual probe, the basic health and tool-list checks still work:
curl -s http://localhost:8003/health | jq .
curl -s http://localhost:8003/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | jq .Settings are loaded through pydantic-settings with .env/.env.local support. Start from .env.example and keep .env untracked. Key environment variables:
| Variable | Required | Default | Description |
|---|---|---|---|
AOP_MCP_ENVIRONMENT |
Optional | development |
Controls defaults like permissive CORS and logging detail. |
AOP_MCP_LOG_LEVEL |
Optional | INFO |
Application log level. |
AOP_MCP_AOP_WIKI_SPARQL_ENDPOINTS |
Optional | https://aopwiki.rdf.bigcat-bioinformatics.org/sparql |
Comma-separated list of AOP-Wiki SPARQL endpoints. |
AOP_MCP_AOP_DB_SPARQL_ENDPOINTS |
Optional | https://aopwiki.rdf.bigcat-bioinformatics.org/sparql |
Comma-separated list of AOP-DB SPARQL endpoints (defaults to AOP-Wiki for fallback). |
AOP_MCP_COMPTOX_BASE_URL |
Optional | https://comptox.epa.gov/dashboard/api/ |
Base URL for CompTox enrichment calls. |
AOP_MCP_COMPTOX_BIOACTIVITY_URL |
Optional | https://comptox.epa.gov/ctx-api/ |
Base URL for CompTox Bioactivity API (required for assay mapping). |
AOP_MCP_COMPTOX_API_KEY |
Optional | – | API key for CompTox (required for assay mapping and higher quota). |
AOP_MCP_ENABLE_FIXTURE_FALLBACK |
Optional | 0 |
Set to 1 to serve fixture data when remote SPARQL endpoints are unavailable. |
See docs/contracts/endpoint-matrix.md and src/server/config/settings.py for the extended configuration surface (auth, retries, cache sizing, job service knobs).
| Category | Highlight tools | Notes |
|---|---|---|
| AOP discovery | search_aops, get_aop, list_key_events, list_kers |
Federated AOP-Wiki queries with pagination, schema validation, and improved ranking for phenotype searches. |
| OECD review helpers | get_key_event, get_ker, get_related_aops, assess_aop_confidence, find_paths_between_events |
Exposes richer KE/KER metadata, shared-AOP discovery, partial OECD-aligned heuristic confidence summaries, supplemental KER citation-concordance signals, supplemental KER assay-cutoff ordering signals derived from linked stressors plus KE assay candidates, conservative taxonomic LCA inference for KER applicability, and directed path traversal for review and network analysis workflows. |
| Cross-mapping | map_chemical_to_aops, map_assay_to_aops, list_assays_for_aop, get_assays_for_aop, search_assays_for_key_event |
Links AOP-Wiki and AOP-DB stressor data to CompTox identifiers and bioactivity assays. search_assays_for_key_event now merges structured HGNC-backed gene resolution with existing KE text heuristics when possible. map_assay_to_aops is assay -> AOP only; use the AOP-to-assay tools when you already have AOP IDs. |
| Assay aggregation | list_assays_for_aops, get_assays_for_aops, list_assays_for_query, export_assays_table, discover_orphan_stressors_for_aop, discover_orphan_stressors_for_aops, discover_orphan_stressors_for_query |
Deduplicates assay evidence across multiple AOPs, surfaces diagnostics for empty assay lookups, exports the ranked assay table as csv or tsv, and can now surface orphan chemical candidates that are active in an AOP's strongest assays but are not already curated as linked stressors, for one pathway, across several pathways, or from a phenotype/mechanism query. Ranked assay outputs are discovery-oriented and specificity-aware, not curated ontology truth. |
| Semantic helpers | get_applicability, get_evidence_matrix |
CURIE normalization plus evidence matrix builder for review packages. |
| Draft authoring | create_draft_aop, add_or_update_ke, add_or_update_ker, link_stressor, validate_draft_oecd, review_draft_assay_cutoff_ordering, review_draft_bundle, review_draft_evidence_gaps, export_draft_review_artifact, save_draft_review_artifact, list_saved_draft_review_artifacts, plan_linear_draft_review_document, trace_chemical_on_draft |
In-memory draft graph edits with provenance plus OECD-style completeness checks, draft-graph topology checks, a unified draft review bundle that now carries structured evidence-gap findings, an action-oriented evidence-gap review surface, exportable review artifacts with both review and publication-style markdown profiles, a persistent local artifact-save path plus on-disk indexing for handoff files, a connector-ready Linear document handoff planner, a detailed draft KER assay-cutoff ordering review surface, and a chemical-trace overlay that projects one chemical's CompTox activity onto draft key events. |
Every response is validated against JSON Schemas in docs/contracts/schemas/. Refer to docs/contracts/tool-catalog.md for full definitions and examples.
The release now includes a concrete live-example guide at docs/quickstarts/live-scientific-examples.md.
The examples in that guide were validated against a running server on 2026-04-12 and cover:
- phenotype search around
liver steatosis - HGNC-backed KE assay search for
KE:239 - orphan stressor discovery for
AOP:529 - confidence review interpretation for
AOP:529
| Goal | Tool | Input you should pass |
|---|---|---|
| Start from an assay and find linked pathways | map_assay_to_aops |
An assay identifier such as an AEID or assay name, not an AOP ID |
| Start from one or more AOPs and retrieve assay candidates | get_assays_for_aop, get_assays_for_aops |
One AOP ID or a list of AOP IDs |
| Start from one AOP and look for uncurated mechanistic chemical candidates | discover_orphan_stressors_for_aop |
One AOP ID plus optional assay and chemical scan limits |
| Start from several AOPs and look for recurring uncurated mechanistic chemical candidates | discover_orphan_stressors_for_aops |
A list of AOP IDs plus optional per-AOP assay and chemical scan limits |
| Start from a phenotype or mechanism query | list_assays_for_query |
A text query such as liver steatosis |
| Start from a phenotype or mechanism query and look for orphan chemicals | discover_orphan_stressors_for_query |
A text query plus optional AOP selection and assay/chemical scan limits |
| Start from a key event or MIE | search_assays_for_key_event |
A key_event_id such as KE:239 |
For a phenotype-driven workflow such as steatosis assay curation:
- Call
search_aopswith a phenotype query such asliver steatosis. - Inspect the returned AOP set or pass the same query to
list_assays_for_query. - Export the aggregated assay candidates with
export_assays_tablewhen you need a table for downstream review.
For an explicit AOP-ID workflow such as “retrieve assay candidates for AOP:34 and AOP:232”:
- Call
get_assays_for_aopswith the AOP ID list. - Inspect the top-level
diagnosticsobject to see how many AOPs were processed and whether any returned no assays. - Inspect
diagnostics.per_aopwhenresultsis empty or thinner than expected to distinguish missing CompTox access, no linked stressors, no CompTox chemical matches, and no bioactivity hits after filtering.
For an orphan-stressor discovery workflow such as “show me uncurated chemicals that light up the strongest assays behind AOP:529”:
- Call
discover_orphan_stressors_for_aopwith the AOP ID and tuneassay_limitorper_assay_chemical_limitif you want broader discovery. - Review
results[*].supporting_assaysto see which specificity-ranked AOP assays support each candidate chemical. - Treat the returned chemicals as mechanistic discovery leads. The tool excludes already curated AOP stressors conservatively by DTXSID, CAS RN, and normalized name when possible, but it does not establish causality or regulatory confidence on its own.
For a cross-pathway orphan-stressor workflow such as “show me uncurated chemicals that recur across the strongest assays behind AOP:529 and AOP:517”:
- Call
discover_orphan_stressors_for_aopswith the AOP ID list. - Prioritize candidates with high
aop_support_countandsupporting_assay_count, because they recur across multiple pathway-specific assay sets rather than only one pathway. - Inspect
diagnostics.per_aopwhen a pathway contributes no orphan candidates so you can distinguish missing CompTox access, empty assay layers, and complete exclusion by curated stressor matching.
For a query-driven orphan workflow such as “show me orphan candidates for liver steatosis”:
- Call
discover_orphan_stressors_for_querywith the phenotype or mechanism query. - Inspect
selected_aopsto see which AOPs were chosen from the broader search result set before aggregation. - Use
diagnostics.warningsanddiagnostics.per_aopto see whether the result is thin because the query matched few useful AOPs, because some AOP hits lacked identifiers, or because the selected pathways had no surviving orphan candidates after curated-stressor exclusion.
For a curated KE or MIE workflow:
- Call
get_key_eventto inspect the event metadata and confirm the mechanistic scope. - Call
search_assays_for_key_eventto rank CompTox assays using KE-derived gene symbols, mechanism phrases, and KE taxonomic applicability when available. Structuredgene_identifiersare resolved through HGNC when possible, then merged with heuristic title and description parsing before CTX lookup. Phrase-only events search the full CTX assay metadata set with a narrow phenotype synonym layer before AOP-Wiki measurement methods. Usekey_event_idin the MCP payload; legacyke_idremains accepted for compatibility. - Review
derived_search_terms,matched_terms, andapplicability_matchin the result to understand why an assay was surfaced. - Treat the result as a first-pass assay candidate list. Ranking is specificity-aware, but it is still a discovery aid rather than a curated KE-to-assay ontology mapping.
For an OECD-style read/review workflow:
- Call
get_aoporsearch_aopsto select the pathway. - Use
get_key_eventandget_kerfor detailed KE/KER inspection. - Use
assess_aop_confidenceto assemble a heuristic confidence summary from the available KE and KER evidence text. - Read
confidence_dimensionsas the OECD core dimensions,supplemental_signalsas non-core context, andoecd_alignmentfor the current completeness status.supplemental_signals.citation_concordance_signalis a reference-overlap heuristic across linked KEs, not direct proof of empirical concordance.supplemental_signals.assay_cutoff_ordering_signalis a supplemental quantitative-ordering heuristic derived from linked stressor chemicals, KE assay candidates, and best observed CompTox activity cutoffs; it is not a curated qAOP model.get_ker.citation_concordanceandget_ker.assay_cutoff_orderingexpose the same style of local KER review context for one relationship at a time.get_ker.applicability.taxamay also use a lowest-common-ancestor taxon when upstream and downstream KE species differ but still share a conservative clade such asMammalia.
For an OECD-style draft workflow with explicit KE essentiality capture:
- Call
create_draft_aopto create the draft root. - Call
add_or_update_kefor each KE and setevent_roleexplicitly when you know whether the KE is the MIE, an intermediate event, or the AO. When you have an explicit essentiality judgment for a KE, store it underattributes.essentiality. - Call
add_or_update_kerandlink_stressoras the draft graph matures. - Call
review_draft_bundlewhen you want the most complete draft review package in one response. It combinesvalidate_draft_oecd, detailed draft assay-cutoff ordering review, structured evidence-gap findings, and optional chemical projection when you supply a chemical identifier. - Call
review_draft_evidence_gapswhen you want the same draft review signals reorganized into concrete missing-data items by root metadata, key event, relationship, and linked stressor. - Call
validate_draft_oecddirectly when you only need the compact readiness/result list. Explicitessentiality.evidence_callvalues ofnot_assessedornot_reportedstill count as coverage, as long as a rationale is present. The validator now also checks for draft-graph cycles, identifiable MIE and AO anchors, at least one directed MIE -> AO path, conservative directional concordance when the draft exposes enough polarity metadata, and supplemental KER assay-cutoff ordering when draft stressor links plus KE assay candidates expose enough CompTox evidence to compare upstream and downstream cutoffs. - Call
review_draft_assay_cutoff_orderingwhen you only want the per-KER quantitative-ordering details behind the validator warnings. It surfaces derived draft stressors, per-KER assay-cutoff ordering calls, and supporting shared-chemical cutoff comparisons. - Call
trace_chemical_on_draftwhen you want to see whether one chemical has CompTox assay activity that maps onto the drafted KE graph. Treat the result as a KE assay-overlay aid, not a causal proof engine. - Call
export_draft_review_artifactwhen you want a scientist-facing Markdown artifact or a JSON export built from the unified draft review bundle for downstream review workflows. The Markdown profiles now also include evidence-gap sections and next actions derived fromreview_draft_evidence_gaps, and the JSON export now includes a structuredevidence_gapsblock alongside the bundle. Useartifact_profile: "publication"when you want a more structured report with explicit findings, evidence tables, and next actions. - Call
save_draft_review_artifactwhen you want that exported artifact written to the local filesystem underAOP_MCP_ARTIFACT_OUTPUT_DIR(defaultoutput/draft_reviews/), with optional subdirectory and filename override support. The metadata sidecar now preserves both the bundle summary and the evidence-gap summary. - Call
list_saved_draft_review_artifactswhen you want to discover previously saved draft review files by draft ID, format, profile, or subdirectory without scanning the filesystem manually. - Call
plan_linear_draft_review_documentwhen you want a connector-ready Linear document payload built from either a live publication-profile export or one of the saved artifact files. Its response now preserves both the exported bundle summary and the evidence-gap summary.
To make directional concordance assessable, store KE polarity under fields such as attributes.direction_of_change when the title is not explicit enough, and store KER polarity under fields such as attributes.relationship_effect when the relationship is clearly activating versus inhibiting. To make draft assay-cutoff ordering assessable, link stressors with resolvable chemical metadata such as a recognizable label, CAS-like source value, or DTXSID-like source value.
Example tools/call payloads:
{
"name": "get_assays_for_aops",
"arguments": {
"aop_ids": ["AOP:34", "AOP:232", "AOP:591"],
"limit": 25,
"per_aop_limit": 15,
"min_hitcall": 0.95
}
}{
"name": "list_assays_for_query",
"arguments": {
"query": "liver steatosis",
"search_limit": 12,
"aop_limit": 5,
"limit": 25,
"per_aop_limit": 15,
"min_hitcall": 0.95
}
}{
"name": "export_assays_table",
"arguments": {
"query": "liver steatosis",
"format": "csv",
"search_limit": 12,
"aop_limit": 5,
"limit": 25,
"per_aop_limit": 15,
"min_hitcall": 0.95
}
}{
"name": "search_assays_for_key_event",
"arguments": {
"key_event_id": "KE:239",
"limit": 10
}
}{
"name": "assess_aop_confidence",
"arguments": {
"aop_id": "AOP:232"
}
}{
"name": "create_draft_aop",
"arguments": {
"draft_id": "draft-steatosis-1",
"title": "PXR activation leading to liver steatosis",
"description": "Draft AOP assembled for OECD-style review.",
"adverse_outcome": "Liver steatosis",
"applicability": {
"species": "human",
"life_stage": "adult",
"sex": "female"
},
"references": [
{
"title": "Example review reference"
}
],
"author": "researcher",
"summary": "Create draft root"
}
}{
"name": "add_or_update_ke",
"arguments": {
"draft_id": "draft-steatosis-1",
"version_id": "v2",
"author": "researcher",
"summary": "Add KE with governed essentiality",
"identifier": "KE:239",
"title": "Activation, Pregnane-X receptor, NR1I2",
"attributes": {
"measurement_methods": [
"Reporter assay"
],
"taxonomic_applicability": [
"NCBITaxon:9606"
],
"essentiality": {
"evidence_call": "moderate",
"rationale": "Blocking or attenuating this event reduced the downstream steatosis signal in the supporting studies curated for the draft.",
"references": [
{
"identifier": "PMID:123456",
"source": "pmid",
"label": "Example essentiality reference"
}
]
}
}
}
}{
"name": "add_or_update_ke",
"arguments": {
"draft_id": "draft-steatosis-1",
"version_id": "v3",
"author": "researcher",
"summary": "Add KE with explicit no-data essentiality status",
"identifier": "KE:459",
"title": "Liver steatosis",
"attributes": {
"measurement": "Histopathology",
"essentiality": {
"evidence_call": "not_assessed",
"rationale": "Direct perturbation evidence has not yet been curated for this KE in the current draft.",
"references": []
}
}
}
}{
"name": "validate_draft_oecd",
"arguments": {
"draft_id": "draft-steatosis-1"
}
}assess_aop_confidenceis OECD-aligned, not OECD-complete. Key-event essentiality is only inferred when bounded text evidence and supporting path structure both exist; path structure alone is retained as context but does not produce an essentiality score. The current RDF export still does not expose a dedicated structured essentiality field. Draft authoring now supports an explicit governed KE-levelessentialityobject, andvalidate_draft_oecdchecks its coverage and shape.- The governed draft
essentialityobject currently improves authoring andvalidate_draft_oecd, but it is not yet fed back into the live read-sideassess_aop_confidenceoutput or a downstream publish/export path. - Quantitative understanding is sparse in many live AOP-Wiki records, so confidence outputs often remain partial even when the tool is behaving correctly.
- Applicability evidence calls are now structured on the read path, but they are still heuristic. They reflect source presence, cross-KE consistency, and supporting references rather than an explicit OECD applicability-strength field from upstream RDF.
search_assays_for_key_eventis a discovery helper, not a curated KE-to-assay ontology mapping or a full assay fit-for-purpose evaluator.- Query-driven assay workflows depend on upstream AOP-DB stressor links and CompTox coverage. Relevant AOPs without mapped stressors or bioactivity data can legitimately return no assay candidates.
- Phrase-only KE assay search now includes a small curated phenotype synonym layer, but that vocabulary is intentionally narrow. When the phenotype or endpoint wording is not present upstream and not covered by the curated expansions, the tool can still return no hits even though the full CTX dataset was searched.
- Phenotype boundaries such as steatosis vs steatohepatitis / MASH still require manual scientific curation; the MCP should be used as a baseline discovery and prioritization layer rather than a final arbiter.
- Federated SPARQL and assay aggregation calls can be slow on live infrastructure, especially for broad phenotype queries and large AOPs.
The FastAPI app lives at src/server/api/server.py. All transports share the same JSON-RPC handlers defined in src/server/mcp/router.py.
uvicorn src.server.api.server:app --host 0.0.0.0 --port 8003GET /health– environment banner, dependency status.POST /mcp– JSON-RPC 2.0 endpoint exposing the MCP tool catalog.
Use scripts/test_mcp_endpoints.sh for a scripted smoke run against /mcp. It now validates the modern draft-review workflow end to end, including artifact export/save/list and Linear handoff planning.
Add the server to your agent’s MCP configuration. Example Codex CLI entry:
{
"name": "aop-mcp",
"endpoint": "http://localhost:8003/mcp"
}Tested surfaces:
- Codex CLI –
codex mcp connect http://localhost:8003/mcp - Gemini CLI – add the endpoint under
mcp_serversto auto-negotiate the tool catalog. - Claude Code – configure a custom MCP server with the base URL above.
Because the server supports initialize, tools/list, tools/call, and shutdown, agents immediately gain discovery plus structured responses (content + structuredContent).
- Structured MCP payloads – JSON responses aligned with schemas under
docs/contracts/schemas/. - Saved draft review files –
save_draft_review_artifactcan persist review/profile exports underAOP_MCP_ARTIFACT_OUTPUT_DIR(defaultoutput/draft_reviews/) for downstream handoff. - Artifact inventory –
list_saved_draft_review_artifactscan index those saved files, using metadata sidecars when available and filesystem inference for older artifacts. - Connector-ready review handoff –
plan_linear_draft_review_documentcan turn a live or saved review artifact into a Linear document payload for downstream review systems. - Audit + provenance – draft edits capture author, summary, and version metadata for downstream review queues.
- Metrics & logs – in-process metrics recorder (
src/instrumentation/metrics.py) and structured logs (src/instrumentation/logging.py) for SPARQL/cache and job lifecycle events. - Fixture captures – optional local fixtures for offline testing when
AOP_MCP_ENABLE_FIXTURE_FALLBACK=1.
- ✅ Structured logging + audit chain validation (
src/instrumentation/audit.py). - ✅ SPARQL + CompTox clients respect retry/backoff limits; tune via settings.
- ✅ MCP tools enforce JSON Schema validation before returning data to agents.
- 🔲 Optional auth middleware (see
docs/adr/architecture-drivers.md) – integrate with your gateway before production exposure. - 🔲 Review publish planners (MediaWiki / AOPOntology) before enabling automated publish jobs.
pytest– run unit and schema validation tests.scripts/test_mcp_endpoints.sh– exercise the MCP catalog end-to-end.make contract– regenerate/validate JSON Schema docs (if available in your tooling setup).python scripts/benchmarks.py– baseline latency testing (extend with real workloads).docs/opensourcing-checklist.md– final checks before switching repository visibility to public.docs/contracts/oecd-aligned-schema.md– OECD-aligned target payload model and current coverage audit forAOP,KE,KER, and assessment outputs.- Keep docs in sync: update
docs/contracts/endpoint-matrix.md,docs/quickstarts/, and schema files when payloads change.
See CONTRIBUTING.md for local setup, test workflow, and pull request expectations.
See SECURITY.md for reporting guidance and supported versions.
This project follows CODE_OF_CONDUCT.md.
If you use toxMCP / AOP MCP Server in your work, please cite:
- Ivo Djidrovski. BioRxiv preprint (2026). DOI: 10.64898/2026.02.06.703989v1
- Persistent draft store (Redis/Postgres) with multi-user access control.
- Automated benchmark thresholds feeding CI gating.
- Additional MCP resources/prompts for curated applicability templates and evidence summaries.
- Publish workflow hardening (approval queues, RBAC simulation, MediaWiki integration tests).
Apache-2.0. See LICENSE.
ToxMCP was developed in the context of the VHP4Safety project (see: https://github.com/VHP4Safety) and related research/engineering efforts.
Funding: Dutch Research Council (NWO) — NWA.1292.19.272 (NWA programme)
This suite integrates with third-party data sources and services (e.g., EPA CompTox, ADMETlab, AOP resources, OECD QSAR Toolbox, Open Systems Pharmacology). Those upstream resources are owned and governed by their respective providers; users are responsible for meeting any access, API key, rate limit, and license/EULA requirements described in each module.
Djidrovski, I. ToxMCP: Guardrailed, Auditable Agentic Workflows for Computational Toxicology via the Model Context Protocol. bioRxiv (2026). https://doi.org/10.64898/2026.02.06.703989
@article{djidrovski2026toxmcp,
title = {ToxMCP: Guardrailed, Auditable Agentic Workflows for Computational Toxicology via the Model Context Protocol},
author = {Djidrovski, Ivo},
journal = {bioRxiv},
year = {2026},
doi = {10.64898/2026.02.06.703989},
url = {https://doi.org/10.64898/2026.02.06.703989}
}Citation metadata: CITATION.cff