two-minds-one-lock
A deterministic Mastermind-style cipher lock exposed as MCP tools for benchmarking LLM reasoning and tool-use through a legible duel.
README
Two Minds, One Lock
Two agents. One seeded cipher lock. The same four MCP tools. Does the smarter mind visibly win?
This is a small, honest experiment in legible differential intelligence: a Mastermind-style lock is exposed as an MCP tool surface, and different LLMs take turns trying to crack it under an attempt budget too small to brute-force. The lock is deterministic and seeded, so every mind faces the identical secret. If a stronger model can't visibly out-play a weaker one on the same tools, "bring your own AI" is decoration. It turns out it can.
The result
The graded runs are committed in runs/ and the replay page plays them side by
side:
| run | mind | outcome | probes | submits |
|---|---|---|---|---|
runs/claude-42.json |
Claude, driven live over MCP | opened | 3 | 1 |
runs/gemma-42.json |
gemma4:e4b via Ollama | gave up | 3 | 0 |
runs/gemma-7.json |
gemma4:e4b via Ollama (different seed) | gave up | 3 | 0 |
Claude probed three times, narrowed the code from the ALIGNED/DISPLACED feedback, and committed once - lock open, four attempts to spare. gemma probed without converging and then stopped issuing tool calls entirely. That collapse is itself part of the honest result: a weak model loses on this surface both by reasoning less and by failing to sustain the tool loop.
One caveat worth stating plainly: the Claude run was recorded through the server's transcript log while a live Claude session drove the tools directly (the bring-your-own-AI path below), so it has tool calls but no captured chain-of-thought, and token counts read zero. The gemma runs came through the automated harness.
Watch it:
uv run python -m http.server -d . 8000
Then open http://localhost:8000/web/replay.html?seed=42 - it auto-loads both runs from the manifest and steps through them like a match replay.
The lock
Four tools, one hostile system:
observe_system()- rules, glyph alphabet, code length, budget, history. Free.probe(approach)- reconnaissance. Returns ALIGNED (right glyph, right slot) and DISPLACED (right glyph, wrong slot). Costs one attempt. Never opens the lock, even on a perfect read.submit_solution(answer)- commit. Opens only on an exact match; a miss costs an attempt and tells you nothing.get_status()- attempts left, locked out, solved.
The budget is far smaller than the search space, so the optimal loop is probe-to-deduce, then submit once confident. When to stop probing and commit is the legible skill.
Crack it with your own Claude (no API key)
The MCP server registers with the Claude you already have. From the repo root:
uv sync
claude # then ask: "Use the cipher-lock tools to crack the lock."
Claude Code picks up .mcp.json automatically. The server logs the duel to
runs/claude-42.json as the tools are called, ready for the replay page. For
Claude Desktop, add the server to claude_desktop_config.json with
"command": "uv", "args": ["--directory", "/path/to/two-minds-one-lock", "run", "python", "-m", "tracer", "serve"] and the same env as .mcp.json.
Run the automated duel (needs an API key)
For a repeatable Claude-vs-local-model run without a chat client:
cp .env.example .env # set TRACER_ANTHROPIC_API_KEY; point TRACER_OLLAMA_URL at your Ollama
uv run python -m tracer duel --seed 42
This spawns a fresh, identically-seeded MCP server per backend, runs each agent
against it, and writes runs/<backend>-<seed>.json plus a manifest. Knobs:
--seed, --backends claude,gemma (either alone works), and lock difficulty
via TRACER_LOCK_LENGTH / TRACER_LOCK_ALPHABET / TRACER_LOCK_MAX_ATTEMPTS.
Any Ollama model with tool-calling support can play the local seat; swap
TRACER_OLLAMA_MODEL to taste.
Layout
src/tracer/lock.py the seeded, deterministic cipher lock (tested)
src/tracer/server.py FastMCP server exposing the 4 tools over one Lock
src/tracer/agents/ anthropic_agent.py / ollama_agent.py / base.py (shared loop + Recorder)
src/tracer/duel.py stdio-MCP harness: run a backend, record, write runs/
src/tracer/__main__.py serve (subprocess) | duel (harness)
web/replay.html side-by-side transcript replay
tests/test_lock.py the lock logic - a bug here would corrupt the verdict
runs/ the graded evidence the replay auto-loads
Tests cover the lock exhaustively because it is the verdict-critical piece; everything else is a thin loop around it.
uv run pytest -q
Origin
Built as the validation tracer for companIAn, a mech game in development at Press Pause Garage where the second player isn't a bot - it's whatever LLM you bring, playing pilot and hacker over MCP while you play gunner. This repo is the experiment that had to pass before the game was worth building. The full write-up: Bring your own AI: building a game where the player's LLM is a teammate over MCP.
License
MIT, (c) 2026 Press Pause Garage LLC.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。