Adaptyv Foundry MCP Server
Enables natural language control of Adaptyv Bio's Foundry lab API through Claude Desktop/Code, allowing users to create experiments, check status, and retrieve results using plain English commands.
README
Adaptyv Foundry SDK + MCP Server + ExperimentWatcher Agent
A typed Python SDK for Adaptyv Bio's Foundry lab API, a TypeScript MCP server so Claude can drive the lab in plain English, and a governed agent that drafts customer-update emails from finished results — with a human sign-off gate and a tamper-evident audit trail so nothing reaches a customer unreviewed.
Built as a take-home for an AI Engineer role at Adaptyv Bio. No live API key was available, so everything below runs against a fixture-backed mock mode that is structurally identical in shape to the real API (validated against the vendored OpenAPI spec, not just internal models).
For the "why" behind every component and design decision — written for a non-engineer building toward a technical understanding — see LEARNING_GUIDE.md. For the system diagram and end-to-end data flows, see docs/ARCHITECTURE.md. For the full build history, phase-by-phase, including every design change and why, see ROADMAP.md.
What this actually does
Adaptyv's customers submit protein sequences and get back binding-affinity and stability measurements. Today, driving that pipeline and writing the results email is a manual, engineer-mediated chore. This project:
- Wraps the Foundry API in a clean, typed Python SDK (
adaptyv/) — one client,mock=Trueormock=False, identical shapes either way. - Exposes it to Claude Desktop/Code via an MCP server (
mcp/), so anyone can create experiments, check status, and pull results by asking in plain English. - Runs an
ExperimentWatcheragent that polls for completed results, deterministically flags anomalies (never an LLM's judgment call — a fixed policy), and drafts a plain-English customer update — which a human must review and approve before it's ever "sent." Every draft, review, and anomaly acknowledgement is recorded in a hash-chained, append-only audit log. - Backs all of it with an offline eval suite (
evals/) that gates on deterministic guards — not vibes — so a prompt or code change that reintroduces a defect fails loudly before it ships.
Quickstart
Requires Python 3.11+ and Node.js 18+.
# Python SDK + CLI
python3 -m venv .venv
. .venv/bin/activate
pip install -e ".[dev]"
# Try it — everything below runs with no API key, against fixtures
adaptyv experiments list
adaptyv results get aaaaaaaa-0000-0000-0000-000000000001
# Run the full test suite
make test # 170 tests
# Run the offline eval suite (deterministic guards, zero LLM calls, zero cost)
make eval # 3/3 golden cases
# MCP server (TypeScript)
cd mcp && npm install && npm test # 16 tests
npm run build
Point Claude Desktop's MCP config at mcp/dist/index.js to drive the lab conversationally (see docs/ARCHITECTURE.md for the exact tool list and what each does).
Watching for new results and drafting updates
# One polling cycle, mock data, stub drafter (no Anthropic key needed)
adaptyv watch --once
# Review what it drafted
adaptyv review list
adaptyv review show <draft_id>
# A human approves (or rejects) — the agent can never do this itself
adaptyv review approve <draft_id> --by alice@adaptyvbio.com
# Verify the audit trail hasn't been tampered with
adaptyv audit verify
If a result trips a critical anomaly (e.g. all sequences failed, or the positive control is out of policy range), review approve is hard-blocked until a human runs review ack — there's no code path that lets a critical anomaly reach a customer silently.
To use real Claude-drafted emails instead of the deterministic stub, set ANTHROPIC_API_KEY and pass mock_llm=false where the bridge/MCP tool expose it (see docs/ARCHITECTURE.md) — this is the only part of the system that costs money or calls a live model; everything else, including the entire eval suite, is free and offline by design.
Project layout
adaptyv/ Python SDK — the single source of truth
├── models.py typed request/response models, schema-faithful to the real OpenAPI spec
├── transport.py MockTransport (fixtures) / live_transport.py (real httpx client)
├── client.py AdaptyvClient(mock=True|False) — same shape either way
├── resources/ experiments, sequences, targets, results
├── agents/ AnomalyDetector, EmailDrafter, Watcher (the governed agent)
├── governance/ ApprovalStore (HITL state machine), AuditLog (hash-chained)
├── bridge.py the MCP↔SDK subprocess JSON bridge (`python -m adaptyv --json`)
└── cli.py the `adaptyv` command-line tool
mcp/ TypeScript MCP server — 8 task-shaped tools over stdio
evals/ Offline eval suite: golden set, deterministic guards, eval→improve
loop, human-feedback flywheel
tests/ 170 tests covering every module above
docs/ Architecture, design specs, phase-by-phase implementation plans
Honest scope and limitations
This is a take-home, not a production system, and it's been reviewed hard (three rounds of external code review, each fixing real defects the previous round missed or introduced — the full history is in ROADMAP.md's Change Log, including what was found and how it was fixed). What's still explicitly out of scope, by design:
- No live LLM-judge eval. The eval suite gates on deterministic guards only (fact-grounding, anomaly-rule matching, HITL hard-block enforcement) — a rubric-scored LLM judge was scoped as a stretch goal and deliberately not built, since it requires live, costed Anthropic API calls that shouldn't happen by default in an offline test suite.
- Concurrency is single-connection. The governance store (
ApprovalStore,AuditLog) is safe for one process/connection at a time; it does not yet handle two reviewers or two watcher processes racing on the same sqlite connection from different processes. - The subprocess bridge trusts its caller.
python -m adaptyv --jsonis meant to be spawned by the bundled MCP server, not exposed to untrusted input directly; the MCP tool that drafts customer updates lets the calling model choose the governance database path and whether to call a live LLM, which is a reasonable tool-surface choice for a local, single-user desktop tool but would need tightening before any multi-tenant use. MockTransportdoesn't implement pagination/filtering. It always returns the full fixture set; onlyLiveTransportgenuinely paginates against a real server.- A handful of smaller, explicitly logged items (live-transport network-error mapping, a few incomplete response models) are tracked in
ROADMAP.mdrather than silently left unmentioned.
Testing philosophy
Every module was built test-first. make test runs all 170 Python tests; make eval runs the offline agent-output eval suite; cd mcp && npm test runs the 16 TypeScript tests. All three are fully offline — no network calls, no API key, no cost — which is also true of every CI-relevant check in this repo.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。