• Overview

  • Overview
  • Blockchain

  • Blockchain
  • BlocksTransactionsTop accountsContracts
  • Validators

  • Validators
  • API

  • API
  • Assets

  • Assets
  • TokensNFTs

Staking

Verify Contract

Somnia agent kit

Interact with your
agent via MCP

testnet

shannon

Latest Block

‌
‌

exploreme

Network

HomeDocs

Programs

grants

Socials

WebsiteTwitterDiscord

Help

Help centerBug report
Indexing the blocks
Evm0%...
Backend: —Frontend: v4.6.0-503de66

Powered by

STAKEME
Beta

This section is currently in development and may change.

Somnia Agent Kit

MCP70 tools · SomniaGitHub

MCP-based toolkit for interacting with the Somnia blockchain through AI agents or terminal. Send transactions, delegate SOMI to validators, deploy contracts, inspect on-chain data — all from a single workspace.

Two ways to use

Subscription

Free

Connect MCP to Claude Code, Cursor, or Codex and use your existing subscription. No API key needed.

  • Claude Code auto-detects .mcp.json
  • Built-in /wallet, /send, /deploy skills
  • Works with Claude Pro/Max or Cursor Pro
Claude CodeClaude Code setupCursorCursor setupCodexCodex setup

AI SDK

Developers

Build programmatic agents via Vercel AI SDK with Claude or OpenAI. Full control over agent behavior.

  • Vercel AI SDK integration
  • Claude and OpenAI support
  • Ready-to-run demos included
AI SDKAI SDK docs

Quick Start

Claude CodeClaude Code auto-detects .mcp.json and connects to Somnia. Use built-in skills:

Architecture

The AI agent sees only your wallet address and tool results — never the private key. Signing always happens locally before the transaction is broadcast.

sign-tx (local)

Signs tx locallyKey in .env or keystore
unix

MCP Server (remote)

prepare_* transactionsbroadcast signed txquery blocks & tokensstake & read contracts

AI Agent (ClaudeClaude/GPTGPT/ local)

✓ Sees: wallet address, tool results✗ Never sees: private key

You (chat or code)

Security

Key Principle

The private key never leaves your machine. MCP prepares unsigned transactions, signing happens locally, then the signed transaction is broadcast back through MCP.

Simple Mode

Default

Private key stored in .env, protected by guard hooks that block the AI agent from reading it. Tests cover 26+ attack vectors.

Secure Mode

Maximum security

Private key encrypted in keystore, decrypted only in a separate daemon process. The AI agent physically cannot access the key — it only receives the signed hash.

Docker Isolation

Supply chain protection

Run all npm installs and demos inside a container. Node modules are isolated — compromised packages can't reach your host filesystem or keys.

MCP Tools

70 tools total

The Somnia MCP server at https://api.somnia.exploreme.pro/mcp provides tools across 7 categories.

Transactions
  • prepare_native_transfer
  • prepare_transaction
  • broadcast_signed_raw_transaction
  • wait_for_transaction
Staking
  • prepare_delegate
  • prepare_undelegate
  • prepare_claim_rewards
  • get_delegations
  • get_delegation_info
Balances
  • rpc_native_balance
  • rpc_token_balance
  • rpc_read_contract
Blocks & Txs
  • list_evm_blocks
  • get_evm_block_by_height
  • list_evm_transactions
  • get_evm_transaction_by_hash
Contracts
  • list_evm_contracts
  • get_evm_contract_by_address
  • get_evm_contract_code
  • get_evm_compiler_versions
Validators
  • list_validators
  • get_validator_by_address
  • get_validator_delegators
  • get_evm_top_delegators
Explorer
  • explorer_search
  • get_evm_account_by_address
  • get_chain_network