mcph
MCP Harness: diagnostics, real-client proxy and LLM-as-a-judge evals for MCP servers.
Early development: only
mcph doctordoes real work so far.
Install
pip install mcph # Python 3.12+
uvx mcph --help # or run it without installing
Quick start
Describe your MCP servers in a mcph.yaml in your project: stdio servers that mcph starts for you, and http servers that are already running.
servers:
- name: orders
transport: stdio
command: uv
args: ["run", "python", "src/server.py"]
env:
LOG_LEVEL: WARNING
- name: docs
transport: http
url: http://localhost:8080/mcp
auth: # optional: send a bearer token
type: bearer
token_env: DOCS_TOKEN # name of an environment variable holding the token
Then check them:
$ mcph doctor
Checking 2 servers from /path/to/mcph.yaml
orders
OK started in 423 ms (orders-server 1.0.0, MCP 2026-07-28), 3 tools
WARN core.tool_name_snake_case: tool 'getOrder' is not snake_case (try 'get_order')
docs
OK connected in 87 ms (docs-server 2.1.0, MCP 2026-07-28), 5 tools
OK core.tool_name_snake_case
SKIP oauth.metadata, oauth.issuer, oauth.pkce, oauth.registration: not needed, the server accepted the connection
All servers OK, 1 warning.
Under each server doctor lists every rule: OK ran and found nothing, WARN or ERROR found a problem, OFF is turned off in mcph.yaml, and SKIP could not run or was not needed (skipped rules with the same reason share one line). To make a rule fail the run instead, or to switch it off, add a doctor section to the same file:
doctor:
rules:
core.tool_name_snake_case: error # or warn, or off
See Configuring rules for the details.
Commands
| Command | What it does |
|---|---|
mcph doctor |
Starts each stdio server (or connects to an http one), completes the MCP handshake, lists its tools, checks them against the built-in rules and reports what each rule found. |
mcph auth login, status, logout |
Signs in to an http server that uses OAuth through the browser, shows who is logged in, and signs out again. |
mcph version |
Prints the installed version. |
mcph proxy, mcph eval |
Placeholders, not implemented yet. |
-c, --config PATHselects the config file (default./mcph.yaml). It goes before the command:mcph -c other.yaml doctor.mcph doctor --timeout SECONDSlimits how long each server may take to start and answer (default 30).mcph doctor --strictalso fails on warnings, which is handy in CI.mcph doctorexits with0if all servers are OK,1if a server failed (or, with--strict, if there are warnings),2if the config is invalid.
If an http server refuses mcph, doctor says why instead of a generic error: no token was sent (401), the token was rejected (with the server's error, its explanation and the scope it asks for), or the token lacks a scope (403). It also shows what the server announces about its OAuth setup when it publishes protected resource metadata (RFC 9728): its authorization server and scopes.
docs
ERROR authentication required: the server answered 401 (add `auth` to this server in mcph.yaml)
challenge: Bearer resource_metadata="http://localhost:8080/.well-known/oauth-protected-resource/mcp"
authorization server: https://auth.example.com/
scopes: api.read, api.write
SKIP core.tool_name_snake_case: mcph could not connect to the server
OK oauth.metadata
OK oauth.issuer
OK oauth.pkce
OK oauth.registration
Doctor also checks the OAuth setup the server announces (for an auth: {type: oauth} server that is not logged in yet too), so a problem that would stop a client from signing in shows up before anyone tries. It only sends unauthenticated requests, and only for a server that needs authentication. For a server that connected, these checks are listed as SKIP:
| Check | Severity | Looks for |
|---|---|---|
oauth.metadata |
error | The authorization server's metadata can be found and has an authorization and a token endpoint. |
oauth.issuer |
error (warning if only a trailing slash differs) | The metadata's issuer is the authorization server the resource announced. |
oauth.pkce |
error | PKCE with S256 is advertised. |
oauth.registration |
warning | Dynamic client registration is offered. |
Each of these is a rule you can configure (see Configuring rules).
OAuth login
For a server that uses OAuth, set auth: {type: oauth} (optionally with scopes) and sign in once:
$ mcph auth login docs
Signing in to docs (http://localhost:8080/mcp)
Opening your browser. If it does not open, visit:
https://auth.example.com/authorize?response_type=code&client_id=...
Logged in to docs; the token expires in 15 min.
mcph doctor then uses the stored token. It is an access token that usually expires after a few minutes; when it has, doctor tells you to log in again. mcph auth status shows who is logged in and when each token expires, and mcph auth logout docs deletes the token. For CI use a bearer token from an environment variable instead.
Tokens are kept in a file only you can read, under mcph's state directory (set MCPH_STATE_DIR to put it elsewhere). mcph does not keep refresh tokens.
If login stops with Authorization server metadata issuer mismatch, the server announces its authorization server differently from the way that server describes itself. The standard wants the two to be identical, so the right fix is on the server. When the only difference is a trailing slash (https://auth.example.com/ against https://auth.example.com), you can have mcph accept it with ignore_issuer_trailing_slash: true under auth. It tolerates that one difference and nothing else.
Rules
mcph doctor checks every server that starts against these built-in rules:
| Rule | Severity | Checks |
|---|---|---|
core.tool_name_snake_case |
warning | Tool names are snake_case, like get_order rather than getOrder. |
Warnings do not fail the run unless you pass --strict.
Configuring rules
Under doctor.rules in mcph.yaml, set how serious a rule is, or turn it off. This applies to the rule above and to the oauth.* checks, by rule id:
doctor:
rules:
core.tool_name_snake_case: error # a camelCase tool name now fails the run
oauth.registration: off # do not check for dynamic client registration
error: findings of the rule are errors, so the run fails (exit code1).warn: findings are warnings, which fail the run only with--strict.off: the rule does not run, and the report lists it asOFF. Write it without quotes if you like: YAML readsoffas false, and mcph accepts that.
Rules you do not list keep their default severity. A configured severity replaces the default for all findings of that rule, so oauth.issuer: error also makes a trailing-slash difference an error. With all four oauth.* checks off, doctor does not contact an authorization server at all.
A rule id that does not exist is a config error (exit code 2) that lists the known ids and suggests the closest one.
mcph.yaml
version: optional,"1".servers: a list of servers, each with:name: unique; letters, digits,_and-.transport:stdioorhttp.command,args,env(stdio): how to start the server.url(http): the Streamable HTTP endpoint of a server you have already started, such ashttp://localhost:8080/mcp. mcph does not start it.auth(http, optional), one of:type: bearerandtoken_env, the name of an environment variable that holds a bearer token. mcph reads the token from its own environment, never from the YAML, and sends it asAuthorization: Bearer ...to the server's URL only; it is never printed.type: oauth, optionalscopesand optionalignore_issuer_trailing_slash: sign in through the browser withmcph auth login <server>(see OAuth login).
primary: optionaltruefor the server you are developing (at most one).
doctor: optional settings formcph doctor.rules: how serious each rule is, asrule id: error | warn | off(see Configuring rules).
stdio servers run from the directory containing mcph.yaml, with a minimal environment (HOME, PATH, ...) plus the env you list. Unknown keys are rejected, so typos are reported.
Metadata
Release files for mcph 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 |
|---|---|---|---|---|
| mcph-0.1.0.tar.gz | 31.1 kB | With provenance | Details for mcph-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcph-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for mcph-0.1.0-py3-none-any.whl |
Total release size: 68.5 kB
Release files / mcph-0.1.0.tar.gz
| Download URL | mcph-0.1.0.tar.gz |
|---|---|
| Size | 31.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b2c26b6c5a234881b1792c3726449e924e1002d18c26708f7374794023ff103
|
|
BLAKE2b-256 checksum How to use checksums |
c6da6036eebe429d593045b12a2312612386ed34f629ca4f8b42926bc6509bd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logRelease files / mcph-0.1.0-py3-none-any.whl
| Download URL | mcph-0.1.0-py3-none-any.whl |
|---|---|
| Size | 37.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dae6309e80a8f0a6a207439fc7fb240cf4121c61887ff8ea1a821fda48fbd311
|
|
BLAKE2b-256 checksum How to use checksums |
a41de76a9e6e868598fb20b5abfa53143dd41bd6660fafea7f4ef50ad23a7576
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logSecurity for mcph 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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mcph-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logA 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.