{
  "markdown": "[![Python 3.10+](https://img.shields.io/badge/Python-3.10+-green.svg)](https://www.python.org/)\n[![PyPI](https://img.shields.io/pypi/v/t1-t2-protocol.svg)](https://pypi.org/project/t1-t2-protocol/)\n[![CI](https://github.com/Fauxetine/t1-t2-protocol/actions/workflows/ci.yml/badge.svg)](https://github.com/Fauxetine/t1-t2-protocol/actions/workflows/ci.yml)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n[![MCP](https://img.shields.io/badge/MCP-2025--03--26-purple.svg)](https://modelcontextprotocol.io/)\n[![MCP Registry](https://img.shields.io/badge/MCP_Registry-io.github.Fauxetine%2Ft1--t2--protocol-blue)](https://registry.modelcontextprotocol.io/)\n\n# T1/T2 Protocol — Heterogeneous Validation for MCP\n\n[中文文档](README.zh.md) · [MCP Registry entry](https://registry.modelcontextprotocol.io/) (`io.github.Fauxetine/t1-t2-protocol`)\n\n<!-- mcp-name: io.github.Fauxetine/t1-t2-protocol -->\n\n> **Reference implementation.** This is a **stdlib-only MCP reference server** for structured reasoning discipline — not a production security product. Evaluate your own threat model before deploying in sensitive environments. Unlike official Python MCP servers, it does **not** use the `mcp` SDK; it speaks JSON-RPC over stdio directly.\n\n**T1/T2 is an MCP server that makes AI reasoning verifiable, auditable, and trustworthy** — by decomposing ambiguous questions into structured tiers (T1), then validating answers through cross-model evaluation (T2), with a deterministic checksum layer that doesn't depend on any LLM.\n\n## Why?\n\nWhen an LLM checks its own answer, it uses the same training data, the same reasoning preferences, and the same systematic biases. **Self-reflection cannot catch its own blind spots.**\n\nT1/T2 introduces **heterogeneous validation**: the model that produces the answer and the model that evaluates it should be different. Their different training distributions cover each other's blind spots.\n\n## Tools\n\n| Tool | Function | Why it matters |\n|------|----------|---------------|\n| **t1_protocol** | Decomposes ambiguous questions into L1 (facts) / L2 (assumptions) / L3 (hypotheses) / L4 (unknowns) | Forces structured reasoning before answering |\n| **t2_protocol** | Evaluates answer quality from another model's perspective (qualitative five-level confidence) | Catches blind spots self-reflection misses |\n| **checksum** | Deterministic structural validation — pure regex, zero LLM dependency | Safety that doesn't scale with intelligence |\n\n> **How tools return data:** `t1_protocol` and `t2_protocol` return **structured prompt templates** for your MCP host's LLM to execute. Only `checksum` returns deterministic JSON (`checksum_passed`, `errors`).\n\n### Tool inputs (MCP schema)\n\n#### t1_protocol\n\n| Input | Type | Required | Description |\n|-------|------|----------|-------------|\n| `question` | string | yes | The ambiguous question to decompose |\n| `locale` | string | no | `en` (default) or `zh` |\n| `weight_hint` | string | no | `fact-first`, `efficiency-first`, `cost-first`, `robustness-first`, `general-first` (or Chinese equivalents) |\n\n#### t2_protocol\n\n| Input | Type | Required | Description |\n|-------|------|----------|-------------|\n| `answer` | string | yes | Text to evaluate (often the host LLM's draft answer) |\n| `locale` | string | no | `en` (default) or `zh` |\n| `weight_hint` | string | no | Same values as `t1_protocol` |\n\n#### checksum\n\n| Input | Type | Required | Description |\n|-------|------|----------|-------------|\n| `text` | string | yes | Structured answer text to validate |\n\nReturns JSON: `{\"checksum_passed\": bool, \"errors\": [...]}`.\n\n## Quick Start\n\n### Requirements\n\n- Python 3.10+\n- An MCP client: [Cursor](https://cursor.sh/), [Claude Desktop](https://claude.ai/download), [Windsurf](https://codeium.com/windsurf), or any MCP-compatible host\n\n### Install\n\nFrom PyPI (recommended):\n\n```bash\npip install \"t1-t2-protocol>=0.1.0\"\n```\n\nFrom source (development):\n\n```bash\ngit clone https://github.com/Fauxetine/t1-t2-protocol.git\ncd t1-t2-protocol\npip install -e \".[dev]\"\nT1T2_DISABLE_COUNTERS=1 python -m pytest tests/ -v\n```\n\nOr run directly without installing:\n\n```bash\npython src/t1_t2_mcp_server.py   # Windows\npython3 src/t1_t2_mcp_server.py  # macOS / Linux\n```\n\n### Configure\n\nAfter `pip install`, use the console script in MCP config (recommended):\n\n```json\n{\n  \"mcpServers\": {\n    \"t1-t2-protocol\": {\n      \"type\": \"stdio\",\n      \"command\": \"t1-t2-protocol\"\n    }\n  }\n}\n```\n\n**Cursor** — `.cursor/mcp.json` (same as above).\n\n**Claude Desktop** — `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"t1-t2-protocol\": {\n      \"command\": \"t1-t2-protocol\"\n    }\n  }\n}\n```\n\n**From source (no pip install)** — point at the script:\n\n```json\n{\n  \"mcpServers\": {\n    \"t1-t2-protocol\": {\n      \"type\": \"stdio\",\n      \"command\": \"python\",\n      \"args\": [\"C:/path/to/t1-t2-protocol/src/t1_t2_mcp_server.py\"]\n    }\n  }\n}\n```\n\nOn macOS/Linux use `\"command\": \"python3\"` instead of `\"python\"`.\n\n### Verify it works\n\n1. Restart or reload your MCP host after editing config.\n2. Confirm three tools appear: `t1_protocol`, `t2_protocol`, `checksum`.\n3. Call `t1_protocol` with `{\"question\": \"Should we adopt microservices?\", \"locale\": \"en\"}` — you should receive a structured T1 prompt template.\n4. Call `checksum` with sample `[L1 Facts]` … `---` text — you should receive JSON with `checksum_passed`.\n\n## Usage\n\n### T1: Structure a vague question\n\nCall `t1_protocol` with your question. The host LLM receives a structured prompt template with four tiers:\n\n```\nInput:  {\"question\": \"Should we migrate our monolith to microservices?\"}\n\nOutput: Prompt template instructing the host to produce:\n  [L1 Facts]      Team size, codebase size, current stack\n  [L2 Assumptions] Expected benefits that need verification\n  [L3 Hypotheses] Testable claims about migration risk\n  [L4 Unknown]    Future growth trajectory\n  [Core Question] The precise feasibility question\n```\n\n### T2: Cross-validate a decision\n\nCall `t2_protocol` with a decision or answer text. Returns an evaluation prompt for the host LLM:\n\n```\nInput:  {\"answer\": \"Decision text for approach A...\"}\n\nOutput: Prompt template requesting:\n  Confidence: high | medium-high | medium | medium-low | low\n  Adoption table with:\n    ✅ Adopt     — verified conclusions (L1)\n    ⚠️ Reserved — needs more evidence (L2)\n    ❌ N/A      — blind spots to address\n```\n\n### checksum: Validate output structure\n\nCall `checksum` with structured text. It returns pass/fail based on deterministic rules:\n\n```\nInput: \"[L1 Facts]\\n1. ...\\n[L2 Assumptions]\\n1. ...\\n---\"\nOutput: {\"checksum_passed\": true, \"errors\": []}\n```\n\n### Full pipeline\n\n```\nVague question → T1 structured decomposition → Decision based on structure → checksum (optional) → T2 validation → Refined decision\n```\n\nFor time-sensitive factual claims, **search on the caller side before T2** — see [Caller-side web verification (v2.6)](docs/caller-protocol.md).\n\n## Configuration\n\n### Locale\n\nBoth `t1_protocol` and `t2_protocol` accept an optional `locale` parameter:\n\n| Value | Output |\n|-------|--------|\n| `en` (default) | English templates |\n| `zh` | Chinese templates |\n\nExample: `{\"question\": \"...\", \"locale\": \"zh\"}`\n\n### Weight hints\n\nBoth `t1_protocol` and `t2_protocol` accept an optional `weight_hint` parameter to bias evaluation criteria:\n\n| Weight | Effect |\n|--------|--------|\n| `事实优先` / `fact-first` | Prioritizes factual accuracy |\n| `效率优先` / `efficiency-first` | Prioritizes efficiency |\n| `成本优先` / `cost-first` | Prioritizes cost |\n| `鲁棒性优先` / `robustness-first` | Prioritizes robustness |\n| `通用优先` / `general-first` | No specific bias |\n\n### Recursion protection\n\nT2 automatically detects recursion depth and terminates at depth >= 3, where marginal information gain drops below 5%.\n\n## Design Philosophy\n\nSee [docs/philosophy.md](docs/philosophy.md) for the full design rationale.\n\nCore tenets:\n\n1. **Separate intelligence from trust** — AI capability and AI safety should be guaranteed by different systems\n2. **Heterogeneous over self-referential** — Cross-model validation is more reliable than self-reflection\n3. **Deterministic over probabilistic** — What can be checked by code should not be left to model judgment\n\n## Examples\n\nSee [examples/](examples/) for step-by-step walkthroughs:\n\n- [T1: Structure a vague question](examples/t1-basic.md)\n- [T2: Cross-validate a decision](examples/t2-basic.md)\n- [Full pipeline: T1 → decision → T2](examples/full-pipeline.md)\n\n## Positioning\n\n| Project | Layer | What it does | T1/T2 relationship |\n|---------|-------|--------------|-------------------|\n| [Sequential Thinking](https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking) (official MCP) | Caller-side chain-of-thought | One model logs iterative steps | Complementary — T1 adds L1–L4 tiers + T2 cross-model review |\n| [ThoughtProof](https://github.com/modelcontextprotocol/modelcontextprotocol/discussions/2574) / verdict APIs | Server-side verification | `APPROVE`/`DENY`/`UNCERTAIN` with confidence | Complementary — T1/T2 structures reasoning *before* verdict APIs act |\n| Self-reflection / prompt chains | Same model | Re-reads or re-prompts its own output | Replaced — heterogeneous validation catches shared blind spots |\n| Tool integrity (e.g. Phionyx) | Transport / tool schema | Detects tool poisoning, schema drift | Orthogonal — T1/T2 does not secure tool definitions |\n\nT1/T2 is a **stdlib reference implementation** for [MCP Discussion #2574](https://github.com/modelcontextprotocol/modelcontextprotocol/discussions/2574)-style reasoning discipline: structure first (T1), cross-validate second (T2), checksum what code can verify. It is not a signed verdict API and not a security scanner.\n\n## Versioning\n\nTwo version numbers — do not conflate them:\n\n| | Example | Meaning |\n|---|---------|---------|\n| **Package** (PyPI) | `0.1.0` | Distribution lifecycle. `0.x` = experimental ([SemVer](https://semver.org/), [FastAPI policy](https://github.com/fastapi/fastapi/blob/master/docs/en/docs/deployment/versions.md)). |\n| **Protocol** (spec) | `v2.5` | T1/T2 tool semantics in server output footer. Caller-side web verify docs use `v2.6`. |\n\nRecommended install: `pip install \"t1-t2-protocol>=0.1.0\"`. Erroneous PyPI releases `2.5.2`–`2.5.4` are yanked.\n\n## License\n\nApache License 2.0 — see [LICENSE](LICENSE).\n\n---\n\n*Built for the MCP ecosystem. Part of a broader exploration into AI safety through deterministic architecture.*\n\n---\n\n## Links\n\n- [Contributing](CONTRIBUTING.md)\n- [MCP Registry](https://registry.modelcontextprotocol.io/) — `io.github.Fauxetine/t1-t2-protocol`\n- [Security policy](SECURITY.md)\n- [Changelog](CHANGELOG.md)\n- [Design philosophy](docs/philosophy.md)\n- [Caller-side web verification v2.6](docs/caller-protocol.md)\n- [Agent / MCP host instructions](AGENTS.md)\n",
  "bytes": 10861,
  "sha": "af4f3d4aaf6e68a90637e347ef63a9b2d18d8dc30666b29ad347d421d0522910",
  "repo_slug": "fauxetine/t1-t2-protocol",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_fauxetine_t1_t2_protocol_bebf388b/readme"
}