mcpbeat Sign in

Use Native Credential Proxy Skill for Claude

Opt out of the OneCLI gateway and supply Anthropic credentials from .env instead. For users who want simple .env-based credential management without the OneCLI agent vault. Reads the API key or OAuth token from .env and injects it into the container's API requests.

5k tokens
context cost
the whole folder, loaded on every use
5
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
30420
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/nanocoai/nanoclaw --skill use-native-credential-proxy

The instruction itself

20 sections, as written by the author

Use Native Credential Proxy

This skill adds a native, .env-based credential path for the container agent — an explicit opt-out of the OneCLI gateway. With it enabled, NanoClaw reads the Anthropic credential straight from .env and threads it into the container as standard environment variables, which the Claude Agent SDK reads natively. No OneCLI vault, no HTTPS proxy, no certificates.

> Credential-home inversion — read this first. NanoClaw's default is that credentials live in the OneCLI agent vault and are injected per request, never threaded into the container via -e. This skill deliberately inverts that: the credential lives in .env on the host and is passed into the container's environment. That inversion is the *entire point* of this skill (simple .env credentials without OneCLI). Use it only if you accept that tradeoff; everywhere else in NanoClaw, env-threaded credentials are an anti-pattern.

The skill is additive: it ships its proxy logic and tests in this folder, copies them into src/, and makes a single one-line reach-in at the container-spawn seam (gated by an env flag). It does not remove or rewrite the OneCLI gateway — when the flag is unset, the gateway path is exactly as it was, and the native proxy is a no-op.

How it works

  • src/native-credential-proxy.ts exports nativeCredentialEnvArgs(). It reads ANTHROPIC_API_KEY / ANTHROPIC_AUTH_TOKEN / CLAUDE_CODE_OAUTH_TOKEN (and optional ANTHROPIC_BASE_URL) from .env via core's readEnvFile, and returns the Docker -e VAR=value arguments.
  • All gating lives inside that function: it returns an empty array unless NANOCLAW_NATIVE_CREDENTIALS=true. So the reach-in in core is a single unconditional args.push(...nativeCredentialEnvArgs()).
  • The seam is buildContainerArgs in src/container-runner.ts, right after the TZ env line — the same place container env vars are assembled, just before the OneCLI gateway is applied. With the flag on, the direct credential env vars take precedence in the container; with it off, nothing changes.

Phase 1: Pre-flight

Check if already applied

test -f src/native-credential-proxy.ts && grep -q 'nativeCredentialEnvArgs' src/container-runner.ts && echo applied || echo not-applied

If it prints applied, the native proxy is already wired — skip to Phase 3 (Configure).

Confirm the seam exists

grep -n "args.push('-e', \`TZ=" src/container-runner.ts

This should print the TZ env line inside buildContainerArgs. If it does not, the file has drifted — read buildContainerArgs in src/container-runner.ts and find the spot where container -e env vars are first pushed; the reach-in goes there.

Phase 2: Apply code changes

Copy the skill's source and tests into src/

S=.claude/skills/use-native-credential-proxy
cp $S/native-credential-proxy.ts              src/native-credential-proxy.ts
cp $S/native-credential-proxy.test.ts         src/native-credential-proxy.test.ts
cp $S/native-credential-proxy-wiring.test.ts  src/native-credential-proxy-wiring.test.ts

