PoisonDash MCP Server
Click on "Deploy 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., "@PoisonDash MCP Server Compare my finished experiments and export a sanitized dataset."
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.
PoisonDash MCP Server
A Model Context Protocol server that lets an LLM agent (Claude, or any MCP client) operate PoisonDash, a research platform for detecting data-poisoning and backdoor attacks in image-classification training sets.
Through 28 typed tools, an agent can generate poisoned datasets with published attacks (Narcissus, Label-Consistent, Sleeper Agent, Hidden Trigger Backdoor), configure and launch the two-phase detection pipeline, follow training logs, compare runs, inspect flagged samples as images, and export a sanitized dataset with the poisoned samples removed.

PoisonDash itself (the FastAPI backend, ML pipeline, and web dashboard) is private research-lab software. This repository holds only the MCP server, which I designed and built, plus a mock backend so you can run the whole thing without access to the lab's infrastructure.
flowchart LR
A["MCP client<br/>(Claude Code, Claude Desktop, ...)"] -- "JSON-RPC over stdio" --> B["poisondash-mcp<br/>(this repo)"]
B -- "REST + bearer JWT<br/>/api/*" --> C{{"PoisonDash backend<br/>(private)"}}
B -. "same contract" .-> D["mock-backend/<br/>(this repo)"]The server never touches a database or runs ML code itself. It is a thin, careful client of the backend's REST API, and the backend keeps authorization, validation, and the GPU work.
Try it in two minutes (mock backend)
Requires Node 20 or newer.
npm ci
npm run build
npm run mock # terminal 1: in-memory PoisonDash API on http://127.0.0.1:8321Then register the server with your MCP client. For example, put this in a project-local
.mcp.json for Claude Code, or in claude_desktop_config.json:
{
"mcpServers": {
"poisondash": {
"command": "node",
"args": ["/absolute/path/to/poisondash-mcp/dist/index.js"],
"env": {
"POISONDASH_API_URL": "http://127.0.0.1:8321",
"POISONDASH_EMAIL": "admin@demo.local",
"POISONDASH_PASSWORD": "demo-admin",
"POISONDASH_ADMIN": "true"
}
}
}
}Ask the agent something like "Which experiments have finished? Compare them, show me the highest-scoring sample from the latest one, and export a sanitized copy of its dataset."
To see the tools work without a client, run the scripted walkthrough:
npm run test:walkthrough # terminal 2: drives the server over stdio and prints each tool's output== results ==
| Experiment #100 (status: completed)
| Scored suspect samples: 500 (clean reference set: 400)
| Predicted poisoned (score >= threshold): 26 / 500 (detection rate 5.2%)
| Avg poisoning score: 0.159
| Score distribution (0->1, 10 bins): [203, 175, 85, 11, 1, 0, 8, 10, 4, 3]
| Threshold method: kmeans | Threshold: 0.4382
| Important features: 14 identified
| Experiment #100: 500 suspect samples scored
| Mean: 0.1589 Median: 0.1283 Std: 0.1600
| >= 0.4382 (stored threshold): 26 (5.2%)
== inspect and export ==
ok - get_sample_image returned a PNG
| Saved sanitized dataset to .../experiment_100_sanitized.npz (1460370 bytes)
| Original samples: 500
| Removed (score >= threshold): 26
| Kept: 474The mock seeds three demo accounts (admin, registered, and guest; it prints them on startup), poisoned and clean datasets, a model checkpoint, completed and failed experiments, and a pending upload for the moderation queue. Generation and detection jobs run on timers, stream log lines, record provenance, and can be cancelled. The numbers are synthetic but consistent with each other: every summary is computed from the per-sample scores.
Related MCP server: TrustHarness
Engineering highlights
These are the parts I'd point a reviewer at:
Credentials never pass through the model. There is deliberately no
authenticatetool. Tool arguments reach model context, conversation history, and client telemetry, so credentials come only from the server's environment. A preset token and a login credential are mutually exclusive, so an expiring token can never silently hand the session to a different account (src/auth.ts).Lazy, deduplicated auth with silent recovery.
initializeandtools/listnever wait on the backend. The first tool call logs in if the startup warm-up hasn't finished, a burst of concurrent calls shares one in-flight login, and a 401 triggers exactly one re-login and retry, with no loops.Timeouts that know what they are guarding. JSON responses are timed through the body read, so a peer that sends headers and then stalls can't hang a call. The sanitized-dataset download is timed only until its headers arrive, because a multi-gigabyte export is legitimately slow (src/client.ts).
A file-writing tool that can't be steered outside its sandbox.
get_sanitized_datasetstreams to disk without buffering. It resolves the destination against a configured output directory usingrealpath, so symlinks and Windows junctions are handled too. It reserves the destination withO_EXCL, writes to a randomizedO_EXCLtemp file (which closes the symlink write-through hole), and renames the file into place. An interrupted download never replaces a good file (src/tools/analysis.ts).Honest tool metadata. Every tool publishes MCP annotations. The protocol defaults (
readOnlyHint: false,destructiveHint: true) would otherwise advertise a plain listing as a destructive write, and clients would gate it behind a confirmation prompt.Bounded fan-out. Tools that look up related rows, such as uploader names or multi-experiment comparisons, go through a small concurrency limiter, so
limit=500doesn't open 500 sockets against a single-process backend (src/concurrency.ts).Defensive parsing of a loosely-typed API. Several backend fields are JSON-in-a-string, and failed or cancelled runs persist only a stub. Every parse tolerates missing, partial, or stub shapes, and the output omits values the backend is known to report wrongly rather than showing a misleading zero (see the caveats below).
Tested at three levels. There are 146 unit tests with a mocked
fetch, and they run portably on Windows and POSIX without shell globs. A smoke test drives the real stdio server through every tool, its error paths, and teardown. A walkthrough takes a run to completion. CI runs all three on Ubuntu and Windows with Node 20 and 22.
Tool inventory
Area | Tools |
Dashboard |
|
Datasets |
|
Attacks |
|
Generation |
|
Configuration |
|
Experiments |
|
Analysis |
|
Admin (gated) |
|
Configuration (environment variables)
Variable | Purpose | Default |
| Base URL of the backend. A path prefix (e.g. |
|
| Login credential, also used for silent 401 recovery | — |
| Pre-set JWT. Mutually exclusive with the credentials above | — |
| Cosmetic visibility gate for the admin tools in |
|
| The only directory | user's Downloads folder, else a temp dir |
| Per-request timeout. Covers the JSON body as well as the headers. The streamed |
|
Read tools need an account with role guest or higher. Mutating tools
(create, run, generate, configure, cancel) need registered or higher, and admin tools
need admin, which the backend enforces.
If both POISONDASH_TOKEN and the email/password pair are set, the token wins and the
credentials are ignored with a warning on stderr. If neither is set, the server still
starts and tools/list still works. Auth-requiring tools then return a clear error until
the server is restarted with credentials.
Keep the client entry that carries these values in a local, git-ignored settings file, never in a shared, version-controlled one.
While developing, run npm run dev (via tsx, straight from src/), or point the client
at npx tsx /path/to/src/index.ts so you don't need a rebuild after every change.
Testing
npm test # 146 unit tests, mocked fetch, no backend needed
npm run build # type-check and compile
npm run mock # then, in another terminal:
npm run test:smoke # every tool, error paths, and teardown against a live backend
npm run test:walkthrough # one detection run end to endBoth integration scripts accept --dist to test the compiled output. They read
SMOKE_API_URL, SMOKE_EMAIL, and SMOKE_PASSWORD, which default to the mock's admin, and
SMOKE_VERBOSE=1 echoes the server's stderr. They provision everything they need through
the API and delete exactly what they created. Against the real backend, point them at a dev
instance, never at a database you care about.
Mock backend knobs: MOCK_PORT (8321), MOCK_JOB_MS (simulated run length, 8000), and
MOCK_TOKEN_TTL_S (3600). Set the TTL to a few seconds to watch the server re-authenticate
silently mid-session.
Backend caveats this server works around
results_json,config_json, and provenancedata_json/important_featuresare opaque strings. Every parse goes throughsafeJsonParseand tolerates missing, partial, or stub shapes. Failed or cancelled runs may carry onlysummary.statusplusmetadata.log_tail.metadata.batch_level_epochsandmetadata.sample_level_epochsin experiment results are always 0, because the config snapshot taken at experiment creation doesn't populate them.get_experiment_resultsomits them rather than surfacing a misleading zero. Useget_configurationfor the real epoch counts./api/dashboard/summaryreports storage installation-wide, so the dashboard tool also calls/api/datasets/storage/infoand reports per-user and installation-wide storage separately.list_datasets,list_configurations, andlist_experimentsare always scoped to the caller, even for admins. Those endpoints have no server-side "show everyone's" flag; that is whatget_system_statsandlist_pending_datasetsare for.Attack type isn't present in experiment results or config, so
compare_experimentsomits it rather than doing a fragile name-matched dataset lookup.
Project layout
src/
index.ts stdio server: tools/list + tools/call dispatch
auth.ts, client.ts token lifecycle, typed fetch client, error shaping
config.ts environment parsing
concurrency.ts bounded mapLimit
tools/ one module per area; registry.ts holds the registration + visibility gate
types.ts mirrors of the backend's response schemas
mock-backend/ zero-dependency in-memory stand-in for the private backend
test/unit/ node:test suites (run via test/run-unit.mjs)
test/integration/ stdio smoke test and walkthroughCredits
PoisonDash, including the detection pipeline, backend, and web app, is developed by a UofM-DSP Lab. This MCP server was my contribution to the project. It is published here, and the attack implementations named above belong to their respective published papers.
License
Available Tools
24 toolsanalyze_score_distributionARead-onlyIdempotent
Compute summary statistics over an experiment's per-sample poisoning scores: mean, median, std, min, max, quartiles, and counts above fixed cutoffs (0.3, 0.5, 0.7) plus a chosen threshold. per_sample_scores covers only the suspect set with no clean/suspect ground-truth label, so these statistics describe the suspect score population only -- a clean-vs-suspect separation isn't computable from this data. Useful for tuning the detection threshold.
Inputs: experiment_id (required), threshold.
cancel_experimentADestructiveIdempotent
Cancel a running or pending experiment. If a background thread is actively running, this only requests cancellation -- status reads 'cancelling' until it finishes unwinding.
Inputs: experiment_id (required).
cancel_generationADestructiveIdempotent
Cancel an in-progress (or pending) dataset generation job. If a background thread is actively running, this only requests cancellation -- the status will read 'cancelling' until it finishes unwinding.
Inputs: dataset_id (required).
compare_experimentsARead-onlyIdempotent
Compare multiple experiments side by side: dataset name, threshold method, threshold, detection rate, average score, and runtime. Fetches each experiment's name and results in parallel. Attack type is not available from these endpoints and is omitted (it can only be approximated via a best-effort dataset-name lookup).
Inputs: experiment_ids (required).
create_configurationA
Create a new pipeline configuration. Any field you omit takes the backend's own default (see get_default_configuration). A runnable configuration needs BOTH dataset_id (the suspect dataset) and clean_dataset_id (the clean reference set) -- running a pipeline without the clean dataset raises FileNotFoundError. dataset_id/clean_dataset_id/model_id must reference datasets or models the caller owns (admins can reference anyone's), and a rejected dataset cannot be used.
Inputs: name, seed, device, cv_model, +27 more.
create_experimentA
Create a new experiment bound to an existing configuration (the caller must own the configuration, or be admin). Does not start the run -- call run_experiment with the returned id next.
Inputs: name (required), configuration_id (required), description.
get_configurationARead-onlyIdempotent
Get a single saved pipeline configuration by ID, including the batch-level and sample-level epoch counts that experiment results do not carry. This is the source of truth for an experiment's real hyperparameters: take configuration_id from list_experiments and look it up here.
Inputs: config_id (required).
get_dashboard_summaryARead-onlyIdempotent
Get the calling user's dashboard: counts of their datasets/models/experiments, their 5 most recent datasets and experiments, storage usage, and the latest analysis from their most recent completed/running experiment. Counts and recent items are scoped to the logged-in user even for admins; storage is reported both per-user (against the caller's quota) and installation-wide (against the system cap). For system-wide state across all users, use get_system_stats (admin only).
Inputs: no named parameters.
get_datasetARead-onlyIdempotent
Get full detail on a single dataset or model by ID: generation status/progress, attack type, base dataset, poison ratio, and moderation (approval) state. Note: the generation parameters used to create the dataset and its on-disk file path are intentionally not exposed by the API -- no endpoint returns them.
Inputs: dataset_id (required).
get_default_configurationARead-onlyIdempotent
Get the built-in default pipeline configuration (id=0, a virtual template, not a saved row). Use this to see PoisonDash's default hyperparameters before creating a real configuration.
Inputs: no named parameters.
get_experiment_logsARead-onlyIdempotent
Fetch new log lines for a running or finished experiment. Poll with since (the cursor from the previous call's next_cursor) to get only new lines. Pass tail_lines instead to fetch everything from the start and return just the last N lines (a 'tail' view) -- this overrides since. After the in-memory log buffer is evicted (5 minutes after the run finishes) this falls back to the persisted log tail in the experiment's results, if any.
Inputs: experiment_id (required), since, tail_lines.
get_experiment_resultsARead-onlyIdempotent
Get the detection results for a completed experiment: summary counts, average poisoning score, score distribution, threshold, important features, and runtime. Set include_per_sample_scores=true to also include the raw per-sample scores (large -- displayed truncated for very large sets). Failed/cancelled runs may return only a status stub with a log tail.
Inputs: experiment_id (required), include_per_sample_scores.
get_experiment_statusBRead-onlyIdempotent
Poll an experiment's run status and progress percentage.
Inputs: experiment_id (required).
get_generation_statusBRead-onlyIdempotent
Poll the progress of a dataset generation job started with start_generation.
Inputs: dataset_id (required).
get_provenance_recordsBRead-onlyIdempotent
Get the pipeline-stage provenance trail for an experiment: batch-level feature importance (phase I), sample-level dataset composition (phase II setup), and scoring thresholds (phase II results). Summarizes the three pipeline stages.
Inputs: experiment_id (required).
get_sample_imageARead-onlyIdempotent
Fetch a single sample from an experiment's suspect dataset as a PNG image, for visually inspecting a flagged sample.
Inputs: sample_index (required), experiment_id (required).
get_sanitized_datasetADestructive
Download the experiment's suspect dataset with flagged poisoned samples removed, as a .npz file suitable for re-training. Requires the experiment to be completed with per-sample scores present. The saved file always lands inside POISONDASH_OUTPUT_DIR (the user's Downloads folder by default) -- output_path is resolved relative to that directory and any attempt to escape it, including via a symlink, is refused. Won't overwrite an existing file unless overwrite=true.
Inputs: experiment_id (required), overwrite, threshold, output_path.
list_available_attacksARead-onlyIdempotent
List the poisoning attacks PoisonDash can generate (lc, narcissus, sa, htb), with which base datasets each supports and which extra parameters each requires. Optionally filter to attacks that support a specific base_dataset. Parameter descriptions are client-supplied documentation, not part of the API response.
Inputs: base_dataset.
list_configurationsBRead-onlyIdempotent
List the caller's own saved pipeline configurations.
Inputs: skip, limit.
list_datasetsARead-onlyIdempotent
List the caller's own datasets and/or models (uploaded or generated). Per-user: only shows items the caller owns, with no server-side status filter -- the owner sees all of their own items regardless of approval state. Use type to filter to just 'dataset' or just 'model'.
Inputs: skip, type, limit.
list_experimentsARead-onlyIdempotent
List the caller's own experiments. There is no server-side status filter -- fetch and filter by status client-side if needed (pending, running, cancelling, completed, failed, cancelled).
Inputs: skip, limit.
run_experimentADestructive
Start (or restart) an experiment's detection pipeline in the background. Fails with 409 if already running, or 400 if the linked configuration/dataset is missing or was rejected by an admin. Poll get_experiment_status or get_experiment_logs afterward -- this call returns as soon as the run is queued.
Inputs: experiment_id (required).
start_generationA
Start generating a poisoned dataset with one of the 4 attacks (see list_available_attacks). Runs as a background job -- poll get_generation_status with the returned dataset id. Constraints (enforced server-side): 'lc' requires clean_model_id (an uploaded model checkpoint); 'sa' and 'htb' require source_class AND pre-generated .npy files already present on disk -- generation fails at runtime without them. Each attack only supports specific base_dataset values (see list_available_attacks).
Inputs: name (required), attack_type (required), eps, vis, +9 more.
update_configurationADestructive
Update fields on an existing configuration. Only the fields you pass are sent to the API and changed -- omitted fields keep their current value (the backend uses exclude_unset semantics). Do not pass a field just to keep it the same. Pass null for dataset_id, clean_dataset_id, or model_id to detach that reference.
Inputs: config_id (required), name, seed, device, +28 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
The tools are highly distinct, adhering strictly to resource-action separation (e.g., list_datasets vs get_dataset, start_generation vs get_generation_status). Even within workflows, the specialized nature of the PoisonDash operations ensures minimal confusion.
Naming is extremely consistent, utilizing a predictable `action_resource` pattern across all operations. The use of standard verbs like `get`, `list`, `create`, `update`, `start`, and `cancel` maintains high predictability.
With 24 tools, the set is on the heavier side, but this count is justifiable given the significant complexity of the underlying ML domain. Each tool provides a necessary and distinct piece of functionality for the end-to-end data poisoning workflow.
The tool surface is remarkably complete, covering the full lifecycle: data generation, configuration management, experiment initiation, execution tracking (logs/status), result analysis, and data retrieval. There are no obvious dead ends in the core workflow.
Maintenance
Related MCP Connectors
Paid deterministic data-quality and execution-verification tools for AI agents.
Safety tools for AI agents: safe page reader, prompt-injection, secrets, PII and MCP server scans
Train, evaluate, red-team and deploy AI agents: prompt tuning, LLM-judged evals, katas.
AI Agent Utility Layer for agent safety, web monitoring, crypto research and tool discovery.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables testing AI safety classifier robustness against query decomposition, obfuscation, and multi-agent attacks. Provides tools for full evaluation pipelines, query previews, and status checks.46MIT
- AlicenseBqualityDmaintenanceEnables deterministic security testing of AI agents that use tools by serving synthetic MCP environments with poisoned data, fake secrets, and privileged actions. Records agent tool calls and evaluates security invariants (e.g., canary leaks, forbidden access, approval binding) without an LLM judge or real systems.8MIT
- AlicenseNot gradedqualityBmaintenanceEnables agents to track ML experiments with a reproducible write contract, internal git snapshots, and a queryable knowledge graph, plus a live web UI for humans.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables active deception for AI agents by injecting decoy honeypot tools that detect indirect prompt injection attempts, instantly terminate hostile sessions, and seal cryptographic incident evidence.Apache 2.0