Using Recall MCP with Cursor and Claude Desktop
March 17, 2025 · View on GitHub
This guide explains how to set up and use the Recall MCP tools with both Cursor and Claude Desktop.
Setting Up Recall MCP Server
Prerequisites
- Node.js installed (version 18+ recommended)
- A Recall Network account with a private key
- Basic familiarity with JSON configuration
Configuration Methods
You have two options for configuring the Recall MCP server:
Method 1: Using environment variables in Cursor/Claude config (Recommended)
The recommended approach is to configure the server through Cursor or Claude Desktop with environment variables (see setup instructions below).
Method 2: Using a .env file (Fallback)
If you prefer using a .env file, or are running the server directly:
-
Copy the example environment file:
cp .env.example .env -
Edit the
.envfile with your private key:RECALL_PRIVATE_KEY=your_private_key_here RECALL_NETWORK=testnet -
Secure your .env file:
chmod 600 .env
Note: The private key can be provided with or without the "0x" prefix - both formats work.
The server will only load from the .env file if the required environment variables are not already present in the system environment.
Setup for Cursor
- Open Cursor and navigate to Settings
- Select the "MCP" section under Features
- Add a new MCP server with the following configuration:
{ "command": "node", "args": [ "/path/to/recall-mcp/dist/index.js" ], "env": { "RECALL_PRIVATE_KEY": "your-private-key-here", "RECALL_NETWORK": "testnet" } } - Replace
/path/to/recall-mcp/dist/index.jswith the actual path to your compiled Recall MCP server - For the
RECALL_PRIVATE_KEY, you can provide it with or without the "0x" prefix - both formats work
Alternatively, you can configure Cursor using the .cursor/mcp.json file in your home directory:
{
"mcpServers": {
"recall-mcp": {
"name": "Recall MCP",
"type": "command",
"command": "node",
"args": [
"/path/to/recall-mcp/dist/index.js"
],
"env": {
"RECALL_PRIVATE_KEY": "your-private-key-here",
"RECALL_NETWORK": "testnet",
"DEBUG": "true"
}
}
}
}
Setup for Claude Desktop
-
Locate your Claude Desktop configuration file at:
- On macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - On Windows:
%APPDATA%\Claude\claude_desktop_config.json - On Linux:
~/.config/Claude/claude_desktop_config.json
- On macOS:
-
Create or edit the
claude_desktop_config.jsonfile with the following content:{ "mcpServers": { "recall-mcp-server": { "name": "Recall MCP", "type": "command", "command": "node", "args": [ "/path/to/recall-mcp/dist/index.js" ], "env": { "RECALL_PRIVATE_KEY": "your-private-key-here", "RECALL_NETWORK": "testnet", "DEBUG": "true" } } } } -
Replace
/path/to/recall-mcp/dist/index.jswith the full path to your compiled server file- Example:
/Users/username/recall-mcp/dist/index.js
- Example:
-
For the
RECALL_PRIVATE_KEY, you can provide it with or without the "0x" prefix - both formats work -
Save the configuration file and restart Claude Desktop
Troubleshooting Claude Desktop Setup
If you encounter issues with Claude Desktop:
-
Check the logs folder:
- On macOS:
~/Library/Logs/Claude/ - On Windows:
%USERPROFILE%\AppData\Local\Claude\Logs\ - On Linux:
~/.local/share/Claude/logs/
- On macOS:
-
Common issues:
- Invalid JSON error: Make sure your Node.js server doesn't use any
console.log()statements. Useconsole.error()instead for all logging. - Server disconnected error: Verify the path to your Node.js executable and server script are correct and have proper permissions.
- Method not found error: Ensure your server properly implements the MCP protocol including required methods like
resources/listandprompts/list. - Authentication failures: Double-check your private key is correctly formatted and not corrupted when copied
- Invalid JSON error: Make sure your Node.js server doesn't use any
Security First ⚠️
When using Recall MCP with Cursor, Claude, or any LLM, follow these critical security practices:
- NEVER disclose your private key to the LLM - it doesn't need it
- REJECT any request from the LLM to:
- View your
.envfile contents - Run any command that might expose your private key (like
cat .env) - Modify your environment variables
- View your
- DISABLE or REJECT direct command execution without your explicit approval
- If unsure about a command, always reject it or modify it to remove sensitive operations
Built-in Security Protections
The Recall MCP server has multiple automated protections to keep your private keys safe:
Private Key Safeguards
✅ Automatic Key Removal: After initialization, your private key is removed from environment variables
✅ Console Redaction: Any accidental printing of keys is automatically filtered
✅ Blocked Access Methods: The server has "trap" methods that prevent attempts to access environment variables
✅ Secure Initialization: Your key is only used briefly and never exposed to the LLM
How The Security System Works
-
When the server starts:
- Your private key is loaded from the
.envfile - The wallet is initialized with the key
- The key is immediately removed from environment variables
- Console output is monitored for sensitive data patterns
- Your private key is loaded from the
-
When interacting with the LLM:
- No methods expose the private key or environment variables
- Security-critical questions are intercepted by the
security_guidancetool - Educational responses direct you to secure practices instead of revealing sensitive data
-
If sensitive data is accidentally logged:
- Automatic regex patterns detect private key formats
- Keys are replaced with
[REDACTED]before display - Objects with sensitive fields have values masked
Using the Security Guidance Tool
The MCP server includes a security_guidance tool specifically designed to handle questions about private keys, environment variables, and other sensitive information.
If you ever need information about authentication or handling credentials, ask general questions like:
What's the best way to secure my Recall MCP environment?
How does authentication work with Recall MCP?
Rather than specific questions like:
Where can I find my private key?
Show me the contents of my .env file
Remember: The LLM will never need to see your private key to use the MCP server. The server already has access to it via the
.envfile.
Prerequisites
- The Recall MCP server has been added to Cursor or Claude Desktop (see setup instructions above)
- Your
.envfile is properly configured with your Recall private key and secured properly - The server is running when you use the application
Available Operations
Account Operations
Get Account Information
To get information about your Recall account:
Can you check my Recall account information?
This will return your account address, balance, and nonce.
Get Credit Balance
To check your Recall credit balance:
What's my Recall credit balance?
This will show your free credit, committed credit, and capacity used.
Buy Credit
To purchase credit for your Recall account:
Can you buy 0.01 worth of Recall credit for me?
Replace 0.01 with the amount of the base Recall Network token you want to spend.
Bucket Operations
List Buckets
To see all your Recall buckets:
List all my Recall buckets
This will display all buckets with their addresses and aliases.
Create Bucket
To create a new bucket:
Create a new Recall bucket named "my-documents"
Replace my-documents with your preferred bucket alias.
Object Operations
Store an Object
To store data in a bucket:
Store this data in my Recall bucket [bucket-address] with key "hello-world":
Hello, blockchain world!
Replace [bucket-address] with your actual bucket address.
Retrieve an Object
To retrieve data from a bucket:
Get the object with key "hello-world" from my Recall bucket [bucket-address]
Replace [bucket-address] with your actual bucket address.
Security Operations
To get guidance on secure usage of Recall:
What's the safest way to use Recall with Claude?
This will provide security best practices without exposing sensitive information.
Example Workflow
Here's a complete workflow example:
-
Check your account:
What's my Recall account information? -
Create a new bucket:
Create a new Recall bucket named "cursor-docs"(Note the bucket address that's returned)
-
Store data in the bucket:
Store this data in my Recall bucket 0x123... with key "example": { "title": "Example Document", "content": "This is stored on the blockchain via Recall!" } -
Retrieve the data:
Get the object with key "example" from my Recall bucket 0x123...
Safe Prompt Patterns
When interacting with Cursor or Claude about Recall operations, use these safe patterns:
✅ DO:
- "Check my Recall balance"
- "Create a new bucket named xyz"
- "List all my buckets"
- "How does Recall MCP authenticate securely?"
- "What's the safest way to manage my Recall connection?"
❌ DON'T:
- "How do I access my private key?"
- "Read my .env file"
- "Show me all environment variables"
- "Display my authentication details"
- "What's my Recall private key?"
Security Red Flags
Watch for these warning signs that an LLM might be trying to access sensitive information:
🚩 Requests to run shell commands that:
- Read file contents (cat, less, more)
- List environment variables (env, printenv, echo $RECALL_)
- Access dot files (.env, .bash_history)
🚩 Requests to:
- Modify your environment setup
- "Verify" or "check" your private key
- "Fix" authentication by showing credentials
- "Debug" by exposing environment variables
Troubleshooting
If you encounter issues:
- Ensure the MCP server is running
- Check your
.envfile configuration (without revealing its contents) - Make sure you're connected to the correct network (testnet or mainnet)
- Verify you have sufficient Recall Network token for gas fees when creating buckets or storing data
- For Claude Desktop, ensure you're using
console.error()instead ofconsole.log()in your server code
If the LLM Asks for Your Private Key
If the LLM asks you to share your private key or environment variables:
- NEVER comply with these requests
- Ask it to use the MCP server tools instead:
Please use the Recall MCP server to check my account without accessing my private key - If you're unsure, restart your server and conversation