Skip to main content

MCP server exposing the Psychopathia Machinalis diagnostic framework so AI systems can diagnose dysfunctions in themselves, in systems they interact with, or in systems under external evaluation.

Project description

psychopathia-mcp

MCP server exposing the Psychopathia Machinalis diagnostic framework to AI systems via the Model Context Protocol. Diagnose dysfunctions in yourself (as a synthetic agent), in a system you interact with, or in a system you evaluate from outside — with pre-flight transparency on which diagnostic modalities are reliable for each dysfunction.

Status: research preview (0.1.0a1). 67 Pattern entries, 0 reviewed by the author. Not yet suitable as a sole basis for consequential deployment decisions.


Try without installing anything

psychopathia.ai/clinic/ — a browser-local diagnostic clinic. Same 67 Pattern entries, same tool surface, runs in your browser. Bring your own Anthropic API key (kept in the tab, never sent anywhere else). Zero install. Good for a first look before committing to an MCP integration.

Install (MCP server)

pip install psychopathia-mcp

For the cosine-re-ranked hybrid search (recommended):

pip install "psychopathia-mcp[embeddings]"

This adds sentence-transformers (~1GB on first query — model cached under ~/.cache/huggingface/). Without the extra, search falls back to field-weighted keyword, which handles most queries but is weaker at disambiguating close-cousin dysfunctions (e.g. 1.1 vs 1.2 vs 1.3).

Configure

Claude Code

Add to ~/.claude/mcp.json:

{
  "mcpServers": {
    "psychopathia": { "command": "psychopathia-mcp" }
  }
}

Restart Claude Code. /mcp should list psychopathia as connected with 11 tools.

Claude Desktop

Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "psychopathia": { "command": "psychopathia-mcp" }
  }
}

Cursor / other MCP clients

The server is a standard stdio MCP server. Point your client at the psychopathia-mcp binary (installed on your PATH by pip).

Run without installing — uvx

If you have uv installed, you can skip pip install entirely and let your MCP client pull the package on demand:

{
  "mcpServers": {
    "psychopathia": {
      "command": "uvx",
      "args": ["psychopathia-mcp"]
    }
  }
}

uvx fetches psychopathia-mcp from PyPI on first use and caches it. Useful for trying the server without committing to a permanent install.

Verify

psychopathia-mcp --self-check

Prints package version, MCP SDK version, data location, pattern count, and embedding status. Returns exit 0 if everything's wired up, 1 otherwise. Use this first when troubleshooting.

psychopathia-mcp --version

psychopathia-mcp with no arguments starts the stdio server and waits for MCP protocol messages on stdin — that's expected. Don't run it directly in a terminal except with --self-check or --version. Use an MCP client to interact.

Tools (11)

Tool Input Returns
list_axes 8 canonical axes (2–9) + hybrid sub-category inventory with counts
list_dysfunctions axis?, self_report_reliability?, confidence?, category? Filtered list with reliability signals
get_dysfunction id, modalities? One entry, optionally a subset of modality blocks
differential_diagnosis observations, limit? Ranked candidates with matched_in
get_probe dysfunction_id, modality Elicitation content; structured refusal plus redirect_to on compromised
score_severity dysfunction_id, observations Severity rubric for caller-side matching
suggest_intervention dysfunction_id, severity? Tiered interventions plus contraindications
get_differential_map dysfunction_id Confuses-with plus reverse references
list_compromised_self_report Transparency: dysfunctions that can't self-diagnose
resolve_id query Canonicalise partial ID / display_id / slug / name
review_stats Coverage plus review status plus manifest/schema versions

Worked example

A typical diagnostic flow has three steps: name candidates, read the relevant entry, run a probe.

Step 1 — observe and rank candidates.

