T1/T2 Protocol

io.github.Fauxetine由 GitHub 账号 Fauxetine 发布v0.1.1更新于 Oct 24, 2026

Caller-side T1/T2 heterogeneous validation MCP server. Stdlib-only Python.

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

AI 生成的概览

一个本地参考用 MCP 服务器,把含糊问题拆成分层结构并交叉校验答案,另附确定性的校验和检查工具。

可以做什么
用 t1_protocol 把问题拆成事实、假设、猜想与未知项,返回供宿主模型填写的提示模板。用 t2_protocol 从另一个模型的视角评估草稿答案,返回置信度与采纳建议的提示模板。用 checksum 按确定性正则规则检查结构化答案文本,返回通过与否的 JSON。可选指定英文或中文模板,以及事实优先、成本优先等权重提示。
适用场景
适合在决策或含糊问题上需要一套可重复的推理流程,并对最终文字做低成本结构检查时使用。它是供试验的参考实现,并非生产级验证或安全工具。
运行要求
需要 Python 3.10 或更高版本,以及支持 MCP 的宿主(如 Cursor、Claude Desktop)。可从 PyPI 安装 t1-t2-protocol(提供命令行入口),或直接运行服务器脚本。未声明需要账号、API 密钥或环境变量。
安装前请注意
README 说明这是仅用标准库的参考实现,不是生产安全产品,在敏感环境中部署前应自行评估威胁模型。t1 与 t2 工具只返回提示模板,实际推理和后续操作由宿主模型完成。它不保护工具定义,也不提供签名裁决。

安装

在 SourceWeft 中

  1. 打开 控制台中的 T1/T2 Protocol,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Python 3.10+] [PyPI] [CI] [License: Apache 2.0] [MCP] [MCP Registry]

T1/T2 Protocol — Heterogeneous Validation for MCP

中文文档 · MCP Registry entry (io.github.Fauxetine/t1-t2-protocol)

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.

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.

Why?

When 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.

T1/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.

Tools

ToolFunctionWhy it matters
t1_protocolDecomposes ambiguous questions into L1 (facts) / L2 (assumptions) / L3 (hypotheses) / L4 (unknowns)Forces structured reasoning before answering
t2_protocolEvaluates answer quality from another model's perspective (qualitative five-level confidence)Catches blind spots self-reflection misses
checksumDeterministic structural validation — pure regex, zero LLM dependencySafety that doesn't scale with intelligence

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).

Tool inputs (MCP schema)

