panda

module
v0.18.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2026 License: MIT

README ΒΆ

🐼 Panda

Your gateway to the ethpandaops ecosystem. It's a CLI, an MCP server, and a sandboxed Python runtime that talks to ClickHouse, Prometheus, Loki, and Ethereum nodes so you don't have to wrangle credentials or know each API individually.

Read more: https://www.anthropic.com/engineering/code-execution-with-mcp

Architecture

β”Œβ”€ Your Machine ─────────────────────────────────────────────────┐
β”‚                                                                β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚   β”‚           β”‚  HTTP   β”‚ Server (Docker)                  β”‚   β”‚
β”‚   β”‚  Claude / β”œβ”€β”€β”€β”€β”€β”€β”€β”€β–Ίβ”‚                                  β”‚   β”‚
β”‚   β”‚  panda    β”‚   MCP   β”‚  MCP tools ─ execute_python      β”‚   β”‚
β”‚   β”‚           β”‚         β”‚             ─ manage_session      β”‚   β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚             ─ search              β”‚   β”‚
β”‚                         β”‚                                  β”‚   β”‚
β”‚                         β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚   β”‚
β”‚                         β”‚  β”‚ Sandbox (Docker)           β”‚  β”‚   β”‚
β”‚                         β”‚  β”‚                            β”‚  β”‚   β”‚
β”‚                         β”‚  β”‚  Python code executes here β”‚  β”‚   β”‚
β”‚                         β”‚  β”‚  No credentials, only a    β”‚  β”‚   β”‚
β”‚                         β”‚  β”‚  server token + API URL    β”‚  β”‚   β”‚
β”‚                         β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚   β”‚
β”‚                         β”‚            β”‚ calls back           β”‚   β”‚
β”‚                         β”‚β—„β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                     β”‚   β”‚
β”‚                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                        β”‚                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                         β”‚ GitHub OAuth
                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                              β”‚ Proxy               β”‚
                              β”‚ (remote or local)   β”‚
                              β”‚                     β”‚
                              β”‚  GitHub OAuth gate   β”‚
                              β”‚  + credentials for   β”‚
                              β”‚  all datasources     β”‚
                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                         β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β–Ό                    β–Ό                    β–Ό
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚ ClickHouse β”‚    β”‚  Prometheus  β”‚    β”‚  Loki / Eth  β”‚
             β”‚            β”‚    β”‚              β”‚    β”‚    nodes     β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Code runs on your machine. Credentials stay in the proxy. Sandbox containers never receive datasource credentials.

Getting Started

The server always runs locally on your machine. The two deployment modes differ only in where the credential proxy runs.

Prerequisites
  • Docker with the Compose plugin
  • A terminal
Install
curl -sSfL https://raw.githubusercontent.com/ethpandaops/panda/master/scripts/install.sh | sh

This installs the panda CLI to ~/.local/bin/.

Use the ethpandaops-hosted proxy at panda-proxy.ethpandaops.io. You get access to shared Xatu ClickHouse data, Prometheus, and Loki without managing any credentials.

# Set up everything: pull images, write config, authenticate, start server
panda init

# Verify
panda server status
panda datasources

panda init walks you through:

  1. Checking Docker and pulling the server + sandbox images
  2. Writing config files to ~/.config/panda/
  3. Opening a browser for GitHub OAuth login against the hosted proxy
  4. Starting the server container
Mode 2: Local Proxy (bring your own credentials)

Run your own proxy when you have direct access to datasource credentials (ClickHouse, Prometheus, Loki, etc.).

# 1. Initialize with your local proxy URL, skip hosted auth
panda init --proxy-url http://host.docker.internal:18081 --skip-auth

Note: The server runs inside a Docker container, so it cannot reach localhost on your host machine. Use host.docker.internal (macOS/Windows) or 172.17.0.1 (Linux) to point at a proxy running on your host.

# 2. Create a proxy config with your credentials
cat > proxy-config.yaml <<'EOF'
server:
  listen_addr: ":18081"
auth:
  mode: none
clickhouse:
  - name: my-cluster
    host: "clickhouse.example.com"
    port: 8443
    database: default
    username: "user"
    password: "pass"
    secure: true
EOF

# 3. Run the proxy (using the same Docker image)
docker run -d --name panda-proxy \
  -p 18081:18081 \
  -v $(pwd)/proxy-config.yaml:/config/proxy-config.yaml:ro \
  --entrypoint /app/panda-proxy \
  ethpandaops/panda:server-latest \
  --config /config/proxy-config.yaml

# 4. Verify
panda server status
panda datasources

See proxy-config.example.yaml for the full set of configurable datasources (Prometheus, Loki, Ethereum nodes, etc.).

