Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/metamask/metamask-connect-cursor-plugin/evm-chain-id-formatgit clone --depth 1 https://github.com/MetaMask/metamask-connect-cursor-pluginWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/metamask/metamask-connect-cursor-plugin/evm-chain-id-format)<a href="https://agentmods.dev/rules/metamask/metamask-connect-cursor-plugin/evm-chain-id-format"><img src="https://agentmods.dev/badge/rules/metamask/metamask-connect-cursor-plugin/evm-chain-id-format.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01377 | $0.01377 |
| Opus 5 | $0.00688 | $0.00688 |
| Sonnet 5 | $0.00275 | $0.00275 |
| Haiku 4.5 | $0.00138 | $0.00138 |
Grade A, and why
evm-chain-id-format scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.
EVM Chain ID Format
Hex String Requirement
- Chain IDs in MetaMask Connect must always be hex strings:
'0x1'not1or'1' - All
chainIdsarrays,supportedNetworkskeys, andswitchChainparameters expect hex format - Passing a number or decimal string will cause silent failures or runtime errors
- Use
'0x' + chainId.toString(16)to convert from decimal to hex
Common Chain IDs
| Network | Decimal | Hex | CAIP-2 Scope |
|---|---|---|---|
| Ethereum Mainnet | 1 | 0x1 |
eip155:1 |
| Sepolia | 11155111 | 0xaa36a7 |
eip155:11155111 |
| Polygon | 137 | 0x89 |
eip155:137 |
| Arbitrum One | 42161 | 0xa4b1 |
eip155:42161 |
| Optimism | 10 | 0xa |
eip155:10 |
| Base | 8453 | 0x2105 |
eip155:8453 |
| Avalanche C-Chain | 43114 | 0xa86a |
eip155:43114 |
| BNB Smart Chain | 56 | 0x38 |
eip155:56 |
| Celo | 42220 | 0xa4ec |
eip155:42220 |
| Linea | 59144 | 0xe708 |
eip155:59144 |
CAIP-2 Conversion
- EVM CAIP-2 format is
eip155:<decimal-chainId>— always uses decimal, not hex - EVM RPC / EIP-1193 format uses hex strings (
0x1) - Multichain
invokeMethodscope uses CAIP-2 (eip155:1) - EVM client
connect({ chainIds })uses hex strings (['0x1']) - Convert: hex
0x89→ decimal137→ CAIP-2eip155:137
Auto-Included Chain
0x1(Ethereum mainnet) is automatically included in the EVM client'sconnect()permission request even if you don't pass it inchainIds- It is not injected into
api.supportedNetworks— that map must explicitly contain every chain you use (including mainnet), andcreateEVMClientthrows if it is empty - All chains need valid RPC URLs in
supportedNetworks - If you use Infura RPC URLs, make sure the needed chains are enabled for your Infura project/API key
Wagmi Connector
- The wagmi MetaMask connector is imported from
wagmi/connectors:import { metaMask } from 'wagmi/connectors'— it requires@metamask/connect-evmas a peer dependency - Use
getInfuraRpcUrls({ infuraApiKey: 'API_KEY', chainIds?: Hex[] })from@metamask/connect-evmto populatesupportedNetworks— returns a hex-chain-ID-keyed map of Infura RPC URLs (e.g.{ '0x1': 'https://...', '0x89': 'https://...' });chainIdsis optional and filters to specific hex chain IDs - The multichain equivalent in
@metamask/connect-multichainisgetInfuraRpcUrls({ infuraApiKey: 'API_KEY', caipChainIds?: string[] })— returns a CAIP-2-keyed map (e.g.{ 'eip155:1': 'https://...' }) and accepts CAIP-2 IDs for filtering
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 65 lines · 1,377 tokens per session scan A af66d3ca14ad
evm-chain-id-format is a cursor rule published in the GitHub repository MetaMask/metamask-connect-cursor-plugin (2 stars, last pushed 2mo ago), licensed MIT. It adds 1,377 tokens to every session, about $0.0069 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
zama-protocol-zama-solidity--setups-foundry
Detailed reference for foundry (zama-solidity skill).
cardano-mcp
These rules complement our main development collaboration rules, focusing specifically on the Model Context Protocol (MCP) server project with TypeScript. This project serves as a specialized RAG (Retrieval-Augmented Generation) gateway to existing Cardano resources, documentation, and tools to assist with dApp…
solana_core_architecture
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐ │ Entry Point │ │ Instruction │ │ Account │ │ lib.rs │───▶│ Processing │───▶│ Validation │ │ │ │ │ │ │ │ - entrypoint! │ │ - Route dispatch │ │ - Owner checks │ │ - processinst │ │ - Deserialize │ │ - Data validate │.
elizaos_v2_onchain_plugins
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐ │ Wallet Provider│ │ Connection Mgmt │ │ Transaction Svc │ │ - Private Keys │───▶│ - RPC Endpoints │───▶│ - Tx Construction│ │ - Public Keys │ │ - Network Config │ │ - Fee Estimation│ │ - Signatures │ │ - Health Check │ │ - Broadcasting │ └─────────────────┘…
stacks-development
Guidelines for Stacks blockchain development.
solana_monitoring_analytics
Solana blockchain development, production monitoring, analytics, and observability.