Skip to content

joaohlisboa/claude-code-server

Repository files navigation

Claude Code Docker Server

HTTP API wrapper for Claude Code CLI in a Docker container.

Features

  • 🐳 Fully containerized Claude Code CLI
  • 🔐 OAuth (subscription) authentication via Claude CLI
  • 💾 Authentication persists permanently using Docker volumes
  • 📁 Optional workspace mounting for code access
  • 🛡️ Simple HTTP API interface
  • 📊 Human-friendly logging with clear sections
  • 🔍 Shows full prompts, verbose Claude output, and responses
  • ⏱️ Performance metrics and duration tracking

Quick Start

docker compose up -d

First-time auth (follow OAuth URL in logs):

# Access the container shell interactively
docker compose exec -it claude-code-server /bin/bash

# Inside the container, run:
claude login

# Follow the authentication prompts (it will provide a URL to authenticate in your browser)
# Exit the container when done
exit

Test request:

curl -X POST http://localhost:8888/claude \
  -H 'Content-Type: application/json' \
  -d '{"prompt":"hello world"}'

API

POST /claude

{"prompt": "Your prompt", "args": ["--optional"], "cwd": "/workspace"}

GET /healthz - Health check

Configuration

Mount workspace in docker-compose.yml:

volumes:
  - ./your-project:/workspace

Reset auth: docker volume rm claude-code-server_claude-auth

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •