panda

module
v0.33.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 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

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              # the user-facing 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

The user-facing skills are install-panda, install-mcp, query, and investigate. The repo-contributor skills (self-play, create-runbook, create-module) are marked metadata.internal: true, so they stay in this repo for development and are excluded from npx skills add unless you set INSTALL_INTERNAL_SKILLS=1.

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.

Non-interactive deployments (bots, CI) can authenticate with an OIDC service account instead: set proxies[].auth.mode: "client_credentials" with issuer_url, client_id, username, and password (see config.example.yaml). Access tokens are minted on demand from the issuer's token endpoint and cached in memory only — no panda auth login and no credential files.

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

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
Package datasets ships dataset knowledge packs that describe how to query datasets stored in a generic transport (currently ClickHouse).
Package datasets ships dataset knowledge packs that describe how to query datasets stored in a generic transport (currently ClickHouse).
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.
githubapi
Package githubapi provides shared helpers for authenticated GitHub API requests and on-disk JSON caching.
Package githubapi provides shared helpers for authenticated GitHub API requests and on-disk JSON caching.
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.
attribution
Package attribution carries free-text caller attribution (who a request acts on behalf of) across panda's hops: CLI -> server -> proxy.
Package attribution carries free-text caller attribution (who a request acts on behalf of) across panda's hops: CLI -> server -> proxy.
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.
surface
Package surface defines how each client surface (MCP, CLI) addresses panda's capabilities.
Package surface defines how each client surface (MCP, CLI) addresses panda's capabilities.
tokenstore
Package tokenstore provides an in-memory registry of ephemeral runtime tokens.
Package tokenstore provides an in-memory registry of ephemeral runtime tokens.
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.
scripts
ccsmoke command
Pre-merge smoke test: exercise the client_credentials proxy client against the real staging Authentik + panda-proxy.
Pre-merge smoke test: exercise the client_credentials proxy client against the real staging Authentik + panda-proxy.

Jump to

Keyboard shortcuts

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