Skip to content

Sidecar & Integrations

Moneypenny exposes its entire intelligence layer — memory, policy, search, audit, knowledge, and more — as a set of canonical operations. Every operation is available through MCP (Model Context Protocol), the sidecar CLI, and the HTTP ops endpoint. MCP is the recommended integration path: any MCP-compatible client can use Moneypenny’s capabilities through natural language without writing a single line of glue code.

MCP Integration

Moneypenny implements the Model Context Protocol, so it appears as a native tool provider in any MCP-compatible client. Each canonical operation is registered as an MCP tool — when you ask your client to “search memory for rate limits” or “add a policy rule”, the client calls the corresponding Moneypenny tool automatically.

Registering Moneypenny as an MCP Server

The mp setup command auto-registers Moneypenny with your agent runtime. It resolves paths, writes the correct config file, and prints next steps.

Terminal window
mp setup claude-code

Writes .mcp.json in your project root. For global registration across all projects:

Terminal window
mp setup claude-code --global

Restart Claude Code (or run /mcp in the REPL to verify).

Once registered, the client discovers Moneypenny’s tools on startup. You can immediately ask questions like:

  • “Search my memory for everything about rate limits”
  • “Add a policy rule that denies shell access for the research agent”
  • “Show me the audit log for the last deployment”
  • “Ingest this document into knowledge”

The client translates your natural language into the matching MCP tool call, Moneypenny executes the canonical operation, and the result flows back into the conversation.

How MCP Tools Map to Operations

Every MCP tool corresponds 1:1 to a canonical operation. The MCP adapter translates tool names and arguments into the same {"op": "...", "args": {...}} envelope used by the sidecar and HTTP interfaces. This means behaviour is identical regardless of which interface you use — the same policy checks, audit logging, and response envelopes apply everywhere.

MCP ToolCanonical OperationExample Prompt
memory_searchmemory.search”Search memory for deployment failures”
memory_fact_addmemory.fact.add”Remember that staging uses port 8080”
policy_evaluatepolicy.evaluate”Can the research agent call shell_exec?”
audit_queryaudit.query”Show audit entries from the last hour”
knowledge_ingestknowledge.ingest”Ingest the API spec into knowledge”
job_createjob.create”Create a daily sync job at 9am”

The full set of operations is listed in Available Operations below.

Sidecar Interface

The sidecar reads canonical operation requests from stdin and writes results to stdout (JSONL). This makes it straightforward to integrate from any language or runtime that can spawn a subprocess.

Terminal window
echo '{"op":"memory.search","args":{"query":"rate limits","limit":5}}' | mp sidecar

Specifying an Agent

Terminal window
echo '{"op":"memory.fact.add","args":{...}}' | mp sidecar --agent research

Without --agent, the sidecar uses the first configured agent.

Operation Envelope

Every request follows the same structure regardless of interface:

{
"op": "namespace.action",
"args": { ... }
}

Every response follows a standard envelope:

{
"ok": true,
"code": "success",
"message": "Operation completed",
"data": { ... },
"policy": { "effect": "allow", "policy_id": "..." },
"audit": { "recorded": true }
}

Available Operations

Memory

OperationPurpose
memory.searchHybrid search across all stores
memory.fact.addStore a new fact
memory.fact.updateUpdate an existing fact
memory.fact.getRetrieve a fact by ID
memory.fact.compaction.resetReset compaction state
fact.deleteSoft-delete a fact

Knowledge

OperationPurpose
knowledge.ingestIngest a document

Policy

OperationPurpose
policy.addAdd a policy rule
policy.evaluateEvaluate an action against policies
policy.explainExplain why a decision was made

Skills

OperationPurpose
skill.addAdd a skill
skill.promotePromote a skill’s visibility

Jobs

OperationPurpose
job.createCreate a scheduled job
job.listList all jobs
job.runTrigger a job immediately
job.pausePause a job
job.historyView run history
job.spec.planPlan a job (agent-created flow)
job.spec.confirmConfirm a planned job
job.spec.applyApply a confirmed job

JS Tools

OperationPurpose
js.tool.addRegister a JavaScript tool
js.tool.listList JS tools
js.tool.deleteRemove a JS tool

Sessions

OperationPurpose
session.resolveResolve or create a session
session.listList recent sessions

Agents

OperationPurpose
agent.createCreate a new agent
agent.configUpdate agent configuration
agent.deleteDelete an agent

Audit

OperationPurpose
audit.querySearch audit records
audit.appendWrite an audit entry

Ingest (External Events)

OperationPurpose
ingest.eventsIngest external runtime events
ingest.statusCheck ingest run status
ingest.replayReplay a prior ingest run

HTTP Ops Endpoint

The same operations are available over HTTP when the gateway is running:

Terminal window
curl -X POST http://localhost:4821/v1/ops \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-key" \
-d '{"op":"memory.search","args":{"query":"deployment","limit":10}}'

Integration Patterns

Pre-Execution Query (Runtime → Moneypenny)

Before your runtime executes a tool, query Moneypenny for policy clearance and relevant context.

In any MCP client, ask directly:

“Is the main agent allowed to call shell_exec? Also, what do we know about the current deployment status?”

Moneypenny resolves this into a policy.evaluate call followed by a memory.search call and returns both results inline.

Post-Execution Append (Runtime → Moneypenny)

After your runtime completes work, record the outcome in Moneypenny’s memory and audit trail.

In any MCP client:

“Remember that deployment v2.3.1 completed successfully at 14:32 UTC. Also log an audit event for the deploy.”

Moneypenny executes memory.fact.add and audit.append behind the scenes.

Runtime Integrations

Moneypenny integrates with external agent runtimes as the intelligence/data plane — they handle execution, Moneypenny handles memory, policy, audit, and retrieval.

OpenClaw

Ingest OpenClaw event logs for replay and forensics:

Terminal window
mp ingest --openclaw-file run-log.jsonl

Cortex Code CLI

Auto-discover and ingest all Cortex Code conversation history:

Terminal window
mp ingest --cortex

Discovers sessions from ~/.snowflake/cortex/conversations/, converts them to Moneypenny’s event format, and ingests with full dedup. Thinking blocks and system reminders are filtered out.

Claude Code

Auto-discover and ingest all Claude Code conversation history:

Terminal window
mp ingest --claude-code

Or scope to a specific project:

Terminal window
mp ingest --claude-code=my-project-slug

Discovers sessions from ~/.claude/projects/, extracts messages, tool calls, and usage stats. Re-run anytime — already-imported events are skipped.