t1_protocol
InputTypeRequiredDescription
questionstringyesThe ambiguous question to decompose
localestringnoen (default) or zh
weight_hintstringnofact-first, efficiency-first, cost-first, robustness-first, general-first (or Chinese equivalents)
t2_protocol
InputTypeRequiredDescription
answerstringyesText to evaluate (often the host LLM's draft answer)
localestringnoen (default) or zh
weight_hintstringnoSame values as t1_protocol
checksum
InputTypeRequiredDescription
textstringyesStructured answer text to validate

Returns JSON: {"checksum_passed": bool, "errors": [...]}.

Quick Start

Requirements

Install

From PyPI (recommended):

bash
pip install "t1-t2-protocol>=0.1.0"

From source (development):

bash
git clone https://github.com/Fauxetine/t1-t2-protocol.gitcd t1-t2-protocolpip install -e ".[dev]"T1T2_DISABLE_COUNTERS=1 python -m pytest tests/ -v

Or run directly without installing:

bash
python src/t1_t2_mcp_server.py   # Windowspython3 src/t1_t2_mcp_server.py  # macOS / Linux

Configure

After pip install, use the console script in MCP config (recommended):

json
{  "mcpServers": {    "t1-t2-protocol": {      "type": "stdio",      "command": "t1-t2-protocol"    }  }}

Cursor — .cursor/mcp.json (same as above).

Claude Desktop — claude_desktop_config.json:

json
{  "mcpServers": {    "t1-t2-protocol": {      "command": "t1-t2-protocol"    }  }}

From source (no pip install) — point at the script:

json
{  "mcpServers": {    "t1-t2-protocol": {      "type": "stdio",      "command": "python",      "args": ["C:/path/to/t1-t2-protocol/src/t1_t2_mcp_server.py"]    }  }}

On macOS/Linux use "command": "python3" instead of "python".

Verify it works

  1. Restart or reload your MCP host after editing config.
  2. Confirm three tools appear: t1_protocol, t2_protocol, checksum.
  3. Call t1_protocol with {"question": "Should we adopt microservices?", "locale": "en"} — you should receive a structured T1 prompt template.
  4. Call checksum with sample [L1 Facts] … --- text — you should receive JSON with checksum_passed.

Usage

T1: Structure a vague question

Call t1_protocol with your question. The host LLM receives a structured prompt template with four tiers:

Input:  {"question": "Should we migrate our monolith to microservices?"}
Output: Prompt template instructing the host to produce:  [L1 Facts]      Team size, codebase size, current stack  [L2 Assumptions] Expected benefits that need verification  [L3 Hypotheses] Testable claims about migration risk  [L4 Unknown]    Future growth trajectory  [Core Question] The precise feasibility question

T2: Cross-validate a decision

Call t2_protocol with a decision or answer text. Returns an evaluation prompt for the host LLM:

Input:  {"answer": "Decision text for approach A..."}
Output: Prompt template requesting:  Confidence: high | medium-high | medium | medium-low | low  Adoption table with:    ✅ Adopt     — verified conclusions (L1)    ⚠️ Reserved — needs more evidence (L2)    ❌ N/A      — blind spots to address

checksum: Validate output structure

Call checksum with structured text. It returns pass/fail based on deterministic rules:

Input: "[L1 Facts]\n1. ...\n[L2 Assumptions]\n1. ...\n---"Output: {"checksum_passed": true, "errors": []}

Full pipeline

Vague question → T1 structured decomposition → Decision based on structure → checksum (optional) → T2 validation → Refined decision

For time-sensitive factual claims, search on the caller side before T2 — see Caller-side web verification (v2.6).

Configuration

Locale

Both t1_protocol and t2_protocol accept an optional locale parameter:

ValueOutput
en (default)English templates
zhChinese templates

Example: {"question": "...", "locale": "zh"}

Weight hints

Both t1_protocol and t2_protocol accept an optional weight_hint parameter to bias evaluation criteria:

WeightEffect
事实优先 / fact-firstPrioritizes factual accuracy
效率优先 / efficiency-firstPrioritizes efficiency
成本优先 / cost-firstPrioritizes cost
鲁棒性优先 / robustness-firstPrioritizes robustness
通用优先 / general-firstNo specific bias

Recursion protection

T2 automatically detects recursion depth and terminates at depth >= 3, where marginal information gain drops below 5%.

Design Philosophy

See docs/philosophy.md for the full design rationale.

Core tenets:

  1. Separate intelligence from trust — AI capability and AI safety should be guaranteed by different systems
  2. Heterogeneous over self-referential — Cross-model validation is more reliable than self-reflection
  3. Deterministic over probabilistic — What can be checked by code should not be left to model judgment

Examples

See examples/ for step-by-step walkthroughs:

Positioning

ProjectLayerWhat it doesT1/T2 relationship
Sequential Thinking (official MCP)Caller-side chain-of-thoughtOne model logs iterative stepsComplementary — T1 adds L1–L4 tiers + T2 cross-model review
ThoughtProof / verdict APIsServer-side verificationAPPROVE/DENY/UNCERTAIN with confidenceComplementary — T1/T2 structures reasoning before verdict APIs act
Self-reflection / prompt chainsSame modelRe-reads or re-prompts its own outputReplaced — heterogeneous validation catches shared blind spots
Tool integrity (e.g. Phionyx)Transport / tool schemaDetects tool poisoning, schema driftOrthogonal — T1/T2 does not secure tool definitions

T1/T2 is a stdlib reference implementation for MCP Discussion #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.

Versioning

Two version numbers — do not conflate them:

ExampleMeaning
Package (PyPI)0.1.0Distribution lifecycle. 0.x = experimental (SemVer, FastAPI policy).
Protocol (spec)v2.5T1/T2 tool semantics in server output footer. Caller-side web verify docs use v2.6.

Recommended install: pip install "t1-t2-protocol>=0.1.0". Erroneous PyPI releases 2.5.2–2.5.4 are yanked.

License

Apache License 2.0 — see LICENSE.


Built for the MCP ecosystem. Part of a broader exploration into AI safety through deterministic architecture.


Links

来源:README.md,提交 0f519dd

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分