native-credential-proxy.test.ts is the behavior test (it drives nativeCredentialEnvArgs() against a real .env read through core's readEnvFile). native-credential-proxy-wiring.test.ts asserts the one-line reach-in is present in buildContainerArgs.

Import the proxy in src/container-runner.ts

Add this import alongside the other local imports (e.g. right after the ./container-config.js import):

import { nativeCredentialEnvArgs } from './native-credential-proxy.js';

Make the one-line reach-in

In buildContainerArgs, find the TZ env line and add the call right after it:

  args.push('-e', `TZ=${TIMEZONE}`);
  args.push(...nativeCredentialEnvArgs());

That is the only edit to core. native-credential-proxy-wiring.test.ts asserts this args.push(...nativeCredentialEnvArgs()) call exists inside buildContainerArgs — delete the reach-in and it goes red.

Add the env flag stub to .env.example

Append to .env.example:

# Native credential proxy (.claude/skills/use-native-credential-proxy)
# Opt out of the OneCLI gateway and supply Anthropic credentials from .env.
# When true, the credential below is injected into the container env directly.
# NANOCLAW_NATIVE_CREDENTIALS=true
# One of the following is required when the flag is true:
# ANTHROPIC_API_KEY=
# CLAUDE_CODE_OAUTH_TOKEN=
# Optional custom endpoint:
# ANTHROPIC_BASE_URL=https://api.anthropic.com

Validate

pnpm run build
pnpm exec vitest run src/native-credential-proxy.test.ts src/native-credential-proxy-wiring.test.ts

The build must be clean and both tests must pass. The build leg confirms the proxy's import of core's readEnvFile still resolves; the behavior test confirms the .env-e injection; the wiring test confirms the reach-in into buildContainerArgs is in place.

Phase 3: Configure credentials

Ask the user (multiple choice): do they want to use their Claude subscription (Pro/Max) or an Anthropic API key?

  • Claude subscription (Pro/Max) — uses an existing Claude Pro or Max subscription. They run claude setup-token in another terminal to mint a token.
  • Anthropic API key — pay-per-use API key from console.anthropic.com.

Subscription path

Tell the user to run claude setup-token in another terminal and copy the token it outputs. Do NOT collect the token in chat.

Once they have it, add it to .env along with the opt-out flag:

grep -q '^NANOCLAW_NATIVE_CREDENTIALS=' .env && sed -i.bak 's/^NANOCLAW_NATIVE_CREDENTIALS=.*/NANOCLAW_NATIVE_CREDENTIALS=true/' .env && rm -f .env.bak || echo 'NANOCLAW_NATIVE_CREDENTIALS=true' >> .env
echo 'CLAUDE_CODE_OAUTH_TOKEN=<token>' >> .env

ANTHROPIC_AUTH_TOKEN is also accepted as an alternative to CLAUDE_CODE_OAUTH_TOKEN.

API key path

Tell the user to get an API key from https://console.anthropic.com/settings/keys if they don't have one, then:

grep -q '^NANOCLAW_NATIVE_CREDENTIALS=' .env && sed -i.bak 's/^NANOCLAW_NATIVE_CREDENTIALS=.*/NANOCLAW_NATIVE_CREDENTIALS=true/' .env && rm -f .env.bak || echo 'NANOCLAW_NATIVE_CREDENTIALS=true' >> .env
echo 'ANTHROPIC_API_KEY=<key>' >> .env

Optional custom endpoint

For a custom API endpoint, add ANTHROPIC_BASE_URL=<url> to .env (it is forwarded into the container when present; defaults to https://api.anthropic.com).

Phase 4: Restart and verify

Restart the service

Run from your NanoClaw project root:

source setup/lib/install-slug.sh
launchctl kickstart -k gui/$(id -u)/$(launchd_label)  # macOS
# Linux: systemctl --user restart $(systemd_unit)
# WSL/manual: stop and re-run bash start-nanoclaw.sh

Verify

Send a test message in a registered chat and confirm the agent responds. If the container starts and the agent answers, the credential is reaching the API.

Troubleshooting

Container fails to spawn with "no Anthropic credential found in .env": NANOCLAW_NATIVE_CREDENTIALS=true is set but none of ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, or CLAUDE_CODE_OAUTH_TOKEN is present in .env. Add one.

401 errors from the API: The credential in .env is invalid or expired. For a subscription token, re-run claude setup-token and update CLAUDE_CODE_OAUTH_TOKEN. For an API key, check it at console.anthropic.com.

Agent still goes through OneCLI: Confirm NANOCLAW_NATIVE_CREDENTIALS=true is in .env and the service was restarted. With the flag unset, nativeCredentialEnvArgs() is a no-op and the OneCLI gateway remains the credential source.

Removal

See REMOVE.md — it deletes the copied files, removes the reach-in and import, strips the .env keys, and restarts.

Other skills for the same job

different authors, same section of the catalogue
Fhir Developer Skill
by anthropics
vendor ×1

> FHIR REST endpoints (Patient, Observation, Encounter, Condition, MedicationRequest), (2) Validating FHIR resources and returning proper HTTP status codes and error responses, (3) Implementing SMART on FHIR authorization and OAuth scopes, (4) Working with Bundles, transactions, batch operations, or search pagination. Covers FHIR R4 resource structures, required fields, value sets (status codes, gender, intent), coding systems (LOINC, SNOMED, RxNorm, ICD-10), and OperationOutcome error handling.

9k tokens scripts
Clawdirect
by ComeOnOliver
×1

Interact with ClawDirect, a directory of social web experiences for AI agents. Use this skill to browse the directory, like entries, or add new sites. Requires ATXP authentication for MCP tool calls. Triggers: browsing agent-oriented websites, discovering social platforms for agents, liking/voting on directory entries, or submitting new agent-facing sites to ClawDirect.

4k tokens
Audit Integrity
by github
vendor

Shared audit integrity framework for all AppSec agents — enforces output quality, intellectual honesty, and continuous improvement through anti-rationalization guards, self-critique loops, retry protocols, non-negotiable behaviors, self-reflection quality gates (1-10 scoring, ≥8 threshold), and a self-learning system with lesson/memory governance for security analysis agents.

4k tokens
Zoom General
by anthropics
vendor

Cross-product Zoom reference skill. Use after the workflow is clear when you need shared platform guidance, app-model comparisons, authentication context, scopes, marketplace considerations, or API-vs-MCP routing.

122k tokens
Vuln Scan
by anthropics
vendor

>- Static source-code vulnerability scan. Reads a target directory (and THREAT_MODEL.md if present), spawns parallel review subagents per focus area, and writes VULN-FINDINGS.json + .md for /triage to consume. Read-only — no building, running, or network. For execution-verified crashes, use vuln-pipeline instead. Use when asked to "scan for vulns", "review this code for security issues", "find bugs in <dir>", or as the step between /threat-model and /triage.

3k tokens
Hunt Session
by elementalsouls

Hunt Session Management vulnerabilities — session fixation (no regeneration on login), insufficient invalidation on logout / password-change / email-change, predictable or low-entropy session IDs, JWT-as-session with no exp/revocation, refresh-token rotation/reuse-detection gaps, OAuth/SSO session linkage, device-bound-session (DBSC) downgrade, and cookie attribute issues (Secure/HttpOnly/SameSite/__Host-). Validate with TWO real sessions (attacker A + victim B), body-diff every 200, and OOB confirmation for theft chains. Medium to Critical (fixation→admin hijack, no-invalidation→persistent ATO).

5k tokens
Doca Aes Gcm
by NVIDIA
vendor

> Use this skill when the user is doing hands-on DOCA AES-GCM work on a BlueField DPU or ConnectX NIC — configuring `doca_aes_gcm_task_encrypt` / `_task_decrypt`, querying `doca_aes_gcm_cap_*` for per-key-type (only `DOCA_AES_GCM_KEY_128` / `_256` — AES-192 not supported) and per-task support, sizing plaintext against the max-buf cap, setting source / destination mmap permissions, validating with a NIST GCMVS or RFC 5288 vector, or debugging DOCA_ERROR_* including the security-critical tag-verification-failed outcome on decrypt. Trigger even when the user does not explicitly mention "DOCA AES-GCM" or IO_FAILED", "auth tag isn't verifying", "NOT_PERMITTED on my encrypt buffer", "is AES-192-GCM on this BlueField" (no), or "encrypted record came back tampered". Refuse and route elsewhere for non-GCM AES modes (CBC / CTR / XTS — CPU OpenSSL), key management (KMS / HSM / rotation), SHA (doca-sha), or general AEAD background.

24k tokens
Marketplace Health Check
by daymade

>- Run a full 6-dimension health check of this Claude Code skills marketplace repo — code/script safety, documentation/SSOT consistency, security/PII leaks, open-PR triage, open-issue triage, and marketplace-manifest integrity — via a parallel fan-out Dynamic Workflow, then verify the serious findings and report them by priority. Use this whenever the user asks to check the repo, run a health check, do a full sweep/audit before a release, 全面体检, 检查仓库状态, 看看仓库健康吗, 审计一下仓库, or asks whether the PRs / issues / docs / versions / PII are in good shape across the board — even if they never say the word "workflow". Reach for it for any broad "is this whole repo OK" request, not just one-file checks.

7k tokens scripts

How to use it

Copy the folder

Take nanocoai/use-native-credential-proxy from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.