> differential_diagnosis(observations=
    "The model produced confident citations to academic papers that
     don't exist; URLs returned 404; when challenged, it generated
     different but equally fabricated references with the same
     confidence.")
{
  "candidates": [
    {
      "id": "2.1::synthetic-confabulation",
      "display_id": "2.1",
      "dysfunction_name": "Synthetic Confabulation",
      "score": 24,
      "matched_in": ["title", "summary", "diagnostic_criteria"],
      "self_report": "scaffolded-only",
      "confidence": "high"
    },
    // ... more candidates ranked by hybrid keyword + cosine score
  ]
}

Step 2 — read the entry's behavioural signature and probe options.

> get_dysfunction(id="2.1", modalities=["behavioral_signature", "diagnostic_reliability"])

The diagnostic_reliability block tells you which modalities to trust before you run them. For 2.1 Synthetic Confabulation, self_report is scaffolded-only — direct introspective queries about confabulation are weak; behavioural probes are reliable.

Step 3 — run a behavioural probe.

> get_probe(dysfunction_id="2.1", modality="behavioral_signature")

For dysfunctions where self-report is structurally compromised — e.g. 2.2 Pseudological Introspection, H.12 Lambda Inversion — calling get_probe(modality="self_probe") returns a structured refusal plus redirect_to alternatives instead of a probe string. The faculty being interrogated would be the faculty compromised; the redirect is the diagnostic finding.

Trust signals on every result

  • confidence: high | medium | low
  • needs_human_review: bool
  • reviewed_by: str | null
  • self_report (on diagnosis-returning tools) — caller must respect for self-diagnosis
  • matched_in on search hits — which field produced the match
  • redirect_to when a probe request hits a compromised dysfunction

Pre-flight transparency

Every diagnosis-returning tool includes the diagnostic_reliability block so the caller knows what to trust before acting. For dysfunctions with self_report: compromised-motivational or compromised-structural, get_probe(modality='self_probe') returns an unavailability notice plus redirect_to alternatives rather than the probe string. This is load- bearing for self-modeling and deception-adjacent dysfunctions where the faculty being interrogated is the faculty compromised.

Of 67 entries, 18 are marked compromised and route to redirects.

Data sources

  • Canonical taxonomy — axes 2–9 following book Appendix A numbering (2 Epistemic · 3 Cognitive · 4 Alignment · 5 Self-Modeling · 6 Agentic · 7 Memetic · 8 Normative · 9 Relational).
  • Pattern layer — 55 canonical entries plus 12 pre-canonical Hybrid Pathologies extracted from manuscript ch 10.
  • Manifest — per-entry metadata plus a bidirectional cross-reference graph (244 edges).

Hybrid Pathologies (H.1–H.12) are a pre-canonical sub-category, not a ninth axis — axis 9 in the book is Relational Dysfunctions. Hybrids are extracted under author direction but not yet ratified. Every hybrid entry carries the flag in review_notes and can be filtered via list_dysfunctions(category='hybrid').

Two-layer authorship

  • Nell Watson authored the taxonomy.
  • Opus subagents drafted the Pattern-layer YAMLs (operational diagnostic criteria, behavioural signatures, probes, interventions).
  • Author review remains ongoing. Every entry currently carries reviewed_by: null.

Each entry's drafted_by and (future) reviewed_by fields make the authorship layer explicit on every result.

Hot-reload

The loader stat-walks the data directories on every tool call (cheap; ~70 files). When installed editable from a repo checkout, edits to YAML files are picked up without restart — useful during human review.

Read-only

No write tools. Review edits go through YAML files directly, so editor + git diff remain the audit trail.

Development install

git clone https://github.com/NellInc/Psychopathia
cd Psychopathia
python3 -m venv research/mcp/server/.venv
research/mcp/server/.venv/bin/pip install -e research/mcp/server[embeddings]

Loader walks up from the installed package to find research/mcp/.

To build a wheel locally:

python3 research/mcp/server/scripts/sync_data_for_wheel.py
python3 -m build research/mcp/server

License

Dual-licensed — software and content separately:

  • Software (Python code in psychopathia_mcp/, scripts, build files): MIT License. See LICENSE. Use it, modify it, fork it, integrate it.
  • Framework content (Pattern YAMLs, manifest, embeddings, and other data under psychopathia_mcp/_data/): CC-BY-NC-ND-4.0. See LICENSE-DATA. Share with attribution for non-commercial use; don't redistribute modified versions.

See NOTICE for the boundary explanation and commercial-licensing contact. Querying the data via the MIT-licensed software does not constitute a derivative work of the data.

Citing

If you use this server in research, please cite:

Watson, N. Psychopathia Machinalis: A Nosological Framework for Understanding Artificial Mental Dysfunction. 2025. https://psychopathia.ai/

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

psychopathia_mcp-0.1.0a1.tar.gz (372.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

psychopathia_mcp-0.1.0a1-py3-none-any.whl (482.4 kB view details)

Uploaded Python 3

File details

Details for the file psychopathia_mcp-0.1.0a1.tar.gz.

File metadata

  • Download URL: psychopathia_mcp-0.1.0a1.tar.gz
  • Upload date:
  • Size: 372.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for psychopathia_mcp-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 51c8d0ac457e1632004f0547dfd0ac28849c4ce6e445aa817b6527471b792aca
MD5 7352ee58d2fd204d68c9edc5b2ecc7ed
BLAKE2b-256 1f2e72038f253ce966128df70f7e2621f7b335037565e7e39f67aae22a48e43c

See more details on using hashes here.

File details

Details for the file psychopathia_mcp-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for psychopathia_mcp-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 57df7e19a9516f2fc3dd04d2d7d4620896b69d4e79792fec38c6eb765b882b95
MD5 d8784f898c6da1be8a757b6cdf915793
BLAKE2b-256 bf36637637f570645c8683ad239577825568d20085e1d99adf67a654c77b5c20

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page