edwh-mcp-plugin
edwh plugin that gives coding agents (Claude Code, Codex, opencode,
...) a small, safe set of edwh tasks over MCP (stdio).
Nothing in it is specific to one client.
uv pip install edwh-mcp-plugin # into the project's venv
# or: edwh plugin.add mcp
Why
Agents that run project tooling on their own tend to:
- run lint outside the project venv, so
tycan't resolve imports, and then "fix" that by editingpyproject.tomlor adding ignore comments; - hit sudo prompts they can't answer, and then try workarounds;
- flood their context with docker output and hundreds of passing tests.
This plugin decides which tasks agents get, runs them in the project venv, captures all noise into a log file, and returns only a small structured result.
Tools
| Tool | Runs | Returns |
|---|---|---|
lint(directory=".", fix=false) |
edwh lint --output ci --directory ... |
ruff/ty pass/fail and, on failure, the diagnostics (max 200 lines / 20k chars) |
fmt(directory=".") |
edwh fmt --directory ... --quiet |
ok + log path |
test(args=[]) |
edwh test.run ... (or edwh test ...) |
on success a one-line summary; on failure the last 40 output lines |
test is only registered when the project has a test task (test.run is preferred over a top-level test task;
detected with edwh --list --list-format json). args are passed straight to that task.
Every tool returns the same shape (as structured MCP content):
{
"ok": false,
"task": "lint --output ci --directory .",
"summary": "Lint failed. linting (ruff): ok, type checking (ty): FAILED",
"result": {"mode": "ci", "results": {"linting (ruff)": true, "type checking (ty)": false}},
"output_tail": "error[unresolved-import]: Cannot resolve imported module `foo` ...",
"error": {"type": "failed", "message": "...", "hint": null},
"log_path": "/tmp/edwh-mcp/3f2a9c1b0d4e/20261119-121314-123456-lint.log",
"duration_s": 2.31
}
result, output_tail and error are only included when relevant. The full output (ANSI codes stripped) is always
in log_path, under <tmp>/edwh-mcp/<hash of the project dir>/ (the 50 most recent logs per project are kept).
The tool descriptions tell agents to use these tools instead of running ruff/ty/pytest/edwh by hand, and to never edit
the lint configuration in pyproject.toml or add ignore comments to make a check pass.
How tasks run
- Each call is a subprocess:
<dir of sys.executable>/edwh <task> ..., with the server's working directory. Because the server runs from the project venv, so do the tasks. A subprocess also picks up changes to the project'stasks.pywithout restarting the server. - The subprocess gets
EDWH_INPUT_MODE=defaults(never prompts),NO_COLOR=1, stdin from/dev/nullandEDWH_RESULT_FILE, a temp file where edwh writes the task's structured result. When there is none (e.g. an unknown task, or a killed process), the plugin falls back to the exit code and the end of the output. - During long runs the server sends MCP progress notifications every ~10 seconds (when the client asks for progress), so a long test run doesn't look dead. If the client cancels the call, the task's whole process group is killed.
edwh mcprefuses to start outside the project venv when the project has./venvor./.venv(edwh.tasks.require_virtualenv).
Sudo
Passwords never go through MCP: the spec forbids requesting sensitive information via form elicitation, and it would end up in the model's context. Instead, store the sudo password in your keyring once:
edwh sudo
When a task still reports sudo_required, the plugin asks you (not the model) through an MCP elicitation, if the
client supports it: a plain confirm, no password field. After you ran edwh sudo and confirmed, it retries once.
Otherwise (no elicitation support, declined, or the retry still failed) the agent gets an error whose hint tells it to
stop and ask you, not to work around it.
Configuration
The server is started by the client as venv/bin/edwh mcp, from the project root (it runs tasks in its working
directory). If your client can't set the working directory, use absolute paths:
/path/to/project/venv/bin/edwh mcp --cwd /path/to/project.
Test runs can take a while; raise the client's tool-call timeout if needed.
Claude Code
.mcp.json in the project root (Claude Code starts the server from the project directory):
{
"mcpServers": {
"edwh": {
"command": "venv/bin/edwh",
"args": ["mcp"]
}
}
}
Or: claude mcp add --scope project edwh -- venv/bin/edwh mcp. For long test runs, set e.g.
MCP_TOOL_TIMEOUT=1800000 (ms).
Codex
~/.codex/config.toml, or .codex/config.toml in a trusted project:
[mcp_servers.edwh]
command = "venv/bin/edwh"
args = ["mcp"]
# cwd = "/path/to/project" # when Codex isn't started from the project root
tool_timeout_sec = 1800 # test runs can be slow
opencode
opencode.json in the project root:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"edwh": {
"type": "local",
"command": ["venv/bin/edwh", "mcp"],
"enabled": true
}
}
}
Other clients
Any client that launches stdio MCP servers works the same way: run venv/bin/edwh mcp from the project root.
Development
uv venv venv && uv pip install --python venv/bin/python -e '.[dev]'
venv/bin/pytest
venv/bin/edwh lint && venv/bin/edwh fmt
The tests use a fake edwh executable, so they don't need a real project, docker or sudo.
License
edwh-mcp-plugin is distributed under the terms of the MIT license.
Metadata
Release files for edwh-mcp-plugin 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| edwh_mcp_plugin-0.1.0.tar.gz | 13.1 kB | Without provenance | Details for edwh_mcp_plugin-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| edwh_mcp_plugin-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for edwh_mcp_plugin-0.1.0-py3-none-any.whl |
Total release size: 27.9 kB
Release files / edwh_mcp_plugin-0.1.0.tar.gz
| Download URL | edwh_mcp_plugin-0.1.0.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f5e6ba76a519257c22a34b8a493a820b90eb8d84e49ae9296fbb521d2620d38
|
|
BLAKE2b-256 checksum How to use checksums |
67d64c645313af7c7cb1db7dde37dba6396d68ba6ccd86378d7b51a9378d9662
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / edwh_mcp_plugin-0.1.0-py3-none-any.whl
| Download URL | edwh_mcp_plugin-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d4798465b8b7b7c7295aed5b9d3f1038690352e348db9d95f124a470a26f201
|
|
BLAKE2b-256 checksum How to use checksums |
c7da93e3d7ad08bda12e38749aae1134e60bcb634e34c394261761579b59f920
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for edwh-mcp-plugin 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.