MCP server/monitoring

Maple MCP Server

Unified MCP server for agent observability, safety control, and behavior evolution.

alnosarus/copymaple ↗by alnosarusupdated
Manual setup required. The maintainer's config contains paths only you know - edit the placeholders below before adding it to Claude Code.
1

Prepare the server locally

Run this once before adding it to Claude Code.

npm install
npm run dev
2

Register it in Claude Code

claude mcp add maple-9573 -- node /path/to/maple/index.js

Replace any placeholder paths in the command with the real path on your machine.

3

Make your agent remember this setup

maple-9573's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.

npx conare@latest

Free · one command · indexes the sessions already on disk. Set up in the browser instead →

What it does

  • Real-time observability and timeline rendering for agent sessions
  • Risk-based guardrails with allow/block/quarantine capabilities
  • ML-driven anomaly detection using hash embeddings and cosine similarity
  • Ability to fork and replay agent branches for safety testing
  • Community-driven skill evolution through anonymized trace sharing

Tools 9

observe_sessionCapture and render timeline widget for an agent session.
replay_forkBranch from any step and simulate forward.
audit_riskRule and anomaly risk dashboard.
guard_actionAllow, block, or pending action with quarantine support.
ingest_session_eventStream external bridge events into active trace.
ml_anomaly_reportEmbedding-based behavior outlier detection.
share_trace_anonAnonymize and publish trace patterns to shared pool.
suggest_evolved_skillsGenerate evolved skill suggestions from shared traces.
yc_app_briefGenerate a live YC-ready narrative from product metrics.

Environment Variables

MAPLE_API_KEYAPI key for Maple authentication
DEMO_OPEN_BROWSERSet to 0 to disable auto-opening browser during demo

Try it

Audit the current agent session for any high-risk actions.
Fork the current session from the last step to simulate a different outcome.
Generate an anomaly report for the recent agent behavior.
Provide a YC-ready narrative brief based on our current traction metrics.
Share the current trace anonymously to the community pool.
Original README from alnosarus/copymaple

Maple

Unified MCP server for agent observability, safety control, and behavior evolution.

Maple is the "Sentry + Git" layer for high-agency agents:

  • Observe every step
  • Replay/fork risky branches
  • Audit and intervene with guardrails
  • Learn from anonymized traces to evolve safer skills

Built with mcp-use + Apps SDK widgets.

What Is Implemented

1) Observability + Control

  • observe_session: capture and render timeline widget
  • replay_fork: branch from any step and simulate forward
  • audit_risk: rule + anomaly risk dashboard
  • guard_action: allow/block/pending with quarantine support
  • ingest_session_event: stream external bridge events into active trace

2) ML Anomaly Detection (Simple Embeddings)

  • ml_anomaly_report: embedding-based behavior outlier detection
  • Lightweight hash embeddings + cosine similarity baseline
  • Supports community baseline from anonymized shared traces

3) Network Effects

  • share_trace_anon: anonymize and publish trace patterns to shared pool
  • suggest_evolved_skills: generate evolved skill suggestions from shared traces
  • Behavior signatures + shared dataset create compound data advantage

4) YC App Layer (Moat / Traction / Revenue)

  • yc_app_brief: live YC-ready narrative generated from product metrics
  • Emphasizes:
    • Moat: trace + fork + risk label data flywheel
    • Traction: OpenClaw integration and safety intervention activity
    • Revenue: freemium ladder (Free, Pro $9, Team $29, Enterprise $99)

MCP Tools

  • observe_session
  • replay_fork
  • audit_risk
  • ml_anomaly_report
  • guard_action
  • ingest_session_event
  • share_trace_anon
  • suggest_evolved_skills
  • yc_app_brief
  • list_traces
  • export_trace

