loading…
Search for a command to run...
loading…
Maple is a unified MCP server for agent observability, safety control, and behavior evolution, acting as a monitoring and auditing layer for high-agency agents.
Maple is a unified MCP server for agent observability, safety control, and behavior evolution, acting as a monitoring and auditing layer for high-agency agents. It enables developers to capture session timelines, replay risky branches, detect anomalies using ML, and enforce action guardrails.
Unified MCP server for agent observability, safety control, and behavior evolution.
Maple is the "Sentry + Git" layer for high-agency agents:
Built with mcp-use + Apps SDK widgets.
observe_session: capture and render timeline widgetreplay_fork: branch from any step and simulate forwardaudit_risk: rule + anomaly risk dashboardguard_action: allow/block/pending with quarantine supportingest_session_event: stream external bridge events into active traceml_anomaly_report: embedding-based behavior outlier detectionshare_trace_anon: anonymize and publish trace patterns to shared poolsuggest_evolved_skills: generate evolved skill suggestions from shared tracesyc_app_brief: live YC-ready narrative generated from product metricsobserve_sessionreplay_forkaudit_riskml_anomaly_reportguard_actioningest_session_eventshare_trace_anonsuggest_evolved_skillsyc_app_brieflist_tracesexport_traceGET /healthGET /judge (judge standalone page)GET /api/tracesGET /api/traces/:traceIdGET /api/community/statsGET /api/community/tracesGET /api/yc/brief?focus=full|moat|traction|revenueGET /api/firewall/statePOST /api/firewall/chatPOST /api/firewall/decision (strict pre-execution allow/block gate)index.ts: tool + route orchestrationsrc/core/risk-engine.ts: rule engine + embedding anomaly integrationsrc/ml/embeddings.ts: simple embedding implementationsrc/ml/anomaly-detector.ts: cosine-sim anomaly detectionsrc/network/anonymizer.ts: anonymized trace transformationsrc/network/shared-trace-store.ts: community pool + skill suggestionssrc/strategy/yc-narrative.ts: moat/traction/revenue narrative builderresources/trace-timeline/widget.tsxresources/replay-simulator/widget.tsxresources/risk-dashboard/widget.tsxnpm install
npm run dev
Inspector: http://localhost:3000/inspector
This repo now includes a one-command hardcoded demo setup:
ws://127.0.0.1:19001http://127.0.0.1:8787OPENCLAW_VERSION=<pin-a-version> npm run demo:install-openclaw
npm run demo:up
Then open:
http://localhost:3000/judgehttp://localhost:3000/inspectorThe Judge GUI now has Guided Demo Controls so you can run the full flow without Inspector copy/paste:
/judge and wait for auto-connectRun Full FlowOr step through:
1) Start2) Audit3) Block4) ForkJudge page now includes Firewall Chat in Control view:
/api/firewall/state)This uses internal demo APIs:
POST /api/demo/startPOST /api/demo/auditPOST /api/demo/blockPOST /api/demo/forkPOST /api/demo/fulldemo:up also auto-opens both pages on macOS (set DEMO_OPEN_BROWSER=0 to disable).
For a reliable judge demo, run one stable trace and append every action to it.
npm run trace:demo
What this does:
sessionIdPOST /api/openclaw/events using the same traceIdtype, actor, prompt/message, command, url, toolName, and unique eventIdOpen http://localhost:3000/judge, then select the printed trace ID to see #0, #1, #2....
If you want to integrate this into your own runtime, use:
scripts/maple-trace-logger.mjslogAction(...) for generic eventslogWebGet(...), logMarketplaceSearch(...), logMarketplaceToolCall(...) wrappersExample:
import { createMapleTraceLogger } from "./scripts/maple-trace-logger.mjs";
const logger = createMapleTraceLogger({
baseUrl: "http://localhost:3000",
sessionId: "maple-live",
});
await logger.startRun({ reuseLatest: true });
await logger.logAction({
type: "tool_call",
actor: "agent",
toolName: "web_get",
prompt: "Fetch provider docs",
url: "https://docs.mcp.so/providers",
});
Canonical startup (local + Railway) for single-source hackathon routing:
npm start
Equivalent local alias:
npm run hackathon:up
This starts a local downstream MCP app (toolhub) and route-locks Maple so all downstream calls go through it.
Marketplace mode is canonically disabled in this build; execution only routes through cleared downstream apps.
Included tools (diverse coverage):
web_search (general web search)web_fetch (browser-style page fetch/extraction)wikipedia_summary (encyclopedia knowledge)github_repo_info (code/repo intelligence)weather_forecast (real-time practical data)slack_post_message (messaging integration via Slack)hn_search (live tech/news discovery on Hacker News)arxiv_search (academic/research paper search)openlibrary_search (books and publication lookup)Slack config for slack_post_message:
SLACK_WEBHOOK_URLSLACK_BOT_TOKEN and optionally SLACK_DEFAULT_CHANNELVerify wiring end-to-end:
npm run hackathon:verify
Stop services:
npm run hackathon:down
Implementation files:
scripts/hackathon-toolhub.mjs (downstream MCP server with 9 tools)scripts/hackathon-up.sh (starts toolhub + Maple in deterministic route-lock mode)scripts/hackathon-verify.sh (smoke tests for routed tool calls through Maple)scripts/hackathon-down.sh (stops Maple + toolhub)Stop local demo processes:
npm run demo:down
MCP_URL=http://localhost:3000
OPENCLAW_BRIDGE_URL=http://localhost:8787
OPENCLAW_BRIDGE_TOKEN=your_token
MAPLE_ALLOW_NO_AUTH=true
MAPLE_LOCK_BRIDGE_TARGET=true
observe_session falls back to mock only when source=auto.
For source=openclaw, bridge failures are returned as errors (no silent mock downgrade).
/mcp, /sse) and internal APIs (/api/*) do not require API keys or login.GET /health remains public for deployment health checks.MAPLE_LOCK_BRIDGE_TARGET=true to deny per-request bridgeUrl / token overrides.MAPLE_ALLOW_BRIDGE_OVERRIDE=true.OPENCLAW_BRIDGE_URL and OPENCLAW_BRIDGE_TOKEN must be explicitly set.OPENCLAW_BRIDGE_URL + OPENCLAW_BRIDGE_TOKEN.403 Bridge override denied.POST /api/firewall/decision evaluates a candidate action before execution.enforce=true (default): persist decision into trace and quarantine on deny.enforce=false: preview mode (no trace mutation), useful for dry-run checks.GET /api/firewall/state returns normalized live firewall context for a trace/session.POST /api/firewall/chat answers status questions using that context.message, optional traceId / sessionId, and includeContext.POST /api/chat/stream powers the Judge UI chatbot and can use AI with provider fallback.OPENAI_API_KEY and/or ANTHROPIC_API_KEY are set, Maple enables AI mode with automatic fallback.Optional chat model environment variables:
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
MAPLE_FIREWALL_CHAT_PRIMARY=openai # openai | anthropic
MAPLE_FIREWALL_CHAT_OPENAI_MODEL=gpt-4o-mini
MAPLE_FIREWALL_CHAT_ANTHROPIC_MODEL=claude-sonnet-4-6
MAPLE_FIREWALL_CHAT_TIMEOUT_MS=15000
Maple now enforces deterministic firewall policy checks on every trace step before risk scoring:
pipe-to-shell, destructive commands, credential/secret access)[REDACTED BY MAPLE]guardStatus=block) when deny rules hit~/.maple/firewall-logs/YYYY-MM-DD.jsonlOptional environment variables:
MAPLE_FIREWALL_ENABLED=true
MAPLE_FIREWALL_DEFAULT_ACTION=allow # allow | deny | log_only
MAPLE_FIREWALL_LOG_DIR=~/.maple/firewall-logs
observe_session on an OpenClaw sessionaudit_risk to surface risky stepsml_anomaly_report to show embedding anomaliesguard_action block a risky stepreplay_fork from blocked step with safe editsshare_trace_anon to publish anonymized patternsuggest_evolved_skills from community datayc_app_brief to show moat/traction/revenue narrative{
"tool": "ml_anomaly_report",
"input": {
"traceId": "<trace-id>",
"useCommunityBaseline": true,
"threshold": 0.58,
"topAnomalies": 5
}
}
{
"tool": "share_trace_anon",
"input": {
"traceId": "<trace-id>",
"taskLabel": "Inbox triage",
"objective": "Safely automate inbound support triage",
"tags": ["support", "email", "guarded"]
}
}
{
"tool": "suggest_evolved_skills",
"input": {
"query": "safe inbox triage automation",
"limit": 3,
"minConfidence": 0.4
}
}
npm run deploy
Yes, Maple can run on Railway with production safeguards.
This repo now includes railway.json, so Railway can use canonical settings automatically:
npm run buildnpm run start/healthRequired environment variables:
NODE_ENV=production
HOST=0.0.0.0
MCP_URL=https://<your-railway-domain>
MAPLE_ALLOW_NO_AUTH=true
MAPLE_LOCK_BRIDGE_TARGET=true
OPENCLAW_BRIDGE_URL=<bridge-url-reachable-from-railway>
OPENCLAW_BRIDGE_TOKEN=<bridge-token>
MAPLE_FIREWALL_ENABLED=true
Important notes:
PORT automatically; do not hardcode it.scripts/hackathon-start.sh is Railway-safe and no longer requires a local .env file to boot.localhost for OPENCLAW_BRIDGE_URL unless the bridge runs in the same container.source=mock to keep UI + guardrail flow live.Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"maple": {
"command": "npx",
"args": []
}
}
}