MCP Server Reference

The MagicBlock Console MCP Server exposes Ephemeral Rollup management as tools for AI agents. Any MCP-compatible client can use these tools to create, configure, and monitor ERs.

Setup

Add to your MCP client configuration:

{
  "mcpServers": {
    "magicblock-console": {
      "command": "npx",
      "args": ["@magicblock-console/mcp"],
      "env": {
        "MB_KEYPAIR_PATH": "~/.config/solana/id.json"
      }
    }
  }
}

Environment Variables

VariableRequiredDescription
MB_KEYPAIR_PATHNoPath to Solana keypair JSON file. If not set, runs in simulated mode
MB_NETWORKNoNetwork: devnet (default), mainnet

Tools

Project Management

create_project

Create a new project with ER configuration.

Parameters:

NameTypeRequiredDescription
namestringYesProject name
regionstringNoRegion: us, eu, asia. Default: us

Example:

Agent: I'll create a new project called "my-game" in the EU region.
[calls create_project with name="my-game", region="eu"]

list_projects

List all projects and their status. No parameters.

get_project

Get details of a specific project.

Parameters:

NameTypeRequiredDescription
namestringYesProject name

configure_project

Update feature configuration for a project.

Parameters:

NameTypeRequiredDescription
namestringYesProject name
gaslessbooleanNoEnable gasless transactions
privacybooleanNoEnable privacy via TEE
vrfbooleanNoEnable verifiable randomness
cranksbooleanNoEnable automated execution
oraclebooleanNoEnable oracle price feeds

Example:

Agent: I'll configure your project with gasless and VRF enabled.
[calls configure_project with name="my-game", gasless=true, vrf=true]

delete_project

Delete a project.

Parameters:

NameTypeRequiredDescription
namestringYesProject name

ER Lifecycle

delegate_account

Delegate a Solana account to an Ephemeral Rollup for high-speed execution.

Parameters:

NameTypeRequiredDescription
accountstringYesAccount public key
projectstringYesProject name
ownerProgramstringNoOwner program ID (if delegating a PDA)

undelegate_account

Undelegate an account from an Ephemeral Rollup — final commit and return to Solana base layer.

Parameters:

NameTypeRequiredDescription
accountstringYesAccount public key
projectstringYesProject name
ownerProgramstringNoOwner program ID (if undelegating a PDA)

commit_account

Commit the current ER state of a delegated account back to the Solana base layer.

Parameters:

NameTypeRequiredDescription
accountstringYesAccount public key
projectstringYesProject name

get_delegation_status

Check whether an account is currently delegated to an Ephemeral Rollup.

Parameters:

NameTypeRequiredDescription
accountstringYesAccount public key

Returns: Delegation status, project name (if delegated), and ER region.

list_delegated_accounts

List all accounts currently delegated to a project.

Parameters:

NameTypeRequiredDescription
projectstringYesProject name

get_state_diff

Compare the base layer and Ephemeral Rollup state of a delegated account to see what changed.

Parameters:

NameTypeRequiredDescription
accountstringYesAccount public key

Returns: Field-by-field diff showing pre-ER and current ER state.

Features

request_vrf

Request verifiable randomness (VRF) for a project. Returns 32 bytes of cryptographic randomness with proof.

Parameters:

NameTypeRequiredDescription
projectstringYesProject name

create_crank

Schedule automatic execution for a project.

Parameters:

NameTypeRequiredDescription
projectstringYesProject name
intervalMsnumberYesInterval between executions in milliseconds
iterationsnumberNoNumber of iterations (0 or omitted = infinite)
accountstringNoAccount to commit (enables real blockchain operations)

list_cranks

List all cranks for a project.

Parameters:

NameTypeRequiredDescription
projectstringYesProject name

stop_crank

Stop a running crank by its ID.

Parameters:

NameTypeRequiredDescription
crankIdstringYesCrank ID

get_price_feed

Get current price from an oracle feed (Pyth Lazer).

Parameters:

NameTypeRequiredDescription
projectstringYesProject name
feedstringYesPrice pair (e.g., SOL/USD, BTC/USD, ETH/USD, USDC/USD)

Privacy

deposit_private

Deposit tokens into the privacy layer via TEE confidential transfers.

Parameters:

NameTypeRequiredDescription
projectstringYesProject name
tokenstringYesToken symbol (SOL, USDC) or mint address
amountnumberYesAmount to deposit
mintstringNoExplicit SPL mint address

transfer_private

Transfer tokens confidentially via the TEE privacy layer.

Parameters:

NameTypeRequiredDescription
projectstringYesProject name
tokenstringYesToken symbol or mint address
amountnumberYesAmount to transfer
tostringYesRecipient wallet address
mintstringNoExplicit SPL mint address

withdraw_private

Withdraw tokens from the privacy layer back to the base layer.

Parameters:

NameTypeRequiredDescription
projectstringYesProject name
tokenstringYesToken symbol or mint address
amountnumberYesAmount to withdraw
mintstringNoExplicit SPL mint address

Monitoring

get_project_status

Get operational status of a project including features, delegated accounts, uptime, and transaction count.

Parameters:

NameTypeRequiredDescription
projectstringYesProject name

Returns: Status, enabled features, active accounts, transaction count, and uptime.

get_project_costs

Get cost breakdown for a project (transactions, commits, sessions) over a given period.

Parameters:

NameTypeRequiredDescription
projectstringYesProject name
periodstringNoTime period: 7d, 30d, 90d (default: 30d)

get_project_logs

Get recent log entries for a project, newest first.

Parameters:

NameTypeRequiredDescription
projectstringYesProject name
limitnumberNoNumber of log entries to return (default: 50)

Example Conversations

Create and configure a project

User: “Set up a new project called ‘my-game’ in the EU region with gasless transactions and VRF enabled”

Agent:

  1. Calls create_project with name=“my-game”, region=“eu”
  2. Calls configure_project with name=“my-game”, gasless=true, vrf=true
  3. Returns confirmation: “Project ‘my-game’ created in EU with gasless and VRF enabled.”

Delegate account and check status

User: “Delegate my account ABC123 to my-game and show me the current status”

Agent:

  1. Calls delegate_account with account=“ABC123”, project=“my-game”
  2. Calls get_project_status with project=“my-game”
  3. Returns delegation confirmation and project status.

Monitor costs and performance

User: “What did my-game cost over the last 7 days?”

Agent:

  1. Calls get_project_costs with project=“my-game”, period=“7d”
  2. Returns breakdown by transaction fees, commit fees, and session fees.