Skip to content
wenisch-techPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Gofer

CI License: AGPL v3 Container

A package manager for AI agents that have no internet. Your agents run in an air-gapped environment and keep needing binaries: a JDK to run the tests, then Maven, then git, jq, Python... Instead of baking a fixed set of tools into every image, point the agents at Gofer. They ask for what they need; you see the request, upload the binary once and approve it, and from then on every agent can fetch it with a plain curl.

It is a guardrail as much as a convenience: nothing reaches an agent unless a human approved it, and the catalog grows with real demand.

How it works

sequenceDiagram
    participant A as Agent (air-gapped)
    participant G as Gofer
    participant H as You (web UI)
    participant S as S3 bucket
    A->>G: request_binary("maven", reason: "run the tests")
    G-->>A: not available yet, requestId 7 - poll check_request
    G->>H: new request appears live (agent, what, why)
    H->>S: upload apache-maven-3.9.6-bin.tar.gz, approve
    G-->>A: tools/list_changed: new tool get_maven
    A->>G: check_request(7)
    G-->>A: curl -fSL -o ... '<signed link>' && sha256sum -c -
    A->>G: GET /dl/... (Gofer streams it from S3)
Loading
  1. Agents ask over MCP (Streamable HTTP) or A2A. A binary that is already approved is answered on the spot, with a curl command, a time-limited link and a checksum.
  2. You decide. Unknown binaries land in the web UI, grouped by name, with the agent, the version and the reason it gave. Upload the file and approve it, or decline with a note the agent will read.
  3. The catalog grows. An approved binary is offered to everyone. The MCP tool list changes live: one get_<name> tool per binary, described by what it does. Waiting requests are answered automatically.
  4. Agents only need to reach Gofer. Downloads are proxied from S3, so agents never see the bucket.

Quick start

You need an S3-compatible bucket (MinIO, Ceph, RustFS, AWS...). Gofer creates the bucket on first start if it does not exist.

docker run -d --name gofer -p 8080:8080 \
  --read-only --tmpfs /tmp --cap-drop ALL --security-opt no-new-privileges \
  -v gofer-data:/app/data \
  -e S3_ENDPOINT_URL=http://minio.internal:9000 \
  -e S3_ACCESS_KEY=... -e S3_SECRET_KEY=... \
  -e ADMIN_PASSWORD='choose-one' \
  ghcr.io/wenisch-tech/gofer:latest

Open http://localhost:8080 and sign in as admin@gofer.local. Without ADMIN_PASSWORD the password is admin: change it before you expose Gofer to anything.

Then, in the UI:

  1. Agents → create a token for each agent (it is shown once).
  2. Connect → copy the MCP or A2A settings into the agent.

A docker-compose.yml with the same hardening is included.

Connecting agents

MCP

claude mcp add --transport http gofer https://gofer.example.com/mcp \
  --header "Authorization: Bearer gfr_..."

or in a .mcp.json:

{ "mcpServers": { "gofer": { "type": "http", "url": "https://gofer.example.com/mcp",
                             "headers": { "Authorization": "Bearer gfr_..." } } } }

The agent gets four fixed tools plus one per approved binary:

Tool What it does
search_binaries(query) What can be downloaded right now.
request_binary(name, version?, os?, arch?, reason?) Ask for something. Answered immediately if it exists, otherwise a human is asked and a requestId comes back.
check_request(requestId) Poll a request: still waiting, declined (with the reason), or the download instructions.
get_binary(name, version?, os?, arch?) Download instructions for an available binary.
get_<name>(version?, os?, arch?) One per approved binary, with a description of what it is for. Appears and disappears as you approve and withdraw.

Version arguments accept 17, 3.9, >=3.8, ~1.2. Without a platform, linux/amd64 is assumed.

A2A

Gofer publishes an agent card at /.well-known/agent-card.json and speaks JSON-RPC at /a2a (protocol 0.3, bearer token). A request for a binary that needs a human becomes a task that stays submitted until you answer, then turns completed with the download instructions as an artifact:

curl -s https://gofer.example.com/a2a -H 'Authorization: Bearer gfr_...' -H 'Content-Type: application/json' -d '{
  "jsonrpc": "2.0", "id": 1, "method": "message/send",
  "params": { "message": { "role": "user", "messageId": "1",
    "parts": [{ "kind": "data", "data": { "name": "maven", "version": "3.9", "reason": "run the tests" } }] } } }'
# later: {"method": "tasks/get", "params": {"id": "<task id>"}}

Supported: message/send, tasks/get, tasks/cancel. Plain text works too ("I need maven 3.9 for linux", "search java"), but it is parsed with simple rules; send a data part when precision matters. Streaming and push notifications are not supported (the card says so).

What the agent receives

jq 1.7.1 (linux/amd64, 30.1 KB)
Fast, lightweight command-line JSON processor.

