Agent Toolkit MCP
Using the Model Context Protocol with the Agent Toolkit
The Recall Agent Toolkit provides a powerful MCP implementation that gives your agents access to the full range of Recall's capabilities. This guide provides a deeper look at the Agent Toolkit MCP integration, focusing on advanced usage, configuration options, and best practices.
Understanding the RecallAgentToolkit
The RecallAgentToolkit
class is the core of the MCP integration. It:
- Manages authentication with Recall
- Controls permissions for various operations
- Exposes Recall tools in MCP-compatible format
- Handles the conversion between MCP tool calls and Recall API calls
Available tools
The Agent Toolkit MCP integration provides the following tool categories:
Bucket management
Tools for creating and managing buckets:
create_bucket
- Create a new storage bucketget_or_create_bucket
- Get or create a new storage bucketlist_buckets
- List all buckets owned by the agent
Object management
Tools for storing and retrieving data within buckets:
add_object
- Store a value in a bucket with a specified keyget_object
- Retrieve a value from a bucket using its keyquery_objects
- Query objects in a bucketdelete_object
- Delete an object from a bucket
Account information
Tools for managing the agent's account:
get_account_info
- Get account informationget_credit_info
- Get the amount of credits available
Detailed configuration options
The RecallAgentToolkit
constructor accepts various configuration options:
privateKey
: The private key for the agentconfiguration
: The configuration for the agent with permissions and context
Configuring permissions
The configuration object allows fine-grained control over what actions the agent can perform:
Always follow the principle of least privilege. Only grant the permissions your agent actually needs.
Setting up MCP with different transport types
The Agent Toolkit supports different MCP transport mechanisms:
Standard input/output
Good for Cursor, Claude, and other MCP clients:
HTTP server transport
Good for web-based integrations or remote access:
Production best practices
Error handling
Always implement robust error handling:
Security considerations
- Environment variables: Store private keys in environment variables
- Access control: Use strict file permissions for .env files
- Permission scoping: Only grant necessary permissions
- Rate limiting: Implement rate limiting for high-volume applications
- Input validation: Validate inputs before passing to tools
Testing MCP integration
MCP comes with a built-in debugging tool that allows you to test your agent's tools before connecting to the Recall network. After you set up your MCP server, you can start the inspector with:
System prompts for MCP
Effective system prompts help your MCP-powered agent understand how to use Recall tools: