Get the FREE Ultimate OpenClaw Setup Guide →

agentscope-runtime

A production-ready runtime framework for agent apps with secure tool sandboxing, Agent-as-a-Service APIs, scalable deployment, full-stack observability, and broad framework compatibility.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio agentscope-ai-agentscope-runtime python -m agentscope_runtime

How to use

AgentScope Runtime provides a production-grade platform for running agent applications. It exposes an AgentApp interface for developing streaming, production-grade APIs (AaaS) and a suite of sandboxing tools to execute diverse tools safely within a hardened environment. The server is framework-agnostic and designed for scalable deployment—whether locally, on Kubernetes, or serverless—so you can run agent-based workflows with strong observability, tooling, and lifecycle management. Common workflows include building an AgentApp that initializes state, handles queries via a streaming API (SSE), and supports graceful shutdowns, as well as leveraging the sandbox components to run Python, shell, GUI, browser, filesystem, and mobile tools in isolation. You can also deploy the server as an API service and access it via A2A, a response API, or an OpenAI-compatible SDK in compatible modes. Tools are sandboxed, aiding secure execution and auditing across agent interactions.

How to install

Prerequisites:

  • Python 3.10 or newer
  • Pip (comes with Python) or Python environment manager (e.g., pyenv, virtualenv)
  • Optional: Docker if you prefer containerized deployment

Install from PyPI:

pip install agentscope-runtime

Install from source (clone the repo and install in editable mode):

git clone https://github.com/agentscope-ai/agentscope-runtime.git
cd agentscope-runtime
pip install -e .

Run the server (local development):

python -m agentscope_runtime

If you prefer containerized deployment (Docker):

docker run -it --rm \
  -p 8000:8000 \
  -v $(pwd):/app \
  agentscope/agentscope-runtime:latest

Prerequisites summary:

  • Python 3.10+
  • network access to install PyPI packages or a local wheel
  • optional Docker for containerized runs

Additional notes

Tips and common considerations:

  • The runtime emphasizes sandboxed tool execution; configure the Sandbox components according to your security requirements.
  • Use the AgentApp development pattern (init → query → shutdown) to structure your agent flows for clarity and maintainability.
  • If exposing APIs publicly, enable observability (logs and traces) and consider deploying behind a gateway with authentication.
  • For local experimentation, the built-in WebUI (via the provided URL) can help you inspect runtime state and tool usage.
  • Environment variables (e.g., AGENTSCOPE_RUNTIME_CONFIG) can modify runtime behavior; document and version-control these settings to ensure reproducibility.

Related MCP Servers

Sponsor this space

Reach thousands of developers