API Endpoints

  • GET /health
  • GET /judge (judge standalone page)
  • GET /api/traces
  • GET /api/traces/:traceId
  • GET /api/community/stats
  • GET /api/community/traces
  • GET /api/yc/brief?focus=full|moat|traction|revenue
  • GET /api/firewall/state
  • POST /api/firewall/chat
  • POST /api/firewall/decision (strict pre-execution allow/block gate)

Key Project Files

  • index.ts: tool + route orchestration
  • src/core/risk-engine.ts: rule engine + embedding anomaly integration
  • src/ml/embeddings.ts: simple embedding implementation
  • src/ml/anomaly-detector.ts: cosine-sim anomaly detection
  • src/network/anonymizer.ts: anonymized trace transformation
  • src/network/shared-trace-store.ts: community pool + skill suggestions
  • src/strategy/yc-narrative.ts: moat/traction/revenue narrative builder
  • resources/trace-timeline/widget.tsx
  • resources/replay-simulator/widget.tsx
  • resources/risk-dashboard/widget.tsx

Quick Start

npm install
npm run dev

Inspector: http://localhost:3000/inspector

Hardcoded Demo Stack (OpenClaw + Maple)

This repo now includes a one-command hardcoded demo setup:

  • OpenClaw gateway on ws://127.0.0.1:19001
  • OpenClaw bridge adapter on http://127.0.0.1:8787
  • Maple API key generated at startup (or provided via env)
  • Bridge token generated at startup (or provided via env)
OPENCLAW_VERSION= npm run demo:install-openclaw
npm run demo:up

Then open:

  • Judge GUI: http://localhost:3000/judge
  • Inspector: http://localhost:3000/inspector

Guided Demo Mode (No Manual JSON)

The Judge GUI now has Guided Demo Controls so you can run the full flow without Inspector copy/paste:

  1. Enter API key and click Connect
  2. Click Run Full Flow

Or step through:

  1. 1) Start
  2. 2) Audit
  3. 3) Block
  4. 4) Fork

Judge page now includes Firewall Chat in Control view:

  • Ask natural-language questions ("status update", "why blocked?", "what should we do next?")
  • Chat replies are generated from live firewall context (/api/firewall/state)

This uses internal demo APIs:

  • POST /api/demo/start
  • POST /api/demo/audit
  • POST /api/demo/block
  • POST /api/demo/fork
  • POST /api/demo/full

demo:up also auto-opens both pages on macOS (set DEMO_OPEN_BROWSER=0 to disable).

Single-Trace Agent Action Logging (Hackathon)

For a reliable judge demo, run one stable trace and append every action to it.

MAPLE_API_KEY=local-demo-key npm run trace:demo

What this does:

  • Starts (or reuses) one trace for a stable sessionId
  • Logs all agent actions through POST /api/openclaw/events using the same traceId
  • Includes type, actor, prompt/message, command, url, toolName, and unique eventId
  • Runs a preflight firewall preview and logs Maple's block/allow message into the same trace

Open 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.mjs
  • logAction(...) for generic events
  • logWebGet(...), logMarketplaceSearch(...), logMarketplaceToolCall(...) wrappers

Example:

import { createMapleTraceLogger } from "./scripts/maple-trace-logger.mjs";

Frequently Asked Questions

What are the key features of Maple?

Real-time observability and timeline rendering for agent sessions. Risk-based guardrails with allow/block/quarantine capabilities. ML-driven anomaly detection using hash embeddings and cosine similarity. Ability to fork and replay agent branches for safety testing. Community-driven skill evolution through anonymized trace sharing.

What can I use Maple for?

Monitoring high-agency AI agents to prevent unauthorized or risky actions. Debugging complex agent failures by replaying and forking specific execution branches. Generating data-driven narratives for startup traction and moat analysis. Improving agent safety by learning from shared community trace patterns.

How do I install Maple?

Install Maple by running: npm install && npm run dev

What MCP clients work with Maple?

Maple works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Conare · memory for coding agents

Turn this server into reusable context

Keep Maple docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Set up free$npx conare@latest