Download (link valid until 2026-12-01T00:00:51Z):
curl -fSL -o jq-1.7.1-linux-amd64 'https://gofer.example.com/dl/1/jq-1.7.1-linux-amd64?exp=...&sig=...' \
  && echo '69b7552c...  jq-1.7.1-linux-amd64' | sha256sum -c -

Usage:
chmod +x ./jq-1.7.1-linux-amd64
./jq-1.7.1-linux-amd64 --version

The catalog and the bucket

Uploads through the UI are stored as <prefix>/<tool>/<version>/<os>-<arch>/<file> (default prefix binaries).

You can also put files into the bucket yourself, with s3webui, mc or anything else. Gofer rescans every ten minutes (and on Rescan bucket) and lists new files as discovered, to be approved by you. Files that disappear from the bucket stop being served. A file in a folder takes the folder name as its tool (maven/apache-maven-3.9.6-bin.tar.gz is maven, with apache-maven as an alias); otherwise tool, version and platform are read from the file name.

For every file Gofer works out, without any AI:

  • what it is and which platform it targets, from the magic bytes (ELF, Mach-O, PE, scripts) and the file name;
  • for tar.gz, zip and jar files, what is inside, including the commands in bin/ (they become aliases: asking for mvn finds Maven);
  • a SHA-256 checksum, and a usage snippet to unpack it and put it on PATH.

Editing a description in the UI locks it: neither the AI nor a rescan will overwrite your wording.

AI descriptions

Optionally, a model can describe each binary: what it is for, what it can do, which names agents may use for it, what it needs. Those descriptions become the MCP tool descriptions agents read to decide what helps them. Any OpenAI-compatible endpoint works: vLLM, Ollama, LiteLLM, LocalAI, Azure or OpenAI itself.

GOFER_AI_ENABLED=true
SPRING_AI_OPENAI_BASE_URL=http://vllm.internal:8000/v1   # include the /v1
SPRING_AI_OPENAI_CHAT_OPTIONS_MODEL=qwen2.5-coder
SPRING_AI_OPENAI_API_KEY=...                              # optional for servers that need none

The model sees only facts about the file (name, size, type, platform, archive listing) and treats them as untrusted data. Its answer is trimmed and sanitised before it is stored, and you can edit it, so a hostile file name cannot write instructions into what agents read. If the model is down, Gofer falls back to the plain description and never replaces a good one with a worse one.

Security model

  • Approval is the guardrail. Nothing is offered to an agent until an admin approves it. Discovered files wait. GOFER_AUTO_APPROVE_DISCOVERED turns that off; leave it off unless the bucket is yours alone.
  • One token per agent (gfr_...), stored only as a SHA-256 hash and shown once. Tokens identify who asked for what and can be disabled or rotated independently. /mcp, /a2a and downloads all need one.
  • Download links are signed (HMAC-SHA256 over artifact, expiry, agent, channel and request) and expire after GOFER_DOWNLOAD_URL_TTL (one hour). The signing key is generated into the data directory or set with GOFER_SIGNING_KEY. A bearer token works instead of a link.
  • Agents never see S3. Gofer streams the file, with Content-Length and an X-Checksum-SHA256 header, and records every download.
  • Web UI: local admin account, optional OIDC (Keycloak, Authelia...), CSRF protection. DISABLE_AUTHENTICATION=true removes the login; only use it behind a trusted network boundary. Agent tokens are still required.
  • Outbound TLS is not verified by default. Air-gapped sites usually run private CAs and self-signed certificates, so S3, the AI endpoint and OIDC accept any certificate unless told otherwise. That is convenient and weaker; set GOFER_INSECURE_SKIP_TLS_VERIFY=false to verify, optionally with GOFER_EXTRA_CA_CERTS=/path/ca.pem to trust your own CA. Each of the three can be set individually (S3_, AI_, OIDC_INSECURE_SKIP_TLS_VERIFY). A warning is logged for every component running unverified.
  • The container is unprivileged: UID 65532, no capabilities, read-only root file system, no service account token in Kubernetes.

Binaries you approve run on your agents. Gofer verifies nothing about their contents beyond what you can see in the catalog; the checksum protects the transfer, not the origin.

Configuration

Everything is an environment variable.

Storage

Variable Default Meaning
S3_ENDPOINT_URL (AWS) Endpoint of your S3-compatible storage. Path-style access is always used.
S3_ACCESS_KEY / S3_SECRET_KEY Credentials. Empty uses the default AWS provider chain.
S3_REGION us-east-1
S3_BUCKET gofer Created on first start when missing (S3_CREATE_BUCKET=false to prevent it).
S3_PREFIX binaries Key prefix for everything Gofer manages.

Agents and catalog

