Mcp
Rpc MCP
Model Context Protocol reference for rpc.do - Remote Procedure Call (RPC) services
Rpc MCP
Remote Procedure Call (RPC) services
Overview
The Model Context Protocol (MCP) provides AI models with direct access to rpc.do through a standardized interface.
Installation
pnpm add @modelcontextprotocol/sdkConfiguration
Add to your MCP server configuration:
{
"mcpServers": {
"rpc": {
"command": "npx",
"args": ["-y", "@dotdo/mcp-server"],
"env": {
"DO_API_KEY": "your-api-key"
}
}
}
}Tools
rpc/invoke
Main tool for rpc.do operations.
{
"name": "rpc/invoke",
"description": "Remote Procedure Call (RPC) services",
"inputSchema": {
"type": "object",
"properties": {
"operation": {
"type": "string",
"description": "Operation to perform"
},
"parameters": {
"type": "object",
"description": "Operation parameters"
}
},
"required": ["operation"]
}
}Usage in AI Models
Claude Desktop
// ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"rpc": {
"command": "npx",
"args": ["-y", "@dotdo/mcp-server", "--tool=rpc"],
"env": {
"DO_API_KEY": "undefined"
}
}
}
}OpenAI GPTs
# Custom GPT configuration
tools:
- type: mcp
server: rpc
operations:
- invoke
- query
- executeCustom Integration
import { Client } from '@modelcontextprotocol/sdk/client/index.js'
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'
const transport = new StdioClientTransport({
command: 'npx',
args: ['-y', '@dotdo/mcp-server', '--tool=rpc'],
})
const client = new Client(
{
name: 'rpc-client',
version: '1.0.0',
},
{
capabilities: {},
}
)
await client.connect(transport)
// Call tool
const result = await client.callTool({
name: 'rpc/invoke',
arguments: {
operation: 'rpc',
parameters: {},
},
})Tool Definitions
Available Tools
{
"tools": [
{
"name": "rpc/invoke",
"description": "Invoke rpc.do",
"inputSchema": {
/* ... */
}
},
{
"name": "rpc/query",
"description": "Query rpc.do resources",
"inputSchema": {
/* ... */
}
},
{
"name": "rpc/status",
"description": "Check rpc.do status",
"inputSchema": {
/* ... */
}
}
]
}Resources
Available Resources
{
"resources": [
{
"uri": "rpc://config",
"name": "Rpc Configuration",
"mimeType": "application/json"
},
{
"uri": "rpc://docs",
"name": "Rpc Documentation",
"mimeType": "text/markdown"
}
]
}Prompts
Pre-configured Prompts
{
"prompts": [
{
"name": "rpc-quick-start",
"description": "Quick start guide for rpc.do",
"arguments": []
},
{
"name": "rpc-best-practices",
"description": "Best practices for rpc.do",
"arguments": []
}
]
}Examples
Basic Usage
// AI model calls tool via MCP
mcp call rpc/connectWith Parameters
// Call with parameters
await mcp.callTool('rpc/invoke', {
operation: 'process',
parameters: {
// Operation-specific parameters
},
options: {
timeout: 30000,
},
})Error Handling
try {
const result = await mcp.callTool('rpc/invoke', {
operation: 'process',
})
return result
} catch (error) {
if (error.code === 'TOOL_NOT_FOUND') {
console.error('Rpc tool not available')
} else {
throw error
}
}AI Integration Patterns
Agentic Workflows
// AI agent uses rpc.do in workflow
const workflow = {
steps: [
{
tool: 'rpc/invoke',
operation: 'analyze',
input: 'user-data',
},
{
tool: 'rpc/process',
operation: 'transform',
input: 'analysis-result',
},
],
}Chain of Thought
AI models can reason about rpc.do operations:
User: "I need to process this data"
AI: "I'll use the rpc tool to:
1. Validate the data format
2. Process it through rpc.do
3. Return the results
Let me start..."
[Calls: mcp call rpc/connect]Server Implementation
Custom MCP Server
import { Server } from '@modelcontextprotocol/sdk/server/index.js'
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
const server = new Server(
{
name: 'rpc-server',
version: '1.0.0',
},
{
capabilities: {
tools: {},
resources: {},
prompts: {},
},
}
)
// Register tool
server.setRequestHandler('tools/call', async (request) => {
if (request.params.name === 'rpc/invoke') {
// Handle rpc.do operation
return {
content: [
{
type: 'text',
text: JSON.stringify(result),
},
],
}
}
})
const transport = new StdioServerTransport()
await server.connect(transport)Best Practices
- Tool Design - Keep tools focused and single-purpose
- Error Messages - Provide clear, actionable errors
- Documentation - Include examples in tool descriptions
- Rate Limiting - Implement appropriate limits
- Security - Validate all inputs from AI models
- Monitoring - Track tool usage and errors