This MCP server implementation integrates Riza's isolated code interpreter with your LLM through the Model Context Protocol (MCP). It allows your AI assistant to execute code safely in an isolated environment and manage reusable tools.
Install the Riza MCP server using npm:
npm install @riza-io/riza-mcp
Before using the server, obtain a free Riza API key from your Riza Dashboard.
Configure the Riza MCP server in Claude Desktop by adding the following to your Claude Desktop configuration:
{
"mcpServers": {
"riza-server": {
"command": "npx",
"args": [
"@riza-io/riza-mcp"
],
"env": {
"RIZA_API_KEY": "your-api-key"
}
}
}
}
Replace "your-api-key"
with your actual Riza API key.
The Riza MCP server provides the following tools to your LLM:
Your LLM can execute arbitrary Python code (or other supported languages) in the Riza environment:
# Example of executing a simple Python script
result = execute_code("""
import pandas as pd
import matplotlib.pyplot as plt
# Create sample data
data = {'Category': ['A', 'B', 'C', 'D'],
'Values': [10, 25, 15, 30]}
df = pd.DataFrame(data)
# Create bar chart
plt.figure(figsize=(8, 5))
plt.bar(df['Category'], df['Values'])
plt.title('Sample Bar Chart')
plt.xlabel('Category')
plt.ylabel('Value')
plt.show()
""")
Create a reusable tool:
create_tool(
name="data_summarizer",
description="Summarizes a CSV file with basic statistics",
source="""
import pandas as pd
def run(file_path):
df = pd.read_csv(file_path)
summary = {
'column_count': len(df.columns),
'row_count': len(df),
'columns': list(df.columns),
'dtypes': df.dtypes.astype(str).to_dict(),
'summary_stats': df.describe().to_dict()
}
return summary
"""
)
Execute a saved tool:
# Using a previously created tool
result = execute_tool(
name="data_summarizer",
args={"file_path": "sales_data.csv"}
)
List available tools:
# Get a list of all saved tools
tools = list_tools()
Fetch and modify a tool:
# Get the source code of an existing tool
tool = fetch_tool(name="data_summarizer")
# Edit the tool to add additional functionality
edit_tool(
name="data_summarizer",
description="Summarizes a CSV file with enhanced statistics",
source=tool["source"] + """
# Add additional functionality to examine string columns
string_columns = df.select_dtypes(include=['object']).columns
for col in string_columns:
summary['unique_values_' + col] = df[col].nunique()
"""
)
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "riza-server" '{"command":"npx","args":["@riza-io/riza-mcp"],"env":{"RIZA_API_KEY":"your-api-key"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"riza-server": {
"command": "npx",
"args": [
"@riza-io/riza-mcp"
],
"env": {
"RIZA_API_KEY": "your-api-key"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"riza-server": {
"command": "npx",
"args": [
"@riza-io/riza-mcp"
],
"env": {
"RIZA_API_KEY": "your-api-key"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect