Comptox MCP Server
Click on "Install 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., "@Comptox MCP Serverfind hazard data for bisphenol A"
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.
EPA CompTox MCP Server

Part of ToxMCP Suite -> https://github.com/ToxMCP/toxmcp
Public MCP endpoint for EPA Computational Toxicology (CompTox) evidence federation. Expose chemical identity, hazard, exposure, bioactivity, metadata, screening-prioritization summaries, contract-manifest discovery, and cross-suite handoff builders to any MCP-aware agent (Codex CLI, Gemini CLI, Claude Code, etc.).
Maintainer: Ivo Djidrovski (
@senseibelbi)Contact: Use GitHub Issues for bugs, usage questions, and feature requests; use the in4r.ai contact form for private general inquiries; and report vulnerabilities through GitHub's private security advisory channel.
An EPA CompTox API key is required for live chemical data. Request a key using EPA's official instructions, or email ccte_api@epa.gov for API-key help. After cloning the repository, put the key in .env as CTX_API_KEY; never commit or share it.
Architecture
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 + WebSocket entrypoints\n/healthz, /readyz, /mcp, /mcp/ws"]
Registry["Tool registry\ninputSchema + outputSchema"]
Tools["Tool handlers\nretrieval, validation, handoff"]
end
subgraph Evidence["Tier-0 Evidence and Federation Layer"]
Chemical["Chemical identity"]
Hazard["Hazard datasets"]
Exposure["Exposure + HTTK"]
Bioactivity["Bioactivity + AOP link-outs"]
Metadata["Model cards + applicability"]
Prioritization["Screening prioritization\nAED / exposure signals"]
Manifest["Contract manifest\nresources / tools / schemas"]
Interop["Portable evidence packs\nAOP / PBPK handoff builders"]
end
subgraph Contracts["Contract and Artifact Layer"]
McpSchemas["MCP response schemas\n/docs/contracts/schemas"]
Portable["Portable object schemas\n/schemas"]
Tests["Catalog, schema, and handoff tests"]
end
subgraph Upstream["Upstream Sources"]
CTX["EPA CTX APIs"]
Bundles["Packaged metadata bundles"]
end
Clients --> Router
Router --> Registry
Registry --> Tools
Tools --> Chemical
Tools --> Hazard
Tools --> Exposure
Tools --> Bioactivity
Tools --> Metadata
Tools --> Prioritization
Tools --> Manifest
Tools --> Interop
Chemical --> CTX
Hazard --> CTX
Exposure --> CTX
Bioactivity --> CTX
Metadata --> Bundles
Tools --> McpSchemas
Interop --> Portable
McpSchemas --> Tests
Portable --> TestsThe current implementation follows a layered model:
FastAPI + JSON-RPCexpose/mcpand/mcp/ws, with/healthzand/readyzkept separate from domain logic.Retrieval resourcesown CompTox-native evidence access for chemical, hazard, exposure, bioactivity, cheminformatics, and metadata.Screening prioritizationstays separate from interop builders and emits explicitly caveated AED/exposure prioritization summaries instead of final risk decisions.Contract manifestpublishes the live public catalog plus schema inventory in machine-readable form for downstream MCP consumers.Interop toolspackage portable evidence objects for downstream MCP consumers without cloning AOP OECD semantics or PBPK execution semantics.Contract layersare split intentionally:docs/contracts/schemas/for MCP response wrappers,schemas/for cross-suite portable evidence objects.Regression gateskeep README, live discovery, published schemas, and AOP/PBPK handoff fixtures aligned before release.
Related MCP server: TogoMCP
What's New In v0.2.6
This packaging hotfix makes the release wheel self-contained.
All MCP response schemas now ship with the wheel under the active Python installation's data directory.
Contract loading now checks the installed schema bundle when the server is launched outside a source checkout.
Release verification now includes starting the server and calling MCP discovery from a clean wheel-only environment.
See the full release notes in docs/releases/v0.2.6_release_description.md.
For earlier changes, see the CHANGELOG.md, GitHub releases, or the versioned notes in docs/releases/.
Published Schemas
The portable CompTox handoff objects are now published as machine-readable JSON Schemas under schemas/, with matching examples under schemas/examples/.
Published object family:
schemas/chemicalIdentityRecord.v1.jsonschemas/hazardEvidenceSummary.v1.jsonschemas/exposureEvidenceSummary.v1.jsonschemas/bioactivityEvidenceSummary.v1.jsonschemas/aopLinkageSummary.v1.jsonschemas/pbpkContextBundle.v1.jsonschemas/comptoxEvidencePack.v1.json
Design intent:
keep the stable core fields required and allow additive convenience fields
keep AOP OECD normalization outside CompTox MCP
keep PBPK execution, qualification, and internal exposure objects outside CompTox MCP
make the portable evidence layer consumable by downstream validators and orchestrators without scraping examples out of tests
See schemas/README.md, tests/test_portable_schemas.py, and tests/test_cross_suite_handoffs.py for the maintainer gates that keep published objects aligned with live payload generation.
Why this project exists
Regulatory and research teams rely on the CompTox API for high-quality chemical, exposure, and hazard data. Traditional workflows involve bespoke scripts or manual dashboard exports that are hard to share with AI copilots.
The EPA CompTox MCP server wraps those workflows in a secure, programmable interface:
One MCP surface (
/mcpHTTP +/mcp/wsWebSocket) delivers discovery and execution across chemical, bioactivity, exposure, hazard, metadata, interop, and supporting utility catalogues.Screening prioritization adds a separate, caveated signal-ranking path built from CompTox AED and exposure sources without claiming final NGRA decisions.
Contract manifest discovery exposes the live public resources, tools, and schema inventory so downstream MCPs do not need to scrape docs to integrate safely.
Evidence federation role – CompTox acts as the suite's source-grounded evidence ingress layer for downstream AOP, PBPK, O-QT, and orchestration workflows.
Guardrails + provenance – JSON Schema validation, metadata attachments, transport audit hooks, and signed release attestations improve downstream reproducibility.
Agent friendly – tested with Codex CLI, Gemini CLI, and Claude (see integration guide).
Experimental predictive and orchestrator components still exist in this repository, but they are not part of the default public MCP tool catalog exposed by the server today.
Feature snapshot
Capability | Description |
🌐 Dual MCP Transports | JSON-RPC over HTTP ( |
🧬 CompTox Tooling | Chemical, bioactivity, exposure, hazard, metadata, and supporting utility helpers mapped to structured MCP tools. |
🔗 Evidence Federation | Designed as the suite's Tier-0 evidence ingress layer, packaging source-grounded CompTox outputs for downstream consumers. |
🛡️ Guardrail Enforcement | JSON Schema response validation, metadata attachments, audit hooks, and transport safety controls improve reproducibility. |
⚙️ Configurable by Design | Pydantic settings with |
🤖 Agent Ready | Verified with Codex CLI, Gemini CLI, and Claude Code; includes quick-start config snippets. |
Table of contents
Get an EPA CompTox API key (required)
The server can start without a key, but its live chemical tools cannot retrieve EPA data until one is configured.
Request an API key from EPA. EPA provides individual keys free of charge.
For help with the request, email ccte_api@epa.gov.
After cloning this repository, copy
.env.exampleto.envand replaceyour_ctx_api_key_herewith your key:CTX_API_KEY="your_key_from_epa"
Keep .env private. The readiness check in the quick start confirms that the configured key can authenticate with EPA.
Quick start
# 1) Install
git clone https://github.com/ToxMCP/comptox-mcp.git
cd comptox-mcp
pip install -e .
# 2) Configure the API key requested above
cp .env.example .env
# Open .env and replace your_ctx_api_key_here with your key
# 3) Run
uvicorn epacomp_tox.transport.websocket:app --host 127.0.0.1 --port 8000
# 4) Verify authenticated EPA readiness, then list MCP tools
curl -s http://localhost:8000/readyz | jq .
curl -s http://localhost:8000/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | jq '.result.tools | length'With the server running, MCP clients can connect to http://localhost:8000/mcp (HTTP) or ws://localhost:8000/mcp/ws (WebSocket).
Once the server is running:
HTTP MCP endpoint:
http://localhost:8000/mcpWebSocket MCP endpoint:
ws://localhost:8000/mcp/wsHealth check:
http://localhost:8000/healthzReadiness check:
http://localhost:8000/readyzArchitecture docs:
docs/architecture_overview.mdContract docs:
docs/contracts/README.mdRelease verification guide:
docs/releases/release_artifact_verification.md
Verification (smoke test)
Once the server is running:
# health
curl -s http://localhost:8000/healthz | jq .
# list MCP tools
curl -s http://localhost:8000/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | jq '.result.tools | length'
# live Bisphenol A demo (also validates the configured API key)
curl -s http://localhost:8000/readyz | jq .
curl -s http://localhost:8000/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_chemical","arguments":{"query":"Bisphenol A","search_type":"equals"}}}' \
| jq -r '.result.content[0].text'
curl -s http://localhost:8000/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"resolve_chemical_identifier","arguments":{"identifier":"80-05-7"}}}' \
| jq -r '.result.content[0].text'
# live interop smoke
python scripts/mcp_interop_smoke.py --endpoint http://localhost:8000/mcp --json
# release-oriented smoke
python scripts/release_smoke.py --endpoint http://localhost:8000/mcp --jsonRelease verification
For published GitHub releases, signed provenance/SBOM attestation verification is documented in docs/releases/release_artifact_verification.md.
Configuration
Settings are resolved via pydantic-settings with .env/.env.local support. Key environment variables:
Variable | Required | Default | Description |
| ✅ | – | CompTox API key used for all downstream requests. Fallbacks: |
| Optional |
| Base URL for CompTox API. |
| Optional |
| Set to |
| Optional |
| Number of retry attempts for transient errors. |
| Optional |
| Base sleep (seconds) used in exponential backoff. |
| Optional |
| Controls defaults like permissive CORS. |
| Optional |
| Application log level. |
| Optional |
| Set to |
| Optional | – | Comma-separated origins for HTTP transport. Defaults to |
| Optional |
| Minimum heartbeat timeout negotiated with WebSocket clients. |
| Optional |
| Minimum handshake timeout negotiated with WebSocket clients. |
| Optional |
| Toggle |
See docs/deployment.md for production hardening tips and expanded configuration.
Tool catalog
Category | Highlight tools | Notes |
Chemical discovery |
| Resolve identifiers deterministically, inspect ambiguous matches, and fetch structures/details with CTX retry/backoff baked in. |
Bioactivity & AOP link-outs |
| Surface ToxCast/Tox21 summaries, assay metadata, and AOP crosswalks from CompTox bioactivity APIs. |
Exposure & hazard |
| Batch-normalized access to CTX exposure datasets plus granular hazard endpoints (ToxValDB, ToxRefDB, cancer, genetox, ADME/IVIVE, IRIS, PPRTV, HAWC). |
Screening prioritization |
| Build an explicitly caveated screening-priority summary from AED, SEEM, HTTK, MMDB, and CPDat signals without presenting it as a regulatory risk decision. |
Contract manifest |
| Publish a machine-readable inventory of the live public resources, tools, MCP response schemas, portable schemas, and boundary notes. |
Metadata & governance |
| Fetch model cards, applicability-domain policies, and explicit guardrail metadata describing documented vs locally enforced criteria. |
Interop handoff builders |
| Package portable evidence objects and downstream-ready handoff summaries for AOP and PBPK MCP consumers without duplicating their semantics. |
Utility helpers |
| Provide supporting conversions for downstream automations. |
The default server currently registers ten public resources: chemical, bioactivity, exposure, hazard, chemical list, cheminformatics, metadata, interop, prioritization, and manifest. Full schema definitions (input and output) are returned via the MCP tools/list call. See tests/test_resources.py for examples of exercising each category.
Experimental components
The repository also contains predictive and orchestrator code under src/epacomp_tox/predictive/ and src/epacomp_tox/orchestrator/. Treat those modules as experimental until they are registered in the default server, documented as part of the canonical tool catalog, and backed by stable public response contracts.
Running the server
Local development
# install and start the dual-transport server
pip install -e .
uvicorn epacomp_tox.transport.websocket:app --host 127.0.0.1 --port 8000The FastAPI app exposes both transports:
HTTP JSON-RPC:
http://localhost:8000/mcpWebSocket JSON-RPC:
ws://localhost:8000/mcp/ws
Quick handshake + tool discovery via HTTP:
curl -s http://localhost:8000/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"capabilities":{}}}'
curl -s http://localhost:8000/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | jq '.result.tools | length'Hazard smoke test
Validate the hazard suite once transports are online:
# Bisphenol A toxval summary (expect a 40 mg/kg-day NOEL among the records)
curl -s http://localhost:8000/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"search_hazard","arguments":{"data_type":"toxval","dtxsid":"DTXSID7020182","summary":true}}}' | jq '.result.structuredContent.data[0]'
# Perfluorooctanoic acid cancer classification (expect CalEPA and IARC calls)
curl -s http://localhost:8000/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"search_hazard","arguments":{"data_type":"cancer","dtxsid":"DTXSID8031865","summary":true}}}' | jq '.result.structuredContent.data'Bisphenol A should return HESS and HPVIS toxicity values (including the 40 mg/kg-day NOEL), while Perfluorooctanoic acid surfaces the ATSDR MRL alongside CalEPA and IARC cancer classifications. Errors typically indicate missing API credentials or upstream CompTox outages; inspect the returned metadata for rate-limit status when troubleshooting.
Endpoint smoke check
Before exposing the MCP server, run the endpoint checker to verify the upstream CompTox APIs are reachable:
python scripts/check_endpoints.py
# add --json for machine-readable outputThe script pings each endpoint listed in docs/contracts/endpoint-matrix.md and reports latency plus HTTP status. Provide CTX_API_KEY/EPA_COMPTOX_API_KEY in the environment to avoid 401/403 responses.
Endpoint automation
A scheduled GitHub Action (.github/workflows/endpoint-check.yml) runs python scripts/check_endpoints.py --json every day at 06:00 UTC using the CTX_API_KEY secret. The workflow uploads endpoint_status.json as an artifact so operators can review upstream availability without rerunning the checker locally. Maintainers can also trigger the workflow for a specific pull request by applying the run-endpoint-check label (the job only executes for internal branches so secrets stay protected).
Production deployment
Run via Gunicorn:
gunicorn epacomp_tox.transport.websocket:app -c deploy/gunicorn_conf.pyContainer image: see
deploy/Dockerfilefor a hardened, non-root runtime.Probes:
/healthz(liveness) and/readyz(performs CTX connectivity check). Non-200 responses should trigger restarts.Metrics:
/metricsexposes Prometheus gauges derived fromMCPServer.get_transport_metrics(). Sample scrape/OTEL configs live indeploy/prometheus_scrape.yamlanddeploy/otel_collector_metrics.yaml.Additional rollout guidance (TLS, ingress, scaling) lives in
docs/deployment.md.
Integrating with coding agents
The repository includes step-by-step instructions in docs/integration_guides/mcp_integration.md. Highlights:
Codex CLI: add an HTTP provider pointing to
http://localhost:8000/mcpwith theAuthorization: Bearer <token>header when auth is enabled.Gemini CLI: configure the provider transport to
httpwith the same endpoint and optional headers.Claude Code / Cursor: update the MCP provider JSON to point to the HTTP endpoint; WebSocket is optional when streaming events are required.
Each guide covers tool listing, sample calls, binary payload handling, and troubleshooting tips (timeouts, auth failures, unexpected 4xx responses).
Output artifacts
Every successful tool invocation returns payloads designed for both agents and people:
content: human-readable text for chat surfaces; chemical search and resolution include an explicit source line.structuredContent: machine-readable object results that exactly match the advertised output schema.structuredContent.data: the standard envelope used when a tool's native result is an array or scalar._meta: runtime-only upstream, provenance, and session information that does not alter the scientific result schema.Default registered tools are retrieval and federation oriented; experimental predictive/orchestrator modules in this repository are not part of the canonical public surface yet.
Tool annotations identify these public retrieval tools as read-only and idempotent. Approval persistence is controlled by the MCP client (for example Claude Desktop), not by the server.
Security checklist
Disable
BYPASS_AUTHand front the MCP server with OAuth/OIDC once deployed beyond local development.Restrict
CORS_ALLOW_ORIGINSto approved hosts when exposing the HTTP transport.Rotate
CTX_API_KEYregularly and store secrets outside the repository (e.g. cloud secret manager or OS keychain).Monitor
/metricsfor negotiated capability changes and unexpected spikes intools/callfailures.Enable HTTPS/TLS at the ingress or reverse proxy layer.
Keep GitHub branch protection, dependency review, and CodeQL scanning enabled on the canonical repository.
Pin GitHub Actions workflows to immutable commit SHAs and update them intentionally during maintenance windows.
Generate and retain a CycloneDX SBOM for release artifacts so downstream consumers can audit package composition.
Publish signed provenance and SBOM attestations for release artifacts so consumers can verify what was built and released.
Follow coordinated vulnerability disclosure guidance in
SECURITY.md.
Development notes
Architecture snapshot
┌────────────────┐ ┌────────────────────────────┐ ┌──────────────────────┐
│ MCP Client │ MCP │ FastAPI App │ MCP │ CompTox Resources │
│ (CLI / IDE) │──────▶│ HTTP (/mcp) & WS (/mcp/ws) │──────▶│ • chemical │
└────────────────┘ │ • tool registry │ │ • bioactivity │
│ │ • JSON-RPC dispatch │ │ • exposure / hazard │
▼ │ • response validation │ │ • metadata / interop │
└────────────────────────────┘ │ • utility catalogs │
└──────────────────────┘Guardrails & governance
Applicability-domain definitions, policy defaults, and remediation steps live under
metadata/with JSON Schema validation.Response contracts live under
docs/contracts/schemas/(seedocs/contracts/README.md) and are enforced before MCP responses are returned; upstream failover policies are summarized indocs/contracts/endpoint-matrix.md.Experimental predictive/orchestrator modules remain in-repo design and implementation assets; they are not part of the default public tool catalog until explicitly registered and documented.
Testing & quality gates
tests/test_mcp_conformance_suite.pycovers handshake, catalog discovery, and streaming behaviours.tests/test_tool_contracts.pyenforces output schema declarations for the registered resources.scripts/smoke_ctx.shruns integration smoke tests against the live CTX API.scripts/mcp_http_smoke.shperforms a quick JSON-RPC handshake and tool listing against the HTTP transport.scripts/mcp_interop_smoke.pyvalidates the public interop tool path end-to-end over the HTTP transport.scripts/release_smoke.pyexercises authenticated readiness, manifest discovery, deterministic identifier resolution, screening prioritization, interop builders, and WebSocket parity in one release-oriented pass..github/workflows/live-interop-smoke.ymlruns the interop smoke path in GitHub Actions on demand or on a weekly schedule whenCTX_API_KEYis configured.Documentation builds (
scripts/build_docs.sh) and CI workflows keep diagrams and links healthy.Experimental predictive/orchestrator suites remain valuable internal regression coverage, but they should not be presented as canonical public-surface checks.
Roadmap
Completed:
v0.2.6release cleanup — self-contained wheel contract schemas and standalone startup verification.Completed:
v0.2.5release cleanup — schema-valid, readable chemical search and resolution responses.Completed:
v0.2.4release cleanup — strict MCP pagination compatibility for HTTP and WebSocket discovery.Completed:
v0.2.3release cleanup — audit hardening, privacy controls, provenance capture, and workflow governance.Completed:
v0.2.2release cleanupCompleted:
v0.2.1stabilization and the matchingv0.2.1release descriptionRevisit predictive/orchestrator publication only after the default server, contracts, and docs all agree.
Current limitations
Predictive and orchestrator code still exists in-repo, but it is not part of the default public MCP tool catalog.
CompTox MCP publishes AOP linkage summaries, but OECD-style mechanistic normalization still belongs in
aop-mcp.CompTox MCP publishes PBPK context bundles, but PBPK execution, qualification, uncertainty synthesis, and internal exposure objects still belong in
pbpk-mcp.BER logic, stop/continue/refine policy, and final NGRA decisions remain out of scope for this server.
Live evidence retrieval still depends on upstream CTX availability and API credentials.
Contributing
See CONTRIBUTING.md for development workflow, coding standards, and PR expectations.
Security policy
See SECURITY.md for coordinated disclosure guidance and supported reporting channels.
Support
See SUPPORT.md for public support, bug-reporting, and non-security guidance.
Code of conduct
See CODE_OF_CONDUCT.md for collaboration expectations across the project and suite.
Citation
If you use this project in research or derived tooling, please cite:
Ivo Djidrovski. BioRxiv preprint. DOI / link: 10.64898/2026.02.06.703989v1
License
This project is licensed under the Apache License 2.0. See LICENSE for details.
Acknowledgements
EPA's Center for Computational Toxicology and Exposure (CCTE)
The ctx-python project for the official CompTox Python bindings
The Model Context Protocol community for defining the automation surface we target
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceProvides chemical informatics endpoints for converting between chemical names and SMILES, processing molecule structures, and comparing molecules, with MCP compatibility.Last updated4MIT
- AlicenseAqualityAmaintenanceAn MCP server that gives AI assistants access to biological and biomedical RDF databases via SPARQL at the RDF Portal, as well as selected REST APIs (NCBI E-utilities, UniProt, ChEMBL, PDB, Reactome, Rhea, MeSH, and more).Last updated2911MIT
- Alicense-qualityAmaintenanceAccess EPA environmental data — facility compliance (ECHO), toxic releases (TRI), Superfund sites, drinking water systems, environmental justice screening (EJScreen), and real-time air quality (AirNow) via MCP.Last updated1151Apache 2.0
- Flicense-qualityCmaintenanceProvides oncology data (research, news, FDA approvals, clinical trials) and IBM MAMMAL biomedical predictions (PPI, DTI, ClinTox) as MCP tools. Allows AI agents to query cancer datasets and run predictions through a remote MCP server.Last updated
Related MCP Connectors
EPA ECHO MCP — wraps EPA ECHO Web Services (free, no auth)
EPA Emissions MCP — wraps EPA Envirofacts REST API (free, no auth)
ClinicalTrials MCP — wraps ClinicalTrials.gov API v2 (free, no auth)
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ToxMCP/comptox-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server