Verify it works
panda datasources                          # List available datasources
panda execute --code 'print("hello")'      # Run Python in the sandbox

Client Setup

Claude Code β€” add to ~/.claude.json:

{
  "mcpServers": {
    "ethpandaops-panda": {
      "type": "http",
      "url": "http://localhost:2480/mcp"
    }
  }
}

Claude Desktop β€” add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "ethpandaops-panda": {
      "type": "http",
      "url": "http://localhost:2480/mcp"
    }
  }
}
Skills

Install agent skills for AI coding assistants:

npx skills add ethpandaops/panda              # all skills
npx skills add ethpandaops/panda --skill install-mcp    # register panda as an MCP server
npx skills add ethpandaops/panda --skill install-panda  # installation guide
Auth

The hosted proxy requires authentication via GitHub OAuth. If you used panda init with the default hosted proxy, auth is handled during setup. To re-authenticate or refresh:

panda auth login

Local proxies with auth.mode: none do not require authentication.

Server Management

panda server start      # Start the server container
panda server stop       # Stop the server container
panda server restart    # Restart the server container
panda server status     # Show container status and health
panda server logs       # Stream server logs
panda server update     # Pull latest images and restart

Development

cp config.example.yaml config.yaml
cp proxy-config.example.yaml proxy-config.yaml
make docker-sandbox
docker compose up -d
make build              # Build panda-server and panda
make build-proxy        # Build standalone proxy binary
make test               # Run tests with race detector
make lint               # Run golangci-lint
make docker             # Build server Docker image
make docker-sandbox     # Build sandbox image
make download-models    # Download embedding model for semantic search

See docs/architecture.md for the full boundary definition and docs/deployments.md for deployment modes.

License

MIT

Directories ΒΆ

Path Synopsis
cmd
panda command
proxy command
Package main provides the standalone proxy server entrypoint.
Package main provides the standalone proxy server entrypoint.
server command
internal
github
Package github provides a client for checking GitHub releases and a file-based cache for update notifications.
Package github provides a client for checking GitHub releases and a file-based cache for update notifications.
version
Package version provides build version information.
Package version provides build version information.
modules
cbt
pkg
app
Package app provides the shared application core used by both the MCP server and the CLI.
Package app provides the shared application core used by both the MCP server and the CLI.
auth
Package auth provides simplified GitHub-based OAuth for local product edges.
Package auth provides simplified GitHub-based OAuth for local product edges.
auth/client
Package client provides an OAuth PKCE client for local authentication.
Package client provides an OAuth PKCE client for local authentication.
auth/github
Package github provides GitHub OAuth integration.
Package github provides GitHub OAuth integration.
auth/store
Package store provides local credential storage for OAuth tokens.
Package store provides local credential storage for OAuth tokens.
cache
Package cache provides a generic key-value cache interface.
Package cache provides a generic key-value cache interface.
cli
Package cli provides the command-line interface for ethpandaops Ethereum analytics.
Package cli provides the command-line interface for ethpandaops Ethereum analytics.
config
Package config provides configuration loading for the MCP server.
Package config provides configuration loading for the MCP server.
embedding
Package embedding provides text embedding capabilities.
Package embedding provides text embedding capabilities.
module
Package module defines the base lifecycle contract for built-in integrations plus optional capability interfaces for docs, resources, sandbox env, and datasource metadata.
Package module defines the base lifecycle contract for built-in integrations plus optional capability interfaces for docs, resources, sandbox env, and datasource metadata.
observability
Package observability provides metrics capabilities for ethpandaops-panda.
Package observability provides metrics capabilities for ethpandaops-panda.
proxy
Package proxy provides the credential proxy for server-side upstream access.
Package proxy provides the credential proxy for server-side upstream access.
proxy/handlers
Package handlers provides reverse proxy handlers for each datasource type.
Package handlers provides reverse proxy handlers for each datasource type.
resource
Package resource provides MCP resource handlers for domain knowledge.
Package resource provides MCP resource handlers for domain knowledge.
sandbox
Package sandbox provides secure code execution in isolated containers.
Package sandbox provides secure code execution in isolated containers.
server
Package server provides the MCP server implementation for ethpandaops-panda.
Package server provides the MCP server implementation for ethpandaops-panda.
storage
Package storage provides local file storage for sandbox execution outputs.
Package storage provides local file storage for sandbox execution outputs.
tool
Package tool provides MCP tool registration and handling.
Package tool provides MCP tool registration and handling.
types
Package types provides shared types used across the MCP server and modules to avoid circular dependencies.
Package types provides shared types used across the MCP server and modules to avoid circular dependencies.
Package runbooks provides embedded runbook documents for procedural guidance.
Package runbooks provides embedded runbook documents for procedural guidance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL