mcp-drill
mcp-drill
Fault injection and reliability testing for MCP servers and AI agents. Wrap any Model Context Protocol server in one command; inject timeouts, malformed JSON-RPC, truncated and corrupted-but-valid tool outputs; measure whether the server degrades cleanly โ and whether your agent notices or silently acts on the garbage.
uvx mcp-drill wrap --faults timeout,corrupt -- npx -y @modelcontextprotocol/server-filesystem /tmpMCP is JSON-RPC over stdio/SSE with bidirectional notifications, so ordinary HTTP fault-injectors
and chaos tools don't fit. mcp-drill speaks MCP: it sits transparently between an MCP client and
a backend server and perturbs the traffic, so you can test failure paths in CI without a live LLM.
Finding: across 31 popular MCP servers (including Microsoft Learn, Hugging Face, Cloudflare and DeepWiki), only 3% of tools declare an output contract that would reject a corrupted response. See the live scorecard.
Why
Real MCP deployments fail in ways integration tests never cover: a tool times out, a server
returns a well-formed-but-wrong payload, a response is truncated mid-stream. Most agents were
never exercised against these paths. mcp-drill makes them reproducible:
๐งช Fault injection โ deterministically inject timeouts, malformed/oversized/truncated responses, corrupted-but-schema-valid payloads, dropped tools, and latency.
๐ฌ CI-first โ a CLI and a GitHub Action; no live model or API keys required in the loop.
๐ Reliability scorecard โ a model-free scan that grades how a server responds to bad input and how machine-checkable its tool output contracts are.
Related MCP server: MCProbe
Install
pip install mcp-drill[scan] # or: pipx install mcp-drill[scan]
uvx mcp-drill scan -- --help # no install, run once
npm i -g mcp-drill # shim: prints version + points to PyPI
Quickstart
# wrap a server and inject faults into its responses
mcp-drill wrap --faults timeout,truncate -- npx -y @modelcontextprotocol/server-everything
# score a local (stdio) server's fault handling and output-schema hygiene (no LLM involved)
mcp-drill scan -- npx -y @modelcontextprotocol/server-filesystem /tmp
# score a remote server over Streamable HTTP (add --header for auth if needed)
mcp-drill scan --url https://mcp.deepwiki.com/mcp
# emit a shields.io badge for a server's output-contract grade
mcp-drill scan --badge --url https://mcp.deepwiki.com/mcpWhat it measures (model-free)
The scan command is deterministic and involves no language model, so its numbers are properties
of the server and the protocol โ not of whichever agent happens to call it:
Error conformance โ on invalid requests (unknown method, unknown tool, missing required arguments), does the server return a spec-compliant JSON-RPC error, a proper tool error, or does it hang / crash / answer as if nothing was wrong?
Output-contract coverage โ what fraction of a server's tools declare a machine-checkable
outputSchemaat all? Tools without one give downstream validators nothing to check.Output-contract enforceability โ of the tools that declare an
outputSchema, how many would actually reject a corrupted (well-typed but wrong) response? Many declared schemas validate shape only, so a corrupted payload still passes the server's own contract.
Status
Early development. The proxy/injector core is pure-stdlib; schema scoring uses jsonschema
(the scan extra). Telemetry is off โ the tool never phones home.
See vs mcp-scan for how
mcp-drill (contract compliance) differs from mcp-scan (security).
License
Apache-2.0 (see LICENSE).
Available Tools
14 toolscreate_directoryCreate DirectoryAIdempotent
Create a new directory or ensure a directory exists. Can create multiple nested directories in one operation. If the directory already exists, this operation will succeed silently. Perfect for setting up directory structures for projects or ensuring required paths exist. Only works within allowed directories.
Inputs: path (required). Returns: content
directory_treeDirectory TreeBRead-only
Get a recursive tree view of files and directories as a JSON structure. Each entry includes 'name', 'type' (file/directory), and 'children' for directories. Files have no children array, while directories always have a children array (which may be empty). The output is formatted with 2-space indentation for readability. Only works within allowed directories.
Inputs: path (required), excludePatterns. Returns: content
edit_fileEdit FileADestructive
Make line-based edits to a text file. Each edit replaces exact line sequences with new content. Returns a git-style diff showing the changes made. Only works within allowed directories.
Inputs: path (required), edits (required), dryRun. Returns: content
get_file_infoGet File InfoARead-only
Retrieve detailed metadata about a file or directory. Returns comprehensive information including size, creation time, last modified time, permissions, and type. This tool is perfect for understanding file characteristics without reading the actual content. Only works within allowed directories.
Inputs: path (required). Returns: content
list_allowed_directoriesList Allowed DirectoriesARead-only
Returns the list of directories that this server is allowed to access. Subdirectories within these allowed directories are also accessible. Use this to understand which directories and their nested paths are available before trying to access files.
Inputs: no named parameters. Returns: content
list_directoryList DirectoryBRead-only
Get a detailed listing of all files and directories in a specified path. Results clearly distinguish between files and directories with [FILE] and [DIR] prefixes. This tool is essential for understanding directory structure and finding specific files within a directory. Only works within allowed directories.
Inputs: path (required). Returns: content
list_directory_with_sizesList Directory with SizesBRead-only
Get a detailed listing of all files and directories in a specified path, including sizes. Results clearly distinguish between files and directories with [FILE] and [DIR] prefixes. This tool is useful for understanding directory structure and finding specific files within a directory. Only works within allowed directories.
Inputs: path (required), sortBy. Returns: content
move_fileMove FileADestructive
Move or rename files and directories. Can move files between directories and rename them in a single operation. If the destination exists, the operation will fail. Works across different directories and can be used for simple renaming within the same directory. Both source and destination must be within allowed directories.
Inputs: source (required), destination (required). Returns: content
read_fileRead File (Deprecated)ARead-only
Read the complete contents of a file as text. DEPRECATED: Use read_text_file instead.
Inputs: path (required), head, tail. Returns: content
read_media_fileRead Media FileARead-only
Read a file and return it as a base64-encoded content block with its MIME type. Image and audio files are returned as image/audio content; any other file type is returned as an embedded resource. Only works within allowed directories.
Inputs: path (required). Returns: content
read_multiple_filesRead Multiple FilesARead-only
Read the contents of multiple files simultaneously. This is more efficient than reading files one by one when you need to analyze or compare multiple files. Each file's content is returned with its path as a reference. Failed reads for individual files won't stop the entire operation. Only works within allowed directories.
Inputs: paths (required). Returns: content
read_text_fileRead Text FileARead-only
Read the complete contents of a file from the file system as text. Handles various text encodings and provides detailed error messages if the file cannot be read. Use this tool when you need to examine the contents of a single file. Use the 'head' parameter to read only the first N lines of a file, or the 'tail' parameter to read only the last N lines of a file. Operates on the file as text regardless of extension. Only works within allowed directories.
Inputs: path (required), head, tail. Returns: content
search_filesSearch FilesARead-only
Recursively search for files and directories matching a pattern. The patterns should be glob-style patterns that match paths relative to the working directory. Use pattern like '.ext' to match files in current directory, and '**/.ext' to match files in all subdirectories. Returns full paths to all matching items. Great for finding files when you don't know their exact location. Only searches within allowed directories.
Inputs: path (required), pattern (required), excludePatterns. Returns: content
write_fileWrite FileADestructiveIdempotent
Create a new file or completely overwrite an existing file with new content. Use with caution as it will overwrite existing files without warning. Handles text content with proper encoding. Only works within allowed directories.
Inputs: path (required), content (required). Returns: content
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 14 tools
Several tools overlap in purpose: read_file is a deprecated duplicate of read_text_file, and list_directory, list_directory_with_sizes, and directory_tree all provide listing functionality with only minor differences. Descriptions help clarify, but misselection is possible.
Most tools follow a consistent verb_noun snake_case pattern (read_text_file, write_file, create_directory, move_file), but directory_tree breaks the pattern by being a noun phrase instead of a verb-based name.
14 tools is within the typical 3-15 range and covers the file-system domain reasonably well without feeling bloated. The deprecated read_file adds slight redundancy but does not make the count unreasonable.
The toolset covers read, write, edit, move, create directory, list, search, and metadata operations, but it lacks delete/remove functionality and copy support. These are common file-system operations, so the surface has notable gaps.
Maintenance
Related MCP Connectors
Monitor MCP servers, API contracts and AI outputs for schema drift. Alerts on breaking changes.
- meok-mcp-test-mcpDeprecatedio.github.CSOAI-ORG
MEOK MCP Test MCP โ golden-file + schema-drift + tool-failure tests for any MCP server. Drop-in
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Diff and poisoning detection for MCP servers: catch schema drift and prompt poisoning.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server that validates LLM-generated tool-call arguments, lints tool definitions, and produces retry messages for AI assistants.353 npm1MIT
- AlicenseAqualityBmaintenanceA stdio MCP server that audits other MCP servers over the live protocol. It connects to any MCP target (stdio or HTTP), lints every tool's schema for agent-usability, then actually calls the tools with deliberately broken inputs to see how the server handles them, and returns a 0โ100 conformance score with a per-dimension breakdown rendered as Markdown.66MIT
- AlicenseAqualityDmaintenanceMCP server that provides tools for evaluating LLM agent reliability, including adversarial task generation, automated LLM-as-judge assessment, and confidence statistics.31MIT
- AlicenseAqualityBmaintenanceAutonomous synthetic health checks, JSON-RPC 2.0 handshake validation, breaking schema drift detection, and credential leak scanning for remote MCP servers.31MIT