setup-keys

setup-keys is a command for coding agents from mims-harvard/ToolUniverse. It costs 70 tokens per session (694 once invoked), scanned A, original, Apache-2.0.

A setup command for ToolUniverse, a collection of tools that can use external services through API keys. It presents the available keys, guides the user through adding them, and stores them in a file read by the server, command-line tool, and software library.

In plain words
What is it for?
Use it when configuring ToolUniverse for the first time or when a tool reports that an API key is missing, choosing global or project-only storage.
Why use it?
It removes the need to configure each missing API key by hand and makes the keys available to the parts of ToolUniverse that need them. It supports either a graphical setup page or guided setup in chat.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the tooluniverse plugin — 47 skills, 8 commands, 1 agent, 1 hook, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/mims-harvard/tooluniverse/setup-keys
Clone the repo
git clone --depth 1 https://github.com/mims-harvard/ToolUniverse

Or install tooluniverse, the plugin that ships this one along with the rest of its 47 skills, 8 commands, 1 agent, 1 hook, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for setup-keys

README.md
[![agentmods](https://agentmods.dev/badge/commands/mims-harvard/tooluniverse/setup-keys.svg)](https://agentmods.dev/commands/mims-harvard/tooluniverse/setup-keys)
Your own site
<a href="https://agentmods.dev/commands/mims-harvard/tooluniverse/setup-keys"><img src="https://agentmods.dev/badge/commands/mims-harvard/tooluniverse/setup-keys.svg" alt="Measured on agentmods" height="20"></a>
Per session 70 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 694 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00070 $0.00694
Opus 5 $0.00035 $0.00347
Sonnet 5 $0.00014 $0.00139
Haiku 4.5 $0.00007 $0.00069

Measured 4d ago against content hash 910d289326b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

setup-keys scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin/commands/setup-keys.md · 64 lines

How it starts

The opening of the file, as written. The whole thing — 64 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are setting up ToolUniverse API keys for the user. Keys are read from the environment by tools at run time and persisted in a .env that ToolUniverse auto-loads. Follow these steps exactly.

Step 1 — Ask which mode

Ask the user (use the AskUserQuestion tool):

  • Graphical interface — a local web page with a form for all keys.
  • Agent-guided — I ask you for keys here in chat.

Step 2 — Ask where to store

Ask the user:

  • Global ~/.tooluniverse/.env (recommended) — works across all projects.
  • Project-local ./.tooluniverse/.env — only this project; read when the MCP server runs from this directory.

Resolve the target path:

  • Global -> ~/.tooluniverse/.env
  • Local -> <current working directory>/.tooluniverse/.env

Step 3a — Graphical mode

Run (do NOT redirect or background it; it prints a URL and blocks until the user saves, then exits):

python "${CLAUDE_PLUGIN_ROOT}/scripts/setup_keys_server.py" --target <TARGET_ENV_PATH>

If api_keys_catalog.json is not found next to the script (e.g. running from a source checkout), add --catalog <repo>/src/tooluniverse/data/api_keys_catalog.json.

Show the user the printed http://127.0.0.1:... URL in case the browser does not open automatically. When the command exits, report the target path and the number of keys saved. Never print the key values.

Step 3b — Agent-guided mode

  1. Read the catalog: python -c "import json; print(json.dumps(json.load(open('${CLAUDE_PLUGIN_ROOT}/scripts/api_keys_catalog.json'))))" (fall back to the repo path src/tooluniverse/data/api_keys_catalog.json).
  2. Ask the user whether to set all required keys, or name specific APIs.
  3. For each selected key, show its register_url and description, then ask for the value. Do not echo previously stored values.
  4. Write all collected values at once with the helper. keys_env.py exposes merge_env(path, updates); call it from a short inline Python snippet, passing the target path and a dict of the values you collected:

Read the full file on GitHub · 64 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 64 lines · 70 tokens per session scan A 910d289326b3

Subscribe to this mod's changes

setup-keys is a command published in the GitHub repository mims-harvard/ToolUniverse (1,670 stars, last pushed yesterday), licensed Apache-2.0. It adds 70 tokens to every session and 694 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.