npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@radiustechsystems/ai-agent-adapter-model-context-protocol

v1.0.4

Published

Model Context Protocol adapter for the Radius AI Agent Toolkit

Downloads

4

Readme

Radius AI Agent Toolkit - Model Context Protocol Adapter

This adapter provides integration between the Radius AI Agent Toolkit and the Model Context Protocol (MCP), allowing you to easily add Radius capabilities to AI agents using models like Claude that support the MCP.

This package is part of the Radius AI Agent Toolkit, which provides tools for integrating AI agents with the Radius platform.

Installation

# Install this specific package
npm install @radiustechsystems/ai-agent-adapter-model-context-protocol

# Required peer dependencies
npm install @radiustechsystems/ai-agent-core
npm install zod-to-json-schema

Prerequisites

  • Node.js >=20.12.2 <23
  • A server setup that implements the Model Context Protocol
  • Radius wallet setup with a funded account

Usage

import { getOnChainTools } from "@radiustechsystems/ai-agent-adapter-model-context-protocol";
import { createRadiusWallet, sendETH } from "@radiustechsystems/ai-agent-wallet";
import * as dotenv from "dotenv";

// Load environment variables
dotenv.config();

// 1. Create a Radius wallet (always validate your environment variables)
const rpcUrl = process.env.RPC_PROVIDER_URL;
const privateKey = process.env.WALLET_PRIVATE_KEY;

if (!rpcUrl || !privateKey) {
  console.warn("WARNING: Missing required environment variables");
  console.warn("RPC_PROVIDER_URL and WALLET_PRIVATE_KEY must be set");
}

const wallet = await createRadiusWallet({
  rpcUrl,
  privateKey
});

// Get wallet address
const address = await wallet.getAddress();
console.log(`Wallet address: ${address}`);

// 2. Configure the tools for Model Context Protocol
const { listOfTools, toolHandler } = await getOnChainTools({
  wallet,
  plugins: [
    sendETH(), // Enable ETH transfers
  ]
});

// 3. Get the available tools
const tools = listOfTools();
console.log(`Configured ${tools.length} tools for Model Context Protocol`);
tools.forEach(tool => {
  console.log(` - ${tool.name}: ${tool.description}`);
});

// 4. Example of using toolHandler directly (for testing)
const toolName = 'get_address';
try {
  const result = await toolHandler(toolName, {});
  console.log(`Tool result: ${JSON.stringify(result, null, 2)}`);
} catch (error: any) {
  console.error(`Tool execution error: ${error.message || String(error)}`);
}

// 5. Use in your MCP server implementation
// In your Express/Fastify/etc. server:
app.post('/tools', (req, res) => {
  // Return list of available tools
  res.json(listOfTools());
});

app.post('/tools/:name', async (req, res) => {
  try {
    // Handle tool execution
    const result = await toolHandler(req.params.name, req.body);
    res.json(result);
  } catch (error) {
    res.status(400).json({ error: error.message });
  }
});

If you want to include ERC20 token support, you would add:

import { erc20, USDC } from "@radiustechsystems/ai-agent-plugin-erc20";

// Then in the plugins array:
const { listOfTools, toolHandler } = await getOnChainTools({
  wallet,
  plugins: [
    sendETH(), 
    erc20({ tokens: [USDC] }) // Add ERC20 token support
  ]
});

API Reference

getOnChainTools(options)

Creates tool handlers compatible with the Model Context Protocol that provide access to configured Radius features.

Parameters:

  • options.wallet (WalletClientBase): A Radius wallet instance
  • options.plugins (Array): Array of plugin instances to enable

Returns:

  • An object containing:
    • listOfTools(): Function that returns tool definitions in MCP format
    • toolHandler(name, parameters): Function that executes a tool and returns the result in MCP format

Default Tools:

The getOnChainTools function automatically provides the following wallet-related tools:

  • get_address: Get the address of the wallet
  • get_chain: Get the chain of the wallet
  • get_balance: Get the balance of an address
  • sign_message: Sign a message with the wallet
  • simulate_transaction: Simulate a transaction to check if it would succeed
  • resolve_address: Resolve an ENS name to an address
  • get_transaction_status: Check the status of a transaction

Response Format:

Tool results are formatted according to the Model Context Protocol specification:

interface ToolResponse {
  content: Array<{
    type: 'text' | 'image';
    text?: string;
    image_url?: string;
  }>;
}

Example:

const { listOfTools, toolHandler } = await getOnChainTools({
  wallet,
  plugins: [
    sendETH(),
    erc20({ tokens: [USDC] })
  ]
});

Integration Examples

For examples of how to integrate this adapter with an MCP server, see:

Troubleshooting

Error: Tool Not Found

If you encounter an error about a tool not being found:

  1. Check that the tool name exactly matches what is returned by listOfTools()
  2. Verify that the tool is provided by one of your enabled plugins
  3. Remember that tool names are case-sensitive and use snake_case format

Error: Missing Parameters

If a tool execution fails with a parameter error:

  1. Check the tool's schema in listOfTools() to see the required parameters
  2. Ensure all required parameters are included in the request body
  3. Verify parameter types match what is expected (e.g., numbers for amounts, strings for addresses)

Related Packages

Resources

Contributing

Please see the Contributing Guide for detailed information about contributing to this toolkit.

License

This project is licensed under the MIT License.