MCP • Model Context Protocol for Somnia
Somnia MCP Server
This page documents and helps you configure an MCP server for Somnia blockchain with tools for accounts, transactions, blocks and fee suggestions.
Integrations
Register the server in your MCP-aware host configuration.
Important: Wallet Configuration Required
This MCP server requires a wallet private key to perform on-chain operations (signing transactions, sending tokens, etc.).
⚠️ You must provide your own private key:
-
For local use: Set
AGENT_SECRET_KEYin your.envfile -
For Claude Desktop: Add
AGENT_SECRET_KEYto the env section in your config - For hosted deployment: Configure as environment variable in your platform
Format: AGENT_SECRET_KEY=0x... (66
characters: 0x + 64 hex digits)
Security: Never share your private key. Use a
test wallet for development.
{
"mcpServers": {
"somniaMcp": {
"url": "https://server.smithery.ai/@fozagtx/somnia-mcp/mcp",
"type": "streamable-http",
"env": {
"AGENT_SECRET_KEY": "0xYOUR_PRIVATE_KEY_HERE",
"ENVIRONMENT": "TESTNET"
}
}
}
}
Note: Replace
0xYOUR_PRIVATE_KEY_HERE with your
actual Ethereum private key. Set
ENVIRONMENT to TESTNET or
MAINNET depending on which network you
want to use.
Tool list
A read-only list of the available tools. Use these names when constructing MCP requests.
Somnia Documentation
-
search_documentation— Search Somnia Documentation.
Thorest API
Accounts
-
get_account— Retrieve account details.
Transactions
-
get_transaction— Retrieve a transaction by ID.
Blocks
-
get_block— Get a Somnia block.
Fees
-
get_priority_fee— Suggest a priority fee.
Wallet & signatures
Wallet
-
create_wallet— Create a Somnia wallet (mnemonic + keys).
Signatures
-
sign_certificate— Create and sign a canonical certificate. -
sign_raw_transaction— Sign raw transaction.
Goat SDK (Somnia Tools)
-
get_address— Get the address of the wallet -
get_chain— Get the chain of the wallet -
sign_message— Sign a message with the wallet -
get_balance— Get the balance for native currency or a specific token -
get_token_info_by_ticker— Get token info (contract, decimals) by ticker -
convert_to_base_units— Convert a token amount to base units (e.g., wei) -
convert_from_base_units— Convert from base units to readable units -
sign_typed_data_evm— Sign EIP-712 typed data (EVM) -
get_token_allowance_evm— Get ERC20 allowance (base units) -
send_token— Send native currency or ERC20 token (base units) -
approve_token_evm— Approve ERC20 token allowance (base units) -
revoke_token_approval_evm— Revoke ERC20 token approval (set allowance to 0)