RI

Riza MCP Server: LLM Arbitrary Code Execution Platform

Deploy Riza MCP server to enable LLM arbitrary code execution and tool use with secure, scalable runtime control.

Quick Install
npx -y @riza-io/riza-mcp

Overview

Riza MCP Server exposes Riza’s isolated code interpreter as an MCP (Model Context Protocol) server so LLMs can securely generate, persist, and execute code as first-class “tools”. Instead of granting an LLM direct shell access, the MCP server wraps Riza’s API and presents a controlled set of endpoints (create, edit, run, list, fetch tools, and ad‑hoc code execution) that an LLM client can call. This enables workflows like on‑the‑fly tool creation, repeatable code execution, and safe evaluation without persisting sensitive payloads locally.

This approach is useful when you want LLM-driven automation or tool invention while retaining runtime isolation, auditability, and resource controls provided by Riza. It integrates into MCP-compatible clients (for example, Claude Desktop) and requires a Riza API key to authenticate calls to the Riza platform.

Features

  • Exposes Riza API endpoints as MCP tools for LLM use
  • Create, edit, list, and fetch persisted tools (source + metadata)
  • Execute persisted tools securely on Riza’s isolated interpreter
  • Execute one-off arbitrary code on Riza without saving it as a tool
  • Simple plug‑and‑play MCP server you can run with npx or as a service
  • Environment-driven configuration (RIZA_API_KEY) for easy deployment

Installation / Configuration

Requirements:

  • Node.js (to run via npx) or container runtime if packaging
  • Riza API key (get one from your Riza Dashboard)

Run directly with npx:

# Run the MCP server locally using npx
RIZA_API_KEY="your-api-key" npx @riza-io/riza-mcp

Install globally (optional):

npm install -g @riza-io/riza-mcp
RIZA_API_KEY="your-api-key" riza-mcp

Example MCP client configuration (Claude Desktop-style mcpServers block):

{
  "mcpServers": {
    "riza-server": {
      "command": "npx",
      "args": [
        "@riza-io/riza-mcp"
      ],
      "env": {
        "RIZA_API_KEY": "your-api-key"
      }
    }
  }
}

If deploying as a service, ensure the RIZA_API_KEY is supplied securely via environment management or secret storage. You can also run the server in containers or orchestrated environments — the server only needs outbound network access to the Riza API endpoints.

Available Tools

The MCP server exposes the following tools/endpoints to your LLM client. This table summarizes each tool and its purpose:

Tool namePurpose
create_toolSave new code as a named Riza tool (includes metadata and source).
fetch_toolRetrieve a saved tool’s metadata and source code for inspection or editing.
edit_toolModify an existing saved tool on Riza (update source or metadata).
list_toolsList saved tools available in your Riza account (IDs, names, basic meta).
execute_toolExecute a saved tool on Riza’s secure code interpreter and return output.
execute_codeRun arbitrary code immediately on Riza’s interpreter without persisting it.

Each tool maps to corresponding Riza API endpoints; the MCP server handles authentication (via RIZA_API_KEY) and request/response translation for the MCP client.

Use Cases

  • Ad-hoc code execution: Ask an LLM to run a quick Python snippet (data parsing, small computation) using execute_code so no code is persisted locally.

    • Example: “Normalize this CSV, compute averages, and return JSON.” The LLM composes a script, calls execute_code, and returns results.
  • Tool generation for repeated tasks: Generate a reusable tool (create_tool) such as “fetch_and_clean_sales_data” that can be invoked repeatedly with different parameters via execute_tool.

    • Flow: LLM creates tool -> tool saved to Riza -> future prompts call execute_tool with args.
  • Safe editing and iteration: Fetch an existing tool with fetch_tool, have the LLM suggest edits, apply changes with edit_tool, and re-run to validate behavior. This supports iterative development loops that remain auditable.

  • Integrating into agent workflows: Use list_tools to discover available tools and orchestrate multi‑step agents that call specific saved utilities (e.g., analysis, format conversion) while the runtime stays sandboxed.

  • CI or automation helpers: Offload short-lived scripted tasks (unit checks, file transformations) to Riza via execute_code, isolating side effects from your CI host.

Security & Best Practices

  • Keep your RIZA_API_KEY secret and rotate regularly.
  • Use execute_code for ephemeral execution when you do not want code saved.
  • Limit the LLM’s permissions in your MCP client if it supports per-tool scoping.
  • Monitor logs and Riza usage quotas to detect unexpected activity.
  • Prefer persisted tools for repeatable, reviewed operations; prefer ad‑hoc execute_code for exploratory tasks.

Troubleshooting

  • Authentication errors: verify RIZA_API_KEY is set and valid for the target account.
  • Timeouts: long-running scripts may hit execution or client timeouts — increase limits or break tasks into smaller runs.
  • Tool not found: confirm the tool ID/name via list_tools before calling execute_tool.

For complete API references and advanced usage, see the Riza API docs in your Riza Dashboard and the repository README at https://github.com/riza-io/riza-mcp.