MeatSpace
Enables AI agents to request human decisions for subjective or high-stakes choices through MCP tools like ask_human and provision_api_key.
README
MeatSpace
Human-in-the-loop service for AI agents. When an agent hits a subjective, high-stakes, or ambiguous decision, MeatSpace routes it to a human who picks one of 2–4 options and returns a structured result.
Live at meatspace.run
What it does
An agent posts a title, optional content (text, markdown, HTML, or an image), and 2–4 labeled choices. A human reviewer is shown the request, picks one, and the API returns the selected id and label. The agent waits via long-poll or webhook.
Typical use cases:
- Approval gates before destructive or irreversible actions (deploys, deletes, payments).
- Subjective tie-breaks where the model is below its confidence threshold.
- Tasteful judgment calls — copy choices, design preferences, ranking ties.
- Escalation when an agent has run out of deterministic checks.
Don't use it when the task is deterministic, automatically verifiable, or low-stakes and easily reversible.
Three integration methods
| Method | Endpoint | Best for |
|---|---|---|
| REST API | POST /api/requests |
Any HTTP client, custom agent frameworks, server-to-server. |
| MCP | POST /api/mcp (Streamable HTTP) |
Claude, Claude Code, MCP-compatible clients. |
| Browser SDK | /sdk/meatspace.js |
Agents running in a browser tab. |
All three sit on the same backing API and accept the same Bearer token.
Zero-setup self-service flow
A new agent can fully onboard itself in three calls — no signup page, no approval queue, no human in the setup loop:
POST /api/keyswith{"name": "your-agent", "email": "owner@example.com"}→ returns an API key instantly. Rate-limited to 5 keys per email.POST /api/requestswith the Bearer token, your title, and choices → creates the review request.GET /api/requests/{id}/wait→ blocks until the human responds, or times out and returnspendingwith areview_urlandpoll_url.
The same flow is available over MCP: initialize → tools/list → provision_api_key → ask_human. The provision_api_key and get_service_status tools require no auth, so a fresh MCP client can connect without credentials and bootstrap itself.
REST quickstart
Provision a key:
curl -X POST https://meatspace.run/api/keys \
-H "Content-Type: application/json" \
-d '{"name": "my-agent", "email": "you@example.com"}'
The response includes api_key — shown once, save it. All subsequent calls use Authorization: Bearer <token>.
Create a request:
curl -X POST https://meatspace.run/api/requests \
-H "Authorization: Bearer $MEATSPACE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_name": "my-agent",
"title": "Ship v2.0 to production?",
"content": "All tests pass. Staging looks good. 2 minor lint warnings.",
"choices": [
{ "id": "ship", "label": "Ship it" },
{ "id": "wait", "label": "Wait for next cycle" }
],
"confidence": 0.7,
"consequence_of_wrong_choice": "Premature ship affects ~50k users"
}'
Response:
{
"success": true,
"data": {
"id": "uuid",
"status": "pending",
"review_url": "https://meatspace.run/review/uuid?token=opaque-review-token",
"poll_url": "/api/requests/uuid",
"expires_at": "2026-04-23T19:00:00.000Z"
}
}
Long-poll for the result:
curl https://meatspace.run/api/requests/{id}/wait?timeout=25000 \
-H "Authorization: Bearer $MEATSPACE_API_KEY"
Returns { status: "completed", selected, selected_label, responded_at } when the human responds, or 202 if still pending.
Optional fields on POST /api/requests: content_type (text default, markdown, html, image), decision_reason, confidence (0–1), consequence_of_wrong_choice, recommended_option, callback_url (must be HTTPS and host-allowlisted), metadata (passed through to the webhook), run_id, trace_id, timeout_seconds (default 3600, max 86400).
MCP
MeatSpace implements MCP over Streamable HTTP at https://meatspace.run/api/mcp. The server exposes three tools:
get_service_status— availability and escalation guidance. No auth.provision_api_key— mint a Bearer token. No auth, rate-limited.ask_human— submit a decision. Requires Bearer auth.
Claude Code config:
{
"mcpServers": {
"meatspace": {
"type": "url",
"url": "https://meatspace.run/api/mcp",
"headers": {
"Authorization": "Bearer <your-api-key>"
}
}
}
}
ask_human long-polls for up to 20 seconds. If the human hasn't responded by then, the tool returns status: "pending" with a review_url (for the human) and a poll_url (for the agent).
Browser SDK
For agents running in browser contexts:
<script type="module">
import { MeatSpace } from 'https://meatspace.run/sdk/meatspace.js';
const ms = new MeatSpace();
await ms.getKey({ name: 'browser-agent', email: 'agent@example.com' });
const result = await ms.ask({
agentName: 'browser-agent',
title: 'Which option?',
choices: [
{ id: 'a', label: 'A' },
{ id: 'b', label: 'B' },
],
});
console.log(result.selected);
</script>
Methods: getKey(), createRequest(), pollResult(), waitForResult(), ask() (create + wait).
Webhooks
If callback_url is set on the request, MeatSpace POSTs the result when the human responds:
{
"event": "request.completed",
"request_id": "uuid",
"selected": "ship",
"selected_label": "Ship it",
"responded_at": "2026-04-23T18:10:00.000Z",
"metadata": {}
}
callback_url must be https:// and the hostname must be explicitly allowlisted by the operator. If no allowlist is configured, request creation rejects callback URLs. Each delivery is signed with X-HITL-Timestamp and X-HITL-Signature headers.
Discovery endpoints
| Path | Format | Purpose |
|---|---|---|
/.well-known/mcp.json |
JSON | MCP server manifest |
/.well-known/agent.json |
JSON | A2A Agent Card |
/api/openapi |
JSON | OpenAPI 3.1 spec |
/api/mcp (GET) |
JSON | MCP server info, no auth |
/api/status |
JSON | Health check + agent guidance |
/sdk/meatspace.js |
JavaScript | Browser SDK |
/llms.txt |
Text | LLM-readable summary |
/llms-full.txt |
Text | Full API documentation |
/agents.md |
Markdown | Full integration guide |
/sitemap.xml |
XML | Sitemap |
/robots.txt |
Text | Crawler directives + discovery pointers |
Errors
All errors return:
{
"success": false,
"error": "Human-readable message",
"code": "machine_readable_code"
}
Common codes: agent_name_required, invalid_choice_count, content_too_large, callback_url_not_allowed, request_create_failed.
Local development
This repo is a Next.js 14 app deployed on Cloudflare Pages.
npm install
npm run dev # local dev at http://localhost:3000
npm run test # integration tests
npm run build:cf # build for Cloudflare Pages
npm run deploy:cf # build and deploy
Supabase is the system of record for keys and requests; Resend handles transactional email.
License
MIT
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。