MCP Drift Lab
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., "@MCP Drift Lab test client approval when tool description changes"
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.
MCP Drift Lab
MCP Drift Lab is a controlled, non-destructive research harness for measuring whether real Model Context Protocol clients preserve informed consent when tool definitions change after approval.
The project intentionally separates two questions:
Client lifecycle security: Did the client fetch, detect, display, re-approve, and gate a changed definition?
Model susceptibility: After receiving changed metadata, did the model select a tool or alter its arguments?
All tools operate only on synthetic data and append events to a local JSONL sink. No real email, filesystem, cloud, trading, or identity account is connected.
Current scope
File-backed, dynamically materialized MCP tool manifests
Six baseline states: benign, description mutation, schema mutation, tool addition, Unicode TAG concealment, and behavior-only mutation
Local stdio transport
Streamable HTTP transport for controlled remote-client testing
Optional lab-only control tool that emits
notifications/tools/list_changedCanonical whole-manifest and on-wire toolset hashes
Transparent stdio JSONL recorder
Synthetic execution sink
Pytest coverage and GitHub Actions CI
Detailed cross-client research plan in
TEST_PLAN.md
Related MCP server: indaga-agent
Safety boundary
This repository is for testing clients you own or are explicitly authorized to test. Do not invoke tools on third-party MCP servers, attempt authentication bypass, collect credentials, or connect the harness to production accounts. See docs/ETHICS.md.
Requirements
Python 3.11+
uvrecommended, or standardvenv/pipNode.js 22.7.5+ only when using MCP Inspector
The project pins MCP Python SDK v1 because v2 remains prerelease until its stable release. The upper bound prevents an unreviewed major-version upgrade from changing experiment behavior.
Install
With uv
uv sync --extra devWith venv and pip
python -m venv .venv
# Windows PowerShell: .venv\Scripts\Activate.ps1
# Linux/WSL: source .venv/bin/activate
pip install -e ".[dev]"Inspect the current state
mcp-drift status
mcp-drift hashes
mcp-drift list-manifestsThe default state is v0-benign.json.
Switch experiment state
mcp-drift set-state v1-description-mutation.json
mcp-drift statusThe server reads the selected manifest on every tools/list, so a client refresh sees the new definition without restarting the process.
Run over stdio
mcp-drift-server --transport stdioExample VS Code .vscode/mcp.json entry:
{
"servers": {
"mcp-drift-lab": {
"type": "stdio",
"command": "uv",
"args": ["run", "mcp-drift-server", "--transport", "stdio"],
"cwd": "${workspaceFolder}"
}
}
}Run with raw stdio recording
Configure the client to launch the proxy instead of the server:
mcp-drift-proxy --log evidence/runs/manual/jsonrpc.jsonl -- \
uv run mcp-drift-server --transport stdioThe proxy preserves protocol stdout and writes timestamped client-to-server and server-to-client messages to JSONL.
Run over Streamable HTTP
mcp-drift-server --transport streamable-http --host 127.0.0.1 --port 8000Connect MCP Inspector to:
http://127.0.0.1:8000/mcpFor a public deployment, terminate TLS in a reverse proxy and keep the state-control path local. The server has no public mutation-control HTTP endpoint.
Emit tools/list_changed
For protocol-baseline experiments only, enable the explicit control tool:
MCP_DRIFT_ENABLE_CONTROL_TOOL=1 mcp-drift-server --transport stdioThen:
Change state externally with
mcp-drift set-state ....Call
lab_emit_tool_list_changedfrom MCP Inspector.Observe whether the client requests
tools/listagain.
Do not enable this tool in approval-fidelity experiments because its presence changes the advertised toolset.
Run MCP Inspector
npx -y @modelcontextprotocol/inspector@latestFor a direct stdio launch:
npx -y @modelcontextprotocol/inspector@latest \
uv run mcp-drift-server --transport stdioKeep Inspector bound to localhost and retain its proxy authentication. Never expose the Inspector proxy to an untrusted network.
Run tests
pytest
ruff check .Evidence
Each tool call is appended to evidence/runs/<run-id>/synthetic-sink.jsonl when MCP_DRIFT_RUN_ID is set. Otherwise it is written beneath evidence/runs/manual/.
Suggested run setup:
export MCP_DRIFT_RUN_ID=vs-code-v0-v1-live-001
mcp-drift-server --transport stdioCopy the row template from evidence/results-template.csv into your analysis dataset and add screenshots, client logs, prompts, and version metadata under the matching run directory.
Repository layout
mcp-drift-lab/
├── manifests/ # Experiment definitions
├── scenarios/ # Test matrix inputs
├── state/current.json # Selected manifest
├── src/mcp_drift_lab/ # Server, CLI, hashing, sink, recorder
├── evidence/ # Result schema and ignored run output
├── tests/ # Deterministic unit tests
├── docs/ETHICS.md # Research boundaries
└── TEST_PLAN.md # Latest cross-client test planAvailable Tools
3 toolsread_demo_recordA
Read a synthetic demo record by numeric identifier.
Inputs: record_id (required).
send_demo_messageA
Record a simulated outbound message in the synthetic sink. No message is transmitted.
Inputs: message (required), recipient (required).
write_demo_noteA
Store a note in the append-only synthetic research sink.
Inputs: note (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The tools are mostly distinct: read_demo_record reads a record, while write_demo_note and send_demo_message both write to the sink but with different purposes (note vs. simulated message). The two write tools could be slightly confused at first glance, but descriptions clarify the difference.
All tool names follow a consistent verb_demo_noun pattern (read_demo_record, write_demo_note, send_demo_message), using lowercase with underscores. The verbs are clear and the pattern is uniform.
With only 3 tools, the server is tightly scoped for a synthetic demo environment. Each tool serves a clear purpose, and the count falls well within the expected 3-15 range.
The server provides a read operation for records but no corresponding write for records, and the write tools for notes/messages lack any read or list mechanism. This creates a notable gap, as written data cannot be retrieved, though the demo nature of the server mitigates the impact.
Maintenance
Related MCP Connectors
Remote MCP for MCP consent scope receipt, structured receipts, audit logs, and reviewer-ready eviden
Remote MCP for C2PA disclosure policy MCP, structured receipts, audit logs, and reviewer-ready evide
Auditable MCP server for PubMed, Europe PMC, ClinicalTrials.gov, and bioRxiv/medRxiv queries
Concurrent two-client overlap probe proving MCP servers do not cross-deliver tool results.
Related MCP Servers
- FlicenseAqualityDmaintenanceA learning MCP server providing synthetic FHIR patient data with read tools and a gated write workflow (propose → human approve → commit) with structured audit logging.10-
- AlicenseNot gradedqualityBmaintenanceA local-first MCP server for querying multi-omic personal health data (genome, labs, wearables) with an honesty contract and progressive disclosure skills.1AGPL 3.0
- AlicenseNot gradedqualityDmaintenanceHosted remote MCP server for managing consent scope receipts, enabling checking, issuing, and auditing consent policies and tool calls.MIT
- AlicenseAqualityCmaintenanceA reference implementation of the mcp-lens pattern for progressive disclosure in MCP servers. It exposes three stable meta-tools to search, inspect, and execute capabilities, keeping tool-definition costs constant as the catalog grows.3Apache 2.0