How to Use the Nodereal MCP in Mastra AI
Build unbreakable on-chain workflows with Mastra AI and Nodereal's MCP Server. Automate multi-step transactions and data indexing.
Works with every AI agent you already use
…and any MCP-compatible client
Connect Nodereal MCP to Mastra AI
Create your Vinkius account to connect Nodereal to Mastra AI and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Build Fault-Tolerant Pipelines
Your agent can finally handle the messy reality of blockchain networks. Build a Mastra AI workflow that first calls `eth_estimate_gas`. If the cost is acceptable, it proceeds to `eth_send_raw_transaction`. Mastra's built-in branching lets you define what happens on success or failure. If the network is congested and the transaction fails, the workflow can automatically retry with exponential backoff. If it fails again, it can log the error and send a notification. You define the entire logic, and your agent executes it reliably.
Index Chain Data Reliably
Use Mastra AI to build a simple, powerful indexer. Create a workflow that fetches new blocks and uses `nr_get_transaction_receipts_by_block_number` to get all receipts at once. This is way more efficient than looping through transaction hashes one by one. If the Nodereal endpoint is temporarily unavailable, Mastra's engine won't crash your indexer. It will just retry the request to the MCP server until it succeeds, ensuring you don't miss any data. That's the power of a proper workflow engine.
Automate Cross-Chain Monitoring with Mastra AI
Build a single agent that keeps an eye on both EVM and Aptos chains. Your workflow can query for specific event logs on Ethereum using `eth_get_logs`. In the next step, it can check an account's status on Aptos using `aptos_get_account`. This lets you create 'if-this-then-that' logic that spans multiple networks. For example, if a large transfer happens on an EVM chain, your agent can trigger a corresponding action on Aptos. Mastra AI handles the state between steps.
Set up Nodereal MCP in Mastra AI
Prerequisites
- Node.js 18+ and a TypeScript project
-
@mastra/mcp+@mastra/corepackages - Active Vinkius subscription with a valid endpoint token
- 1
Install dependencies
Run
npm install @mastra/mcp @mastra/coreplus your preferred model provider (e.g.@ai-sdk/openai). - 2
Configure the MCPClient
Create an
MCPClientwith your Vinkius endpoint as aURLobject. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. - 3
Discover and inject tools
Call
mcpClient.listTools()and spread the result into your agent'stoolsobject. All Nodereal tools become native Mastra tools. - 4
Run with any model
Swap
openai("gpt-4o")for any AI SDK-compatible provider. Callagent.generate()and the agent routes tool calls through MCP automatically.
import { MCPClient } from "@mastra/mcp";
import { Agent } from "@mastra/core/agent";
import { openai } from "@ai-sdk/openai";
const mcpClient = new MCPClient({
id: "nodereal-mcp-client",
servers: {
"nodereal-mcp": {
url: new URL(
"https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp"
),
},
},
});
const agent = new Agent({
name: "Nodereal Agent",
model: openai("gpt-4o"),
instructions: "You have access to Nodereal tools.",
tools: {
...(await mcpClient.listTools()),
},
});
const result = await agent.generate(
"List recent Nodereal transactions"
);
console.log(result.text); Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by NodeReal. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about Nodereal MCP in Mastra AI
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the Nodereal MCP today
We host it, we monitor it, we maintain it. You just paste one token.