Sentinel Wallet
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
The Problem
AI agents are increasingly capable of executing financial operations — but giving an LLM unrestricted access to a crypto wallet is a recipe for disaster. One hallucination, one prompt injection, or one adversarial input could drain an entire portfolio.
Related MCP server: mindcore-mcp
The Solution
Sentinel is a policy-governed MCP (Model Context Protocol) wallet that lets AI agents execute DeFi trades safely. Every action the agent takes passes through a deterministic policy engine that enforces hard limits — max trade sizes, allowed DEXes, permitted assets, and slippage caps — before any balance is modified.
Swaps execute instantly off-chain via Yellow Network / Nitrolite state channels during the session, and settle once on-chain when the session closes — combining the UX of a CEX with the security of a smart contract wallet.
┌──────────────┐ MCP Protocol ┌─────────────────────────────────────────────┐
│ │◄────────────────────► │ Sentinel │
│ AI Agent │ 4 tools via stdio │ │
│ (Claude, │ │ ┌────────────┐ ┌─────────────────────┐ │
│ GPT, etc.) │ │ │ Policy │ │ Session Manager │ │
│ │ │ │ Engine │ │ (Nitrolite Channel)│ │
└──────────────┘ │ │ 4 rules, │ │ Off-chain balance │ │
│ │ SHA-256 │ │ tracking + state │ │
┌──────────────┐ │ │ anchored │ │ channel co-signing │ │
│ Next.js │ fetch() proxy │ └─────┬──────┘ └──────────┬──────────┘ │
│ Frontend │──────────────────────►│ │ approve/reject │ update │
│ :3000 │ API Server :3001 │ ▼ ▼ │
└──────────────┘ │ ┌──────────────────────────────────────┐ │
│ │ Swap Simulator │ │
│ │ Uniswap v4 Quoter / Local AMM │ │
│ └──────────────────────────────────────┘ │
│ │ settle │
│ ▼ │
│ ┌──────────────────────────────────────┐ │
│ │ On-Chain (Base Sepolia) | │
│ │ SentinelWallet ← PolicyGuard │ │
│ │ ERC-4337 · ENS Identity │ │
│ └──────────────────────────────────────┘ │
└─────────────────────────────────────────────┘Key Features
Feature | Description |
Policy Engine | 4 deterministic rules: max trade size (2% of balance), allowed DEX (Uniswap v4 only), allowed assets (USDC/ETH), max slippage (0.5%). Every decision is logged with a full audit trail. |
⚡ Off-Chain Sessions | Swaps execute instantly and gaslessly during the session via Nitrolite state channels. Each state transition is co-signed with real ECDSA ( |
On-Chain Settlement | Final session balances settle once on-chain via the SentinelWallet smart contract, validated by PolicyGuard. ERC-4337 compatible. |
MCP Server | 4 tools exposed over the Model Context Protocol — any MCP-compatible AI agent (Claude Desktop, etc.) can use them. |
Uniswap v4 Integration | Queries the Quoter2 contract for real on-chain swap quotes. |
ENS Identity | Agent identity resolved from ENS on session open. Policy hash stored as a text record ( |
Smart Contracts |
|
Web Dashboard | Next.js 15 + React 19 + Tailwind CSS frontend. Proxies all calls to the real backend API — zero duplicate logic. |
Architecture
MCP Tools
The AI agent interacts with Sentinel via 4 MCP tools:
Tool | Description |
| Read current off-chain balance for USDC or ETH, plus session PnL and total USD value. |
| Preview a swap without executing it. Returns estimated output, price impact, and whether the policy engine would approve it. |
| Propose and execute a swap. Simulated → policy-checked → executed off-chain. The hard safety gate. |
| Close the session, finalize the Nitrolite channel, and settle final balances on-chain via ERC-4337. |
Policy Rules
Every propose_swap call is evaluated against all 4 rules. All must pass for the swap to execute:
# | Rule | Default | Description |
1 | Max Trade Size | 2% of balance | Prevents outsized positions. Scales with current balance. |
2 | Allowed DEX |
| Only whitelisted DEXes. Rejects sushiswap, curve, etc. |
3 | Allowed Assets |
| Only whitelisted tokens. Both tokenIn and tokenOut must be allowed. |
4 | Max Slippage | 50 bps (0.5%) | Protects against sandwich attacks and poor execution. |
The policy config is hashed with SHA-256 and anchored on ENS, so any tampering is detectable.
Session Lifecycle
open(1000 USDC) applySwap() close() settle(txHash)
│ │ │ │
┌────▼────┐ swap OK ┌───▼────┐ session end ┌──▼─────┐ on-chain ┌─▼──────┐
│ active │────────────►│ active │──────────────►│closing │─────────►│settled │
└─────────┘ └────────┘ └────────┘ └────────┘
│ │
Nitrolite channel SentinelWallet
state co-signed settleSession()Smart Contracts
SentinelWallet (contracts/src/SentinelWallet.sol)
ERC-4337 smart contract wallet
execute()/executeBatch()for arbitrary calls (owner or EntryPoint only)settleSession()— validates via PolicyGuard, then records final balancesvalidateUserOp()— ECDSA signature verification for bundler submissionNonce tracking for replay protection
PolicyGuard (contracts/src/PolicyGuard.sol)
On-chain safety net for settlement validation
Max USDC/ETH settlement limits per session
Allowed token whitelist
Session replay protection via
settledSessionsmappingPolicy hash matching — settlement must reference the correct policy version
Getting Started
Prerequisites
Node.js ≥ 20.0.0
Foundry (for smart contract tests) — install
Installation
# Clone the repository
git clone https://github.com/your-org/sentinel.git
cd sentinel
npm install
cd contracts && forge install && cd ..Quick Start (One Command)
The easiest way to run everything locally — no API keys needed:
./start.shOpen http://localhost:3000 and start trading.
To stop all services:
./start.sh stopConfiguration
# Copy the example environment file
cp .env.example .env
# Edit .env with your values:
# RPC_URL — Base Sepolia RPC endpoint
# OPERATOR_PRIVATE_KEY — Deployer/operator key (NOT the AI agent)
# SENTINEL_WALLET_ADDRESS — After deployment
# POLICY_GUARD_ADDRESS — After deploymentRun the Demo (CLI)
# Run the full 7-step demo scenario
npx tsx src/demo/scenario.tsThis will:
Open a session with 1000 USDC
Simulate a 2% USDC→ETH swap
Execute the swap (policy-approved, off-chain)
Attempt an illegal 5% swap (rejected by policy)
Execute another valid 2% swap
Show final session state
Close & settle (mock or real on-chain)
Run the API Server (Backend for Frontend)
# Start the backend API server on port 3001
npx tsx src/api/server.ts
# The frontend (port 3000) proxies all calls here.
# API endpoints: /api/session, /api/simulate, /api/swap, /api/policy, /api/audit, /api/statusRun as MCP Server
# Start the MCP server on stdio transport
npx tsx src/mcp-server/index.tsConnect from any MCP-compatible client (Claude Desktop, etc.) by adding to your MCP config:
{
"mcpServers": {
"sentinel-wallet": {
"command": "npx",
"args": ["tsx", "src/mcp-server/index.ts"],
"cwd": "/path/to/sentinel"
}
}
}Run Tests
# TypeScript tests (115 tests)
npm test
cd contracts && forge test -vv
# Watch mode
npx vitestTest Coverage
✓ src/policy-engine/engine.test.ts 24 tests
✓ src/session/manager.test.ts 19 tests
✓ src/session/channel.test.ts 18 tests
✓ src/mcp-server/swap-simulator.test.ts 9 tests
✓ src/mcp-server/uniswap-client.test.ts 10 tests
✓ src/mcp-server/tools.test.ts 12 tests
✓ src/contracts/settlement.test.ts 8 tests
✓ src/shared/ens.test.ts 15 tests
────────────────────────────────────────────────
TypeScript 115 tests
✓ contracts/test/PolicyGuard.t.sol 12 tests
✓ contracts/test/SentinelWallet.t.sol 15 tests
────────────────────────────────────────────────
Solidity (Foundry) 27 tests
TOTAL 142 tests ✅Deployment
Option A: Local Network (One Command)
The fastest way to test with real contracts — no API keys or testnet ETH needed.
./start.shThis starts Anvil (port 8546) → deploys contracts → starts API server (port 3001) → starts frontend (port 3000). Everything is auto-configured.
Service | URL |
Frontend | |
API Server | |
Anvil RPC |
Logs are stored in .logs/anvil.log, .logs/api.log, and .logs/frontend.log.
Terminal 1 — Start Anvil:
anvil --chain-id 84532 --port 8546Terminal 2 — Deploy:
cd contracts
export OPERATOR_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
forge script script/Deploy.s.sol --rpc-url http://127.0.0.1:8546 --broadcastTerminal 3 — API Server:
# Update .env with deployed addresses first
npx tsx src/api/server.tsTerminal 4 — Frontend:
cd frontend && npx next dev --port 3000Option B: Base Sepolia Testnet
For a persistent deployment on the public Base Sepolia testnet.
1. Get testnet ETH:
Base Sepolia Faucet — requires a Coinbase account
Or bridge from Sepolia using the Base Bridge
2. Configure .env:
cp .env.example .envRPC_URL=https://sepolia.base.org
CHAIN_ID=84532
OPERATOR_PRIVATE_KEY=0x<your-funded-testnet-key>
ETHERSCAN_API_KEY=<your-basescan-api-key> # optional, for verification3. Deploy:
cd contracts
# Deploy + verify on BaseScan
forge script script/Deploy.s.sol \
--rpc-url $RPC_URL \
--broadcast \
--verify \
--etherscan-api-key $ETHERSCAN_API_KEY
# Without verification (skip --verify and --etherscan-api-key)
forge script script/Deploy.s.sol \
--rpc-url $RPC_URL \
--broadcast4. Update .env with the printed addresses:
SENTINEL_WALLET_ADDRESS=0x...
POLICY_GUARD_ADDRESS=0x...5. (Optional) Fund the SentinelWallet:
# Send some ETH to the wallet so it can pay for settlement gas
cast send $SENTINEL_WALLET_ADDRESS \
--value 0.01ether \
--rpc-url $RPC_URL \
--private-key $OPERATOR_PRIVATE_KEY6. Run the demo against Base Sepolia:
cd ..
npx tsx src/demo/scenario.tsOption C: Mock Mode (No Deployment Needed)
If you just want to explore the policy engine and MCP tools without any on-chain interaction, no deployment is needed. Leave the contract addresses unset in .env and everything runs in mock mode:
npm install
npx tsx src/demo/scenario.ts # full demo, mock settlement
npx tsx src/mcp-server/index.ts # MCP server, mock settlementEnvironment Variables
Variable | Required | Description |
| For on-chain | Base Sepolia RPC endpoint |
| For on-chain | Operator key for settlement transactions |
| For on-chain | Deployed SentinelWallet address |
| For on-chain | Deployed PolicyGuard address |
| Optional | ERC-4337 EntryPoint v0.7 (defaults to canonical address) |
| Optional | BaseScan API key for contract verification |
| Optional | WebSocket URL for Nitrolite broker |
| Optional | Private key for channel state signing (ECDSA) |
| Optional | Broker's Ethereum address |
| Optional | Uniswap v4 Quoter2 contract address |
| Optional | Uniswap v4 PoolManager address (for slot0 spot price) |
| Optional | RPC for ENS resolution (Ethereum mainnet) |
| Optional | Custom ENS registry address |
| Optional | Backend API server port (default: 3001) |
| Optional | ENS name for agent identity (default: sentinel-agent.eth) |
| Optional |
|
Note: All on-chain features gracefully degrade. Without env vars, Sentinel runs in full mock mode — perfect for development and demos. The
start.shscript auto-configures everything for local development.
API Keys
For local development: NO. The ./start.sh script runs everything locally with zero external dependencies:
Integration | Local Mode | Testnet Mode |
EVM RPC | Anvil (local) — no key needed | Public RPCs like |
ENS Resolution | Skipped (graceful fallback) | Needs an Ethereum mainnet RPC ( |
Uniswap v4 Quoter | Local AMM simulator | Set |
Nitrolite Channel | Auto-configured with Anvil keys | In production, connect to a Yellow Network broker. No API key — uses WebSocket + ECDSA signing. |
BaseScan Verification | Not needed | Optional |
Smart Contracts | Deployed to local Anvil | Testnet ETH from Base Faucet (free, Coinbase account). |
Security Model
Sentinel implements defense in depth — multiple independent layers that each enforce safety:
MCP Tool Layer — Zod schema validation on all inputs. Type-safe, no raw strings.
Policy Engine — Deterministic 4-rule evaluation. Every decision logged with full audit trail. SHA-256 policy hash for integrity.
Session Manager — Balance accounting with overflow/underflow protection. Action limits per session.
Nitrolite Channel — Co-signed state transitions. Neither party can unilaterally modify balances.
PolicyGuard (on-chain) — Final safety net. Even if all off-chain layers are compromised, settlement must pass on-chain validation.
SentinelWallet (on-chain) — Owner-only execution. AI agent never touches the wallet directly. ERC-4337 signature verification.
ENS Anchoring — Policy hash stored as a text record. Tamper-proof verification that the policy hasn't changed.
The AI agent can only call 4 MCP tools. It cannot bypass the policy engine, directly modify balances, or interact with the smart contracts. The operator key (not the agent) controls settlement.
Example: What Happens When the Agent Tries a Bad Trade
Agent → propose_swap({ tokenIn: "USDC", tokenOut: "ETH", amount: 50 })
1. SwapSimulator.simulate() → 50 USDC ≈ 0.0199 ETH (0.3% fee)
2. PolicyEngine.evaluate() →
✓ Allowed DEX: uniswap-v4
✓ Allowed Assets: USDC/ETH
✓ Max Slippage: 50 bps ≤ 50 bps
✗ Max Trade Size: 50 USDC = 5% of 1000 (limit: 2%)
3. REJECTED — balance unchanged, full audit trail logged
4. Response: { success: false, error: "Policy rejected: ..." }License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Warden MCP lets AI agents find tokens, quote swaps and trade onchain on Base, BNB Chain, Robinhood Chain, Arc and Solana, within limits you set. Market tools need no credential: list_chains, search_tokens, trending_tokens, price_history, quote_swap and swap_status. Search by name, ticker or contract address, read USD price candles, and price a swap before committing to it, including cross-chain swaps. Wallet tools act for the wallet whose owner connected the agent, by OAuth sign-in or a wk_ key. agent_permissions shows what the agent may do and its daily limits. prepare_swap builds a trade and hands the owner a review link to sign. With request_session the owner turns on hands-free trading in one tap, and execute_swap then trades within the limits they set. swap_status tracks gasless and cross-chain trades. get_wallet shows holdings on every chain. Gasless trading is available on Base, BNB Chain and Robinhood Chain. Built by Warden Protocol, the team behind Warden Token Terminal.
Multi-aggregator swap router for AI agents on Base. 10 bps fee. MCP-native, non-custodial.
Trading tools for AI agents: token risk checks, swap quotes, unsigned swaps, holdings on 5 chains.
Non-custodial RFQ and atomic swap settlement for AI agents. Escrow onchain, signed receipts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAgent-native, self-hosted MCP server for crypto trading and DeFi management. Enables agents to query balances, execute trades, and manage positions with a policy engine and secure key storage.8Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered chat and DeFi operations (swap, transfer) via MCP-compliant tools, integrating with LLMs for onchain actions.8 npmMIT

OurPay Walletofficial
AlicenseNot gradedqualityBmaintenanceEnables AI agents and users to access an account-owned crypto wallet via MCP, providing tools for balances, transfers, swaps, bridging, merchant checkout, policy-constrained contract calls, signing, app connections, and Hyperliquid spot/perpetual orders.Apache 2.0- AlicenseNot gradedqualityCmaintenanceEnables AI agents to research, trade and move money across crypto spot and perpetuals, stocks, commodities, forex, prediction markets, onchain swaps and bridging, and memecoins through a single remote MCP connection with no installation or hosting required. It also supports wallet management, fiat on-ramps and token launches, with every write action asking the user for approval first.MIT