openclaw - 💡(How to fix) Fix Add opt-in message-level signing for mcporter stdio transport [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#49010Fetched 2026-04-08 00:49:48
View on GitHub
Comments
1
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
commented ×1mentioned ×1subscribed ×1

Code Example

const { signMessage, verifyMessage } = require('mcp-secure');
// Wrap outgoing: signMessage(msg, passportId, privateKey)
// Verify incoming: verifyMessage(envelope, publicKey)
RAW_BUFFERClick to expand / collapse

cc @leondz

OpenClaw's mcporter provides a clean stdio transport for MCP servers. Currently, messages pass through unsigned -- which is fine for local development but becomes a risk in production deployments where:

  • Multiple agents share MCP server pools
  • Tool calls cross trust boundaries
  • Replay attacks can trigger duplicate operations (especially financial/state-changing tools)

Proposal: Add opt-in MCPS (MCP Secure) signing to mcporter.

With mcp-secure (zero deps, npm), each JSON-RPC message gets:

  • ECDSA P-256 signature
  • Nonce + timestamp (replay protection)
  • Passport ID (agent identity)

Example integration:

const { signMessage, verifyMessage } = require('mcp-secure');
// Wrap outgoing: signMessage(msg, passportId, privateKey)
// Verify incoming: verifyMessage(envelope, publicKey)

This is opt-in -- unsigned messages continue to work normally. Only agents/servers that opt in get the security layer.

IETF Internet-Draft: draft-sharif-mcps-secure-mcp

I would be happy to send a PR if there's interest.

extent analysis

Fix Plan

To add opt-in MCPS (MCP Secure) signing to mcporter, follow these steps:

  • Install the mcp-secure package: npm install mcp-secure
  • Import the signMessage and verifyMessage functions from mcp-secure
  • Wrap outgoing messages with signMessage(msg, passportId, privateKey)
  • Verify incoming messages with verifyMessage(envelope, publicKey)

Example code:

const { signMessage, verifyMessage } = require('mcp-secure');

// Outgoing message
const msg = { /* JSON-RPC message */ };
const passportId = 'agent-id';
const privateKey = 'private-key';
const signedMsg = signMessage(msg, passportId, privateKey);
// Send signedMsg

// Incoming message
const envelope = { /* incoming message envelope */ };
const publicKey = 'public-key';
const isValid = verifyMessage(envelope, publicKey);
if (isValid) {
  // Message is valid, process it
} else {
  // Message is invalid, reject it
}

Verification

To verify that the fix worked, test the following scenarios:

  • Send a signed message from an agent to the MCP server and verify that it is processed correctly
  • Send an unsigned message from an agent to the MCP server and verify that it is still processed correctly (since the security layer is opt-in)
  • Attempt to replay a signed message and verify that it is rejected by the MCP server

Extra Tips

  • Make sure to handle errors and exceptions properly when signing and verifying messages
  • Consider implementing a mechanism to rotate private keys and update public keys in case of a security breach
  • Refer to the IETF Internet-Draft draft-sharif-mcps-secure-mcp for more information on the MCPS protocol.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Add opt-in message-level signing for mcporter stdio transport [1 comments, 1 participants]