forge-sandbox
Forge Sandbox
假数据,真实模式。
一个本地、无需密钥的 Forge 工业遥测内核模拟。在笔记本电脑上运行它,针对它构建你的代理集成,然后将相同的代码指向生产环境的 Forge 以连接真实设备。
无需 API 密钥。无需账户。无需注册。不持久化任何内容。该应用不发起任何出站调用。
docker run -p 8000:8000 ghcr.io/foundrynet/forge-sandbox多架构:linux/amd64 和 linux/arm64。如果你不想跟踪 latest,请使用 ghcr.io/foundrynet/forge-sandbox:1.0.0 固定版本。
端口 8000 已被占用?docker run -p 8099:8000 ...,或使用 compose:FORGE_SANDBOX_PORT=8099 docker compose up。
curl -X POST http://localhost:8000/v1/normalize \
-H "Content-Type: application/json" \
-d '{"oem": "haas", "data": {"S SPEED (RPM)": 8500, "SP_LOAD_PCT (%)": 84.7, "COOL_TEMP [°F]": 161.8}}'{
"normalized": {
"spindle_speed_rpm": 8500,
"spindle_load_pct": 84.7,
"sensor_readings.coolant_temp": 72.1111
},
"coverage_pct": 100.0,
"fields_total": 3,
"fields_distinct_canonical": 3,
"unit_conversions": [
{"raw_field": "COOL_TEMP [°F]", "canonical_field": "sensor_readings.coolant_temp",
"from": "f", "to": "c", "conversion": "fahrenheit_to_celsius",
"raw_value": 161.8, "converted_value": 72.1111}
],
"oem": "haas",
"vertical": "cnc",
"simulated": true
}这个沙箱的用途
来自 N 家制造商的工业设备以 N 种不兼容的格式产生遥测数据。主轴转速在 Haas 上是 S SPEED (RPM),在 SINUMERIK 上是 Nist_Spindle (RPM),在 FANUC 上是 ACT_SP_SPEED_1/min。你的代理不应该需要学习全部三种。
Forge 将其中任何一种转换为一个规范词汇表。沙箱让你在拥有设备、凭据或预算之前,就能针对该词汇表进行构建。
沙箱 | 生产环境 | |
数据 | 模拟的 | 你的真实机器 |
规范模式 | 真实 | 真实 |
供应商标签映射 | 1,515(公开来源) | 16,908 条精选 |
未解析的标签 | 信号分类器 | + 嵌入、+ LLM 研究、+ 自愈 |
预测 | 最小二乘 | TimesFM(2 亿参数) |
认证 | 无 | API 密钥 |
持久化 | 无 | 历史、身份、触发器、护栏 |
成本 | 免费 |
响应形状完全相同。 这就是契约。针对沙箱构建,更改基础 URL,添加 Authorization: Bearer 头,你的客户端代码无需更改。
Related MCP server: operational-data-mcp
五分钟
沙箱附带五台模拟机器。每台都发出其真实的供应商标签名称——你在线上遇到的实际拼写。
# 1. See what's here
curl -s localhost:8000/v1/machines | jq '.machines[].description'
# 2. Pull a raw reading — vendor tags, unnormalized
curl -s localhost:8000/v1/simulate/siemens | jq .data{
"Betriebszustand": "AUTOMATIK",
"PROGRAMM": "WELLE_STUFE3.MPF",
"Nist_Spindle (RPM)": 1203,
"SPINDEL_AUSLASTUNG (%)": 62.4,
"Kuehlmittel Temp (C)": 30.6,
"STUECKZAHL (pcs)": 842,
"Betriebsstunden": 14203.5
}你的代理无法猜测 STUECKZAHL 是零件数量,Betriebsstunden 是运行小时数。它不需要:
# 3. Normalize it
curl -s localhost:8000/v1/simulate/siemens \
| jq '{oem, data}' \
| curl -s -X POST localhost:8000/v1/normalize -H 'Content-Type: application/json' -d @- \
| jq .normalized{
"execution_state": "AUTOMATIK",
"program_name": "WELLE_STUFE3.MPF",
"spindle_speed_rpm": 1203,
"spindle_load_pct": 62.4,
"sensor_readings.coolant_temp": 30.6,
"part_count": 842,
"operating_hours": 14203.5
}# 4. Forecast — grab a series, ask whether it breaches
curl -s 'localhost:8000/v1/simulate/fanuc/series?field=MOTOR_TEMP&points=48' > /tmp/s.json
jq '{time_series: .values, threshold: 75.0, canonical_field: .canonical_field}' /tmp/s.json \
| curl -s -X POST localhost:8000/v1/predict_breach -H 'Content-Type: application/json' -d @- \
| jq '{will_breach, estimated_steps_to_breach, confidence, breach_window}'五台机器
键 | 设备 | 协议 | 标签风格 |
| Haas VF-2SS 加工中心 | MTConnect |
|
| FANUC R-30iB 六轴机器人 | FOCAS |
|
| SINUMERIK 840D sl / S7-1500 | PROFINET |
|
| Prusa MK3S+ 3D 打印机 | Marlin 串行 |
|
| Carrier 48TC 屋顶 HVAC | BACnet/IP |
|
向任何模拟调用添加 ?seed=N 以使其可重复。
端点
端点 | 功能 |
| 原始供应商遥测 → 规范字段(JSON 或 |
| 序列是否会跨越阈值,以及何时 |
| 车队汇总、风险分布、维护队列 |
| 每台机器的预测,无汇总 |
| 可以规范化什么;传递 |
| 规范字典:名称、类型、单位、垂直领域 |
| 五台模拟机器 |
| 一条原始读数 |
| 一个原始标签的历史记录 |
| 存活检查(GET 和 HEAD) |
| MCP 服务器,Streamable HTTP |
| OpenAPI 浏览器 |
生产环境中存在但需要持久状态(/v1/history、/v1/identify、/v1/guardrails、/v1/triggers、/v1/attest、/v1/billing/usage)的端点返回 501 并附原因,而不是裸 404,这样你可以区分“不在沙箱中”和“你拼错了”。
MCP
沙箱也是一个 MCP 服务器。将 Claude Desktop、Claude Code 或任何 MCP 客户端指向 http://localhost:8000/mcp。
{
"mcpServers": {
"forge-sandbox": {
"type": "http",
"url": "http://localhost:8000/mcp"
}
}
}Claude Code:
claude mcp add --scope user --transport http forge-sandbox http://localhost:8000/mcp--scope user 很重要。没有它,claude mcp add 会将服务器注册为当前目录的本地,因此它只在那里解析,其他地方都不行——从你实际想要使用它的项目运行 claude mcp get forge-sandbox,你会得到 "No MCP server named forge-sandbox"。用户范围使其在所有地方都可用。要将其移除:
claude mcp remove forge-sandbox -s user八个工具。生产环境中存在的五个工具携带生产环境的工具描述原文,因为描述是你的代理推理的接口——如果它在这里读起来不同,你针对沙箱调整的提示行为将不会延续。
工具 | |
| 生产环境 |
| 生产环境 |
| 生产环境 |
| 生产环境 |
| 生产环境 |
| 仅沙箱 |
| 仅沙箱 |
| 仅沙箱 |
每个工具描述都以 SANDBOX: 注释结尾,因此读取工具列表的代理在采取任何行动之前会被告知数据是模拟的。
生产环境的 Forge 在 https://mcp.foundrynet.io/mcp 暴露 32 个工具。其他 24 个需要持久身份、历史、护栏、触发器、计费或链上证明。
这里的解析实际如何工作
生产环境通过五层解析标签。沙箱提供不需要模型权重、网络或专有数据的三层。
层 | 匹配类型 | 置信度 | 它是什么 |
1 |
| 1.00 | 映射包中的精确供应商标签 |
1b |
| 0.95 | 同一行,一旦大小写/标点/单位后缀被折叠 |
1c |
| 0.60 | 另一个供应商的包知道它——报告,而非隐藏 |
2 |
| 1.00 | 标签已经是规范字段名称 |
3 |
| 0.55–0.72 | 确定性主题+数量分类器 |
— |
| 0.00 | 诚实的未命中 |
解析为空的标签在输出中保留其原始名称和值。不会静默丢弃任何内容,也不计入覆盖率。
coverage_pct 是不同的规范字段 ÷ 总标签数。一个数量的十种拼写算作一个字段,而不是十个。(生产环境恰好有这个 bug,并在未播种的语料库上报告了 100% 的覆盖率。)
沙箱从不发明规范名称。它发出的每个名称都来自附带的字典,分类器的目标在启动时针对该字典进行验证——拼写错误会导致容器失败,而不是发布一个看起来合理的错误字段。
此镜像中不包含的内容
有意为之,并明确说明,以免这里任何东西被误认为真实事物:
生产映射语料库。 16,908 条精选映射,带有置信度分数和来源。沙箱仅附带 1,515 条从已公开来源汇编的映射:MIT 许可的规范模式(haas、fanuc、siemens、octoprint)、附带的 BACnet/IP 垂直包以及 Carrier i-Vu 对象名称,以及任何 Prusa 通过串行发出的 Marlin M105/M114 字段名称。
tools/build_packs.py显示了每一行的确切来源。嵌入层。 生产环境嵌入未识别的标签并通过相似性匹配。这里没有模型权重。
LLM 字段研究。 生产环境将真正新颖的标签发送给模型,缓存答案,在 5 次使用时确认,并在 10 次时打包。这里没有。
物理验证器和读取时验证器。 变化率、传感器卡住、丢失、操作模式、相关性、置信度衰减。这里没有。
TimesFM。 生产环境使用 2 亿参数的时间序列基础模型进行预测。沙箱使用最小二乘和残差缩放的分位数带。每个预测都标记为
"model": "sandbox-ols-v1"和"simulated": true。持久化、身份、历史、触发器、护栏、计费、证明。 全部有状态,全部在服务器端。
与生产环境的任何连接。 该应用不导入 HTTP 客户端或套接字 API,因此不发起出站调用——
grep -rE "httpx|requests|urllib|socket" app/返回空。docker-compose.yml还以read_only运行它,并丢弃所有能力。请注意,这加固了文件系统,而不是网络:Docker 的默认桥接仍然允许出站,因此如果你需要强制执行而不是仅仅声称,请在internal网络上运行。
每个响应都携带 "simulated": true 和 X-Forge-Sandbox: true 头。如果你在真实端点上看到这些,说明路由错误。
沙箱比生产环境做得更好的两件事
两者都是已知的生产问题,在这里修复,因为教你错误形状的沙箱比没有沙箱更糟糕。
PWM 比例已声明。 Marlin 的
@:加热器字段是一个 0–127 占空比字节,而不是百分比。生产环境的语料库为其发出unit: null,因此读数95被解释为“95%,接近最大”,而实际上大约是 75%。沙箱声明unit: "pwm_0_127"。空单位从字段名称回填。 已发布的语料库仅为 366 个字段中的 58 个声明了单位。在字段名称声明单位(
_temperature_c、_pressure_bar、_rpm)的地方,沙箱会填充它并标记为unit_source: "sandbox_inferred_from_name"。
本地开发
docker compose up --build # build and run your local changes
docker build --target test . # run the suite inside the shipping image不使用 Docker:
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements-dev.txt
python -m pytest tests/ -q
uvicorn app.main:app --reload --port 8000从源代码重新生成映射包(需要检出 canonical-schema 仓库):
python3 tools/build_packs.pyforge-sandbox/
app/
main.py FastAPI surface — the production response envelopes
corpus.py tag → canonical resolution, unit conversion, collisions
simulate.py the five machines
predict.py deterministic forecasting, production's response contract
mcp_tools.py MCP server, production tool descriptions
packs/ generated mapping packs + the canonical dictionary
tools/
build_packs.py regenerates packs from the public sources
tests/
test_sandbox.py升级到生产环境
两个更改:
- BASE_URL = "http://localhost:8000"
- headers = {}
+ BASE_URL = "https://forge.foundrynet.io"
+ headers = {"Authorization": f"Bearer {FORGE_API_KEY}"}对于 MCP,将 http://localhost:8000/mcp 替换为 https://mcp.foundrynet.io/mcp。
底层变化:
沙箱报告为
unknown的标签由嵌入层、LLM 研究路径或垂直包解析。预测来自 TimesFM 而不是直线。
读数持久化,因此历史、触发器和护栏开始工作。
/v1/identify发出持久的机器身份。预测可以被证明。
获取密钥:foundrynet.io
Sandbox: fake data, real schema
Production: real data, real schema, real predictions
Upgrade: foundrynet.io许可证
MIT。映射包派生自 MIT 许可的
FoundryNet canonical schema;
tools/build_packs.py 记录了每个包的出处。
Forge 由 Foundry Labs 出品 · forge@foundrynet.io
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA local MCP server that breaks on demand, allowing you to test your client against auth failures, disappearing tools, flaky responses, and token expiry from a web UI.4210MIT
- AlicenseAqualityCmaintenanceMCP server that unifies real-time telemetry from industrial systems into a single queryable interface, enabling production visibility, anomaly detection, and operational insights.510MIT
- AlicenseAqualityBmaintenanceExposes live industrial IoT telemetry to any MCP client, streaming simulated sensor data from a fleet of machines and detecting anomalies, with the ability to inject faults on demand.4MIT
- AlicenseBqualityBmaintenanceEnables bounded, deterministic triage verdicts for server health, fleet status, and timeline investigation through a simulated execution-boundary MCP server.35MIT
Related MCP Connectors
Hosted MCP endpoint with realistic fake data for prototyping agents. 12 tools, no setup.
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
MCP server exposing Kettle Logic insight articles & industry guidance as tools + resources.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/FoundryNet/forge-sandbox'
If you have feedback or need assistance with the MCP directory API, please join our Discord server