Variable Default Meaning
GOFER_PUBLIC_URL (derived) The address agents use to reach Gofer; download links are built from it. Derived from each request when empty, which needs correct X-Forwarded-* headers behind a proxy.
GOFER_DOWNLOAD_URL_TTL 1h How long a download link stays valid.
GOFER_SIGNING_KEY (generated) Key for the links.
GOFER_SCAN_INTERVAL 10m How often the bucket is scanned.
GOFER_AUTO_APPROVE_DISCOVERED false Offer files found in the bucket without approval.
GOFER_MAX_UPLOAD_SIZE 4GB Largest upload through the UI.
GOFER_MCP_SESSION_IDLE_TIMEOUT 30m Sessions of vanished agents are dropped after this long without traffic.
GOFER_SHUTDOWN_TIMEOUT 10s How long a restart waits for open requests. Agents hold event streams open, so it is kept short.

TLS and AI

Variable Default Meaning
GOFER_INSECURE_SKIP_TLS_VERIFY true Default for the three components below.
S3_INSECURE_SKIP_TLS_VERIFY / AI_INSECURE_SKIP_TLS_VERIFY / OIDC_INSECURE_SKIP_TLS_VERIFY (the above) Per component.
GOFER_EXTRA_CA_CERTS PEM bundle of CAs to trust when verification is on.
GOFER_AI_ENABLED false Use a model to describe binaries.
SPRING_AI_OPENAI_BASE_URL OpenAI-compatible endpoint, including /v1.
SPRING_AI_OPENAI_API_KEY
SPRING_AI_OPENAI_CHAT_OPTIONS_MODEL Required with AI enabled.

Web UI

Variable Default Meaning
ADMIN_EMAIL / ADMIN_PASSWORD admin@gofer.local / admin The administrator created on first start.
DISABLE_AUTHENTICATION false No login for the web UI.
OIDC_ENABLED, OIDC_ISSUER_URI, OIDC_CLIENT_ID, OIDC_CLIENT_SECRET, OIDC_REQUIRED_ROLE, OIDC_ADDITIONAL_SCOPES, OIDC_CREATEUSERS Single sign-on, as in s3webui. More than one provider: OIDC_PROVIDERS_0_NAME, ..._CLIENT_ID, ..._ISSUER_URI, ...
APP_DATA_DIR ./data (/app/data in the image) H2 database and signing key.
SPRING_DATASOURCE_URL and friends embedded H2 Standard Spring datasource settings.
GOFER_METRICS_PROMETHEUS_ENABLED false Expose /actuator/prometheus.

Docker

docker build -t gofer .            # after `mvn package`; the image copies target/gofer-*.jar

The image is based on a minimal JRE image and runs as UID 65532. Mount a volume on /app/data (it is owned by that user) and give /tmp room for your largest binary: uploads are staged there, streamed to S3 in parts, and never held in memory. A gigabyte upload runs in a 768 MiB container; Gofer needs about 500 MiB at rest.

Helm chart

helm install gofer oci://ghcr.io/wenisch-tech/helm-charts/gofer \
  --set env.S3_ENDPOINT_URL=http://minio.storage.svc:9000 \
  --set secrets.S3_ACCESS_KEY=... --set secrets.S3_SECRET_KEY=... \
  --set secrets.ADMIN_PASSWORD=...

The chart runs one replica (the embedded database allows a single writer and MCP sessions live in memory) as a non-root pod: runAsNonRoot with UID 65532, all capabilities dropped, read-only root file system, RuntimeDefault seccomp, no service account token. It mounts a PVC for the data directory and an emptyDir for /tmp. See charts/gofer/values.yaml; values can come from env, from a chart-managed secrets entry, or from your own Secrets through existingSecrets.

Behind an NGINX ingress, large uploads and long-lived MCP streams need:

ingress:
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: "0"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-buffering: "off"

Metrics and statistics

The Statistics page shows downloads per day, the most downloaded tools and the busiest agents, unmet demand (what agents keep asking for that nobody has provided), the request funnel, how long agents wait for you, and a download log that exports as CSV.

With GOFER_METRICS_PROMETHEUS_ENABLED=true, /actuator/prometheus serves (without a login, like the health endpoints) gofer_downloads_total{tool,outcome}, gofer_download_bytes_total{tool}, gofer_requests{status} and gofer_catalog_artifacts{status}. Health probes are at /actuator/health/liveness and /readiness.

Development

Java 25, Maven, Node (the frontend plugin downloads its own). The UI is Thymeleaf with Alpine.js and Tailwind, bundled into the jar by npm run build.

mvn verify                                   # frontend tests, Java tests, jacoco report
docker run -d -p 9000:9000 -e MINIO_ROOT_USER=minioadmin -e MINIO_ROOT_PASSWORD=minioadmin <a MinIO image> server /data
S3_ENDPOINT_URL=http://localhost:9000 S3_ACCESS_KEY=minioadmin S3_SECRET_KEY=minioadmin mvn spring-boot:run

The tests include integration tests that run real MCP and A2A sessions against the application over HTTP (with the bucket mocked), and tests for the outbound TLS behaviour against real self-signed endpoints.

License

GNU AGPL v3

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages