Skip to main content

SDK Overview

The rickydata SDK is the unified TypeScript client for the RickyData platform. It covers MCP tool discovery and execution, agent chat, canvas workflows, KFDB data access, and wallet management.

Packages

PackageImportPurpose
coreimport { MCPGateway, KFDBClient, SpendingWallet } from 'rickydata'Gateway client, KFDB client, spending wallet, auth manager
reactimport { useFreeTierStatus, useAgentChat } from '@rickydata/react'React hooks and components for wallet, agents, and chat UI
chatimport { AgentChatEmbed } from '@rickydata/chat'Embeddable agent chat component

Install

npm install rickydata          # Core SDK + CLI
npm install @rickydata/react # React hooks and components
npm install @rickydata/chat # Chat embed component

Core capabilities

MCP Gateway — discover and call tools

import { MCPGateway } from 'rickydata';

const gw = new MCPGateway({ url: 'https://mcp.rickydata.org' });

// Browse (free, no auth)
const servers = await gw.listServers();
const tools = await gw.listTools('brave-search-mcp-server');

// Call tools (requires wallet auth + payment)
const result = await gw.callTool(
'brave-search-mcp-server',
'brave_web_search',
{ query: 'MCP protocol' }
);

See MCP Gateway for full details including authentication and spending wallets.

KFDB — read and write entity data

import { KFDBClient } from 'rickydata';

const kfdb = new KFDBClient({
baseUrl: 'http://34.60.37.158',
apiKey: process.env.KFDB_API_KEY!,
});

// Global read (default)
const servers = await kfdb.listEntities('MCPServer', { limit: 10 });

// Private read
const notes = await kfdb.withScope('private').listEntities('Note', { limit: 25 });

See KFDB Client for the full scope model.

Agent chat

import { A2AClient } from 'rickydata/a2a';

const client = new A2AClient({
baseUrl: 'https://agents.rickydata.org',
token: 'mcpwt_...',
});
await client.storeApiKey('sk-ant-...');

const task = await client.sendMessage({
message: {
role: 'user',
parts: [{ type: 'text', text: 'Research MCP protocol' }],
},
metadata: { agentId: 'research-agent' },
});

Canvas workflows

import { CanvasClient, AuthManager } from 'rickydata';

const auth = new AuthManager('https://agents.rickydata.org', 'mcpwt_...');
const canvas = new CanvasClient({ auth });

for await (const event of canvas.executeWorkflow({
nodes: [
{ id: 'input', type: 'textInputNode', data: { value: 'Summarize MCP' } },
{ id: 'agent', type: 'agentNode', data: { prompt: 'Summarize', model: 'haiku' } },
{ id: 'output', type: 'resultsNode', data: {} },
],
connections: [
{ source: 'input', target: 'agent' },
{ source: 'agent', target: 'output' },
],
})) {
if (event.type === 'run_completed') console.log('Results:', event.data.results);
}

Agent as MCP server

Expose any agent as an MCP endpoint:

import { AgentMCPClient } from 'rickydata';

const client = new AgentMCPClient({ token: 'mcpwt_...' });
const tools = await client.listTools('research-agent');
const result = await client.callTool('research-agent', 'web_research', { topic: 'MCP' });

Error handling

All errors extend MCPGatewayError. Key subtypes:

ErrorWhen
SpendingLimitExceededErrorA spending policy limit was hit
CircuitBreakerTrippedErrorToo many consecutive failures
EndpointNotAllowedErrorURL not in the endpoint allowlist
DuplicatePaymentErrorDuplicate payment detected within dedup window
PaymentSigningErrorx402 payment signature failed

Architecture

ServiceURLPurpose
MCP Gatewayhttps://mcp.rickydata.orgMCP server hosting + tool proxy
Agent Gatewayhttps://agents.rickydata.orgBYOK Claude agents + canvas runtime
Marketplacehttps://marketplace.rickydata.orgBrowse + manage servers

Next steps