Use blockchain RPC in ElizaOS agents with BlockVectra

Point ElizaOS's plugin-evm at BlockVectra with two environment variables, start keyless on the public endpoint, and add the docs MCP server through plugin-mcp.

ElizaOS agents reach EVM chains through @elizaos/plugin-evm, which reads its RPC URLs from the environment. Set EVM_PROVIDER_URL to https://api.blockvectra.com/v1/eth_mainnet/public and the plugin uses BlockVectra for Ethereum mainnet with no API key. The Free Plan adds keyed methods with 30,000,000 CU per 30-day window. Checked .

# .env (the plugin also needs the wallet key; keep it in your secret store)
EVM_PRIVATE_KEY=your-wallet-private-key
EVM_PROVIDER_URL=https://api.blockvectra.com/v1/eth_mainnet/public
ETHEREUM_PROVIDER_BASE=https://api.blockvectra.com/v1/base_mainnet/public
{
  "name": "DeFiAgent",
  "plugins": ["@elizaos/plugin-evm"],
  "settings": { "chains": { "evm": ["base"] } }
}

Install the plugin with bun add @elizaos/plugin-evm. Ethereum mainnet is enabled by default; every other chain you list in settings.chains.evm must use its viem/chains export name, and its URL variable is ETHEREUM_PROVIDER_<CHAIN_NAME> in upper case, as in the plugin's README on npm.

Use an API key

Public endpoints cover only the methods in each chain's public.methods. For the rest, put the key in the URL path (/v1/{chain}/{api_key}). The plugin takes only a URL, so this is the one place the key travels in the path. Export the variables in the shell that starts the agent so the key never lands in a file you commit:

export EVM_PROVIDER_URL=https://api.blockvectra.com/v1/eth_mainnet/${BLOCKVECTRA_API_KEY}
export ETHEREUM_PROVIDER_BASE=https://api.blockvectra.com/v1/base_mainnet/${BLOCKVECTRA_API_KEY}

URLs can show up in logs, proxies and error messages, so use a separate key with a low cu_cap for the agent, and revoke it in the console if it leaks.

To create the key without a browser, follow the four steps in the programmatic sign-up guide: challenge, signature, login, then POST /keys. Developers can also create a key in the console. The same key works on every chain, so one key serves each ETHEREUM_PROVIDER_* variable.

Add the docs MCP server

@elizaos/plugin-mcp lets a character use remote MCP servers over Streamable HTTP. Install it with bun add @elizaos/plugin-mcp, then register the BlockVectra docs server in the character settings:

{
  "plugins": ["@elizaos/plugin-evm", "@elizaos/plugin-mcp"],
  "settings": {
    "mcp": {
      "servers": {
        "blockvectra": { "type": "streamable-http", "url": "https://docs.blockvectra.com/mcp" }
      }
    }
  }
}

The agent can then call list_chains, get_status, rpc_call, read_doc and the other tools listed on the MCP server page, keyless. The plugin's documented HTTP options are type, url and timeout; it documents no header option, so keyed MCP tools are out of reach from this config. Keep keyed reads in plugin-evm as above.

Errors you may see

ResponseMeaningWhat to do
HTTP 401, -32024, missing_api_keyA keyed URL was called without a keyPut the key in the path or the x-api-key header
HTTP 401, -32024, invalid_api_keyKey unknown, disabled or revokedCheck the key in the console; a new key takes a few seconds to activate
-32601, method_not_publicMethod is not in the chain's public.methodsSwitch that chain's URL from /public to the keyed form
Chain not recognisedName in settings.chains.evm does not match a viem/chains nameUse the exact viem/chains name

Each BlockVectra error includes data.reason and a docs_url; the full list is on the errors page.

Official documentation

Common questions

Does EVM_PROVIDER_URL apply to Base? No. It sets Ethereum mainnet only; other chains use ETHEREUM_PROVIDER_<CHAIN_NAME>.

Can an agent sign and send transactions through the public endpoint? eth_sendRawTransaction is in public.methods for the chains that list it, with its own lower per-IP rate limit under public.send_raw_rate_limit in GET /v1/chains. Read the limit there before building on it.

Do I need a key for the MCP server? No. Connecting and the documentation, chain and pricing tools are keyless.

Next steps

Last updated:

On this page