DISCOVER THE FUTURE OF AI AGENTS

claude-agent-server

Added Jan 26, 2026
Agent & Tooling
Open Source
TypeScriptAI AgentsWeb ApplicationBunAgent & ToolingDeveloper Tools & CodingProtocol, API & Integration

A WebSocket server that runs Claude Agent in a sandbox, enabling real-time bidirectional communication with Claude through WebSockets.

One Minute Overview#

Claude Agent SDK WebSocket Server is a tool that wraps the Claude Agent SDK and enables real-time bidirectional communication with Claude through WebSockets. It allows you to deploy the server in an E2B sandbox environment and connect to it via the TypeScript client library. This project is particularly suitable for developing Claude applications that require real-time interaction and code execution capabilities.

Core Value: Deploy Claude Agent in an isolated environment with real-time interaction capabilities through WebSockets, providing secure and controllable AI code execution.

Quick Start#

Installation Difficulty: Medium - Requires API key configuration and basic E2B concepts

# 1. Set up environment variables
echo "ANTHROPIC_API_KEY=sk-ant-your-api-key-here" >> .env
echo "E2B_API_KEY=e2b_your-api-key-here" >> .env

# 2. Install dependencies
bun install

# 3. Build E2B image
bun run build:e2b

# 4. Install client library
npm install @dzhng/claude-agent

Is this suitable for my scenario?

  • Real-time interaction applications: Scenarios requiring real-time conversation and code execution with Claude
  • Secure code execution: Applications that need to execute code in an isolated environment
  • Custom AI assistants: Developers building specific functional assistants based on Claude
  • Simple chatbots: Simple conversational applications that don't require code execution
  • Pure text processing: Text processing tasks that don't require real-time interaction and tool calling

Core Capabilities#

1. Sandbox Environment - Secure Isolation#

  • Runs Claude Agent in an E2B sandbox environment ensuring safe code execution
  • Each connection has its own execution environment preventing resource conflicts Actual Value: Can safely execute arbitrary code without affecting the host system

2. Real-time Bidirectional Communication - Instant Interaction#

  • Achieves real-time bidirectional communication with Claude through WebSockets
  • Supports instant message sending/receiving and streaming responses Actual Value: Provides near real-time user experience without waiting for complete responses

3. Configurable System Prompts - Custom Behavior#

  • Supports custom system prompts and preset templates
  • Configurable allowed tools and models Actual Value: Customize Claude's behavior and capabilities according to application requirements

4. Interrupt Support - Control Execution Flow#

  • Supports sending interrupt messages to stop current operations
  • Provides real-time control over AI execution flow Actual Value: Can promptly correct errors or change AI's behavior direction

5. Message Queue Processing - Ensure Reliability#

  • Implements message queuing to ensure sequential message processing
  • Supports session management and state maintenance Actual Value: Ensures reliable message delivery and processing in complex interaction scenarios

Technology Stack & Integration#

Development Language: TypeScript, HTML Runtime Environment: Bun Key Dependencies: E2B SDK, Anthropic SDK, WebSocket API Integration Method: Client Library / API / WebSocket

Ecosystem & Extensions#

  • Plugins/Extensions: Can add custom functionality by modifying server code
  • Integration Capabilities: Supports custom E2B templates with extensible system packages and startup scripts

Maintenance Status#

  • Development Activity: Project has clear update plans and documentation, good maintenance status
  • Recent Updates: Recent feature additions and documentation updates
  • Community Response: Has example code and test client support with active community feedback

Commercial & License#

License: MIT

  • ✅ Commercial: Commercial use allowed
  • ✅ Modification: Modification and distribution allowed
  • ⚠️ Restrictions: Must include original license and copyright notice

Documentation & Learning Resources#

Related Projects

View All

STAY UPDATED

Get the latest AI tools and trends delivered straight to your inbox. No spam, just intelligence.