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.
git 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/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<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="Reviewed on agentmods" width="80" 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.5 | $0.00551 | $0.00551 |
| Sonnet 5.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 3mo 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.
- 3mo 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.0055 per session on Opus 5.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.
evm-chain-id-format compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| evm-chain-id-formatMetaMask/metamask-connect-cursor-plugin | Cursor rule | 2 | 2mo ago | MIT | A | 1,377 | Cursor |
| cardano-mcpJimmyh-world/Cardano_MCP | Cursor rule | 1 | 1y ago | MIT | A | 3,030 | Cursor |
| solana_core_architectureAIFlowML/cursor_rules | Cursor rule | 24 | 1y ago | none | A | 4 | Cursor |
| elizaos_v2_onchain_pluginsAIFlowML/cursor_rules | Cursor rule | 24 | 1y ago | none | A | 0 | Cursor |
| tactton-ai-core/contract-knowledge | Cursor rule | 17 | 1y ago | none | A | 614 | Cursor |
| stacks-developmentMcsavvy/stacks-next-template-chainhooks-with-db | Cursor rule | 4 | 11mo ago | none | A | 7 | Cursor |
| solana_monitoring_analyticsDatai-Network/datai-mcp-server | Cursor rule | 3 | 1y ago | none | A | 13 | Cursor |