Skip to main content
Glama
README.md
# M2M Sentinel SDK & MCP Server

Official multi-language client library, **Model Context Protocol (MCP) server**, and **Coinbase AgentKit ActionProvider** for M2M Sentinel — deterministic EVM bytecode capability observations and common-proxy resolution for autonomous applications operating on Base. Callers own transaction policy.

[![npm version](https://img.shields.io/npm/v/m2m-sentinel-sdk.svg)](https://www.npmjs.com/package/m2m-sentinel-sdk)
[![PyPI version](https://img.shields.io/pypi/v/m2m-sentinel.svg)](https://pypi.org/project/m2m-sentinel/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Smithery](https://smithery.ai/badge/m2m-sentinel-sdk)](https://smithery.ai/server/m2m-sentinel-sdk)

---

## ⚡ 1. Model Context Protocol (MCP) Server

Connect M2M Sentinel directly to **Claude Desktop**, **Cursor**, **Windsurf**, or any MCP-compliant LLM agent.

### Option A: 1-Click via Smithery
```bash
npx -y @smithery/cli mcp add M2M-Sentinel/m2m-sentinel-sdk --client claude
```

### Option B: Local Stdio (`claude_desktop_config.json`)
```json
{
  "mcpServers": {
    "m2m-sentinel": {
      "command": "npx",
      "args": ["-y", "m2m-sentinel-sdk"],
      "env": {
        "M2M_SENTINEL_API_KEY": ""
      }
    }
  }
}
```

### Option C: Remote Streamable HTTP
* **Current MCP endpoint**: `https://api.m2msentinel.com/mcp`
* **Legacy HTTP+SSE compatibility**: `https://api.m2msentinel.com/sse` with messages at `https://api.m2msentinel.com/messages`

---

## 🤖 2. Coinbase AgentKit Integration

```typescript
import { AgentKit } from "@coinbase/agentkit";
import { m2mSentinelActionProvider } from "m2m-sentinel-sdk";

const agentKit = await AgentKit.from({
  walletProvider,
  actionProviders: [
    m2mSentinelActionProvider({
      apiKey: process.env.M2M_SENTINEL_API_KEY
    })
  ]
});
```

---

## 📦 3. JavaScript / TypeScript Client

```bash
npm install m2m-sentinel-sdk
```

```javascript
const { M2MSentinelClient } = require('m2m-sentinel-sdk');

const client = new M2MSentinelClient();

async function main() {
  const audit = await client.auditContract('0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913');
  console.log('Proxy Detected:', audit.audit.proxyResolution.isProxy);
  console.log('Proxy Target:', audit.audit.proxyResolution.targetAddress);
  console.log('Capabilities:', audit.audit.verdict.executableCapabilities);
  console.log('Evidence:', audit.audit.dissection.capabilities);
}

main().catch(console.error);
```

---

## 🛡️ Base Account `wallet_sendCalls` Guard

The public SDK includes `guardWalletSendCalls`, a customer-side execution-identity
boundary for Base Account / EIP-5792 batches. It preflights the anchor call and
evaluates its caller policy before scheduling any remaining call, then pins
remaining calls to the first trusted block identity in waves of at most four.
Each settled wave is validated and policy-checked in ascending request-index
order before a later wave starts; a failure or rejection stops later scheduling.
The original detached request is forwarded only after all checks pass. It does
not sign, broadcast, custody funds, infer inner UserOperation semantics, or
make a safety claim. See `examples/base_account_paymaster_guard.js` for a no-network fixture.

---

## 🐍 4. Python Client

```bash
pip install m2m-sentinel
```

```python
from m2m_sentinel import M2MSentinelClient

client = M2MSentinelClient()
audit = client.audit_contract("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")
print("Proxy detected:", audit["audit"]["proxyResolution"]["isProxy"])
print("Proxy target:", audit["audit"]["proxyResolution"].get("targetAddress"))
print("Capabilities:", audit["audit"]["verdict"]["executableCapabilities"])
print("Evidence:", audit["audit"]["dissection"]["capabilities"])
```

---

## Transaction-specific preflight example

The public repository includes a standalone, mock-only transaction boundary
example at [`examples/transaction_preflight.js`](examples/transaction_preflight.js).
From this repository root, run:

```bash
node examples/transaction_preflight.js
```

It observes one caller-supplied Base transaction, passes the observation to a
caller-owned policy, and reaches only a mock signing/send callback. It refuses
to continue on unverified evidence, unresolved execution, an observation
mismatch, or a missing Diamond selector mapping. It never signs or sends a
transaction; optional live mode uses only a caller-supplied API-key header and
remains the caller's responsibility.

---

## 💳 5. Autonomous x402 Micropayments (Headless M2M)

```typescript
import { x402SignerClient } from "m2m-sentinel-sdk";

const client = new x402SignerClient({
  walletSigner: myAgentWallet,
  baseUrl: "https://api.m2msentinel.com"
});

const result = await client.request("/v1/audit/0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913");
```

---

## 📜 License
MIT License. Copyright (c) 2026 M2M Sentinel.

TDQS

C2.7/5.0

Scored across 12 tools

Disambiguation2/5

The core m2m_ tools are distinct, but six aliases duplicate half the surface, and get_capability_score overlaps with m2m_audit_contract, making selection ambiguous. An agent could easily be unsure whether to call the m2m_ version or its alias, or whether capability_score replaces audit.

Naming Consistency3/5

The primary m2m_get_* pattern is consistent and readable, but the aliases break it with names like get_gas_fees, get_dex_metrics, and audit_contract. The mixed prefixed and non-prefixed naming is still understandable but lacks a single predictable convention.

Tool Count4/5

Twelve tools is within an acceptable range, but six of them are aliases, leaving only seven unique operations. The count feels slightly inflated by redundancy rather than genuinely well-scoped.

Completeness4/5

The tool set covers the core Sentinel domains: contract audit observations, gas, price, DEX liquidity, whale signals, and service status. Minor gaps exist, such as batch or historical variants, but the primary monitoring and audit surface is reasonably complete.

Maintenance

ActivityMaintained
ResponsivenessNo issues