Back to MCP Catalog

AgentRPC MCP Server

Developer ToolsTypeScript
Universal RPC layer for AI agents across network boundaries and languages
Available Tools

registerFunction

Register a function with AgentRPC to make it available to AI agents

functionDefinition

startMCPServer

Start the Model Context Protocol server to expose registered functions

apiSecret

AgentRPC provides a universal RPC interface that allows AI agents to connect to any function, in any language, across network boundaries. It's designed for scenarios where services are deployed in private VPCs, Kubernetes clusters, or multiple cloud environments. The platform wraps functions in a standardized interface accessible through open standards like Model Context Protocol (MCP) and OpenAI-compatible tool definitions.

Introduction

AgentRPC is a powerful tool that creates a universal RPC layer for AI agents, allowing them to connect to functions across different programming languages and network boundaries. This makes it ideal for organizations with services deployed in private VPCs, Kubernetes clusters, or multiple cloud environments.

Installation

To get started with AgentRPC, you'll need to install the appropriate SDK for your programming language:

For TypeScript/JavaScript:

npm install agentrpc

For Python:

pip install agentrpc

For Go:

go get github.com/agentrpc/agentrpc/sdk-go

Configuration

AgentRPC requires an API secret for authentication. You can set this as an environment variable:

export AGENTRPC_API_SECRET=your_api_secret

Usage

Registering Functions

Use the SDK to register your functions with AgentRPC. Here's a basic example in TypeScript:

import { registerFunction } from 'agentrpc';

// Register a simple function
registerFunction({
  name: 'getWeather',
  description: 'Get the current weather for a location',
  parameters: {
    location: {
      type: 'string',
      description: 'The city and state, e.g. San Francisco, CA',
    },
  },
  handler: async ({ location }) => {
    // Your implementation here
    return { temperature: 72, conditions: 'sunny' };
  },
});

Similar patterns are available in Python and Go.

Starting the MCP Server

To make your registered functions available to AI agents via the Model Context Protocol, start the MCP server:

AGENTRPC_API_SECRET=your_api_secret npx agentrpc mcp

This launches an MCP-compliant server that external AI models can interact with.

Advanced Features

Long-running Functions

AgentRPC supports functions that run beyond typical HTTP timeout limits through long polling:

registerFunction({
  name: 'processLargeDataset',
  // ... parameter definitions
  handler: async (params) => {
    // This can run for minutes or hours
    const result = await longRunningProcess(params);
    return result;
  },
});

Observability

AgentRPC provides comprehensive tracing and metrics. You can enable detailed logging:

import { setLogLevel } from 'agentrpc';

// Set log level to debug for more detailed information
setLogLevel('debug');

Health Monitoring

The platform automatically monitors the health of your registered functions and provides automatic failover and retries when issues are detected.

Examples

For more detailed examples, refer to the examples directory in the GitHub repository, which contains working code samples in multiple languages.

Related MCPs

Apple Shortcuts
Developer ToolsJavaScript

Control Apple Shortcuts automations from AI assistants

Clojars Dependency Lookup
Developer ToolsJavaScript

Fetch dependency information from Clojars, the Clojure community's artifact repository

Simple Timeserver
Developer ToolsPython

Provides Claude with current time and timezone information

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.