← Back to directory
T

Token-Goat

Community
Not a standard server
Reduce wasted AI coding context and keep agents focused.

This is not a typical connect-and-use MCP server; read the source repository before using it.

Category
Dev Tools #327 of 438
Stars
★ 141 Very popular
Runtime
Node.js 22+
Credentials
No credential needed
License
Other / unspecified
Last commit
43FMRS · D

Token-Goat is a local token-optimization and hook tool for AI coding CLIs, not a clearly evidenced standalone MCP server: the supplied material provides no server manifest, MCP transport, or tool inventory. Its primary value is reducing context noise and repeated reads; deployment should be reviewed for configuration changes, file access, cache retention, and the validation status of each client bridge.

Strongest · Documentation 13/20 Weakest · Reliability 4/20

Reliability
4/20
Security and permissions
8/20
Maintenance
8/20
Documentation
13/20
Setup experience
10/20
Why each score
Reliability 4/20
No server manifest, MCP initialization evidence, tool-list evidence, or executable verification is provided. The README mainly describes hooks, CLI behavior, and client bridges rather than a verifiable MCP server interface. It claims CI, tests, and extensive error handling, but those claims are not substantiated by the supplied source material, so the score remains low.
Security and permissions 8/20
The README describes prompt-injection scanning, untrusted-content fencing, fail-soft hooks, and configurable behavior, but provides no implementation evidence for permissions, credential handling, network data boundaries, or confirmation of dangerous operations. Installation modifies user configuration and registers hooks, while tool rewriting and blocking can affect workflows. No explicit red-line risk is evidenced, but the missing controls prevent a higher score.
Maintenance 8/20
The repository is not archived; the supplied metadata shows 62 stars and no open issues, and the README provides a manual npm update path and a maintainer contact address. Deductions apply because the license is NOASSERTION, the PolyForm Noncommercial badge is not independently supported by the supplied source, and there is no verifiable release, commit, dependency-update, or security-response history.
Documentation 13/20
The README is unusually detailed, covering installation, the Node.js requirement, multiple clients, limitations, troubleshooting, uninstall behavior, cache recovery, and configuration switches, while disclosing that some bridges were not live-validated. Deductions apply because the manifest is missing, many performance and capability claims cannot be verified from the supplied material, and the provided README is truncated before all parameters and boundaries can be reviewed.
Setup experience 10/20
The README provides a clear npm global-install, install, and doctor workflow, specifies Node.js 22+, and documents Windows, Linux/WSL, and multiple client bridges. Deductions apply because installation modifies several user-level configurations, depends on hooks and optionally a background worker, some clients require separate bridges or restarts, and no verifiable MCP connection configuration or successful handshake example is supplied.

Static review · not runListed 2026-07-30

Read the FMRS scoring method →

Fit and risk

What it can accessReads local filesWrites / deletes local filesRuns commands or codeUses the network

Best for

  • Developers who regularly use Claude Code, Codex CLI, Gemini CLI, or other supported AI coding CLIs.
  • Users seeking to reduce context usage from large repositories, logs, screenshots, and skill files.
  • Users comfortable with modifying local AI-client configuration and creating indexes and caches.

Not for

  • Users seeking a standard MCP server manifest, documented MCP transport, or directly callable MCP tool inventory.
  • Users who do not want a global npm package, registered hooks, or client-configuration changes.
  • Production users requiring validated macOS support; the README labels macOS as untested.

Required permissions

  • Requires installing a global Node.js/npm package.
  • Requires writing client configuration and hook files for supported AI tools.
  • Requires reading project files, Git information, and relevant session data to build indexes, caches, and compact manifests.
  • The optional worker runs as a local background process.

Risks and side effects

  • Hooks intercept or rewrite reads, Bash commands, screenshots, and other tool calls, which can change how original output is presented.
  • Indexes, caches, and session manifests store project or tool output locally; the README does not document complete retention or encryption behavior.
  • The README claims to scan fetched web content and block prompt injection, but this should not replace human review or the client's own security controls.
  • Some bridges are not validated against live instances, including the documented Qwen, OpenClaw, and pi integrations; Copilot hook failures can deny all tool calls in a session.
  • Repository metadata says NOASSERTION for the license, while the README badge shows PolyForm Noncommercial; verify the repository license before use.

Setup

Before you start

Runtime:Node.js 22+

Other optional settings (4)
TOKEN_GOAT_MCP_COMPRESS optional Set to 0 to disable table-ifying compression of MCP tool results; on by default.
TOKEN_GOAT_BASH_COMPRESS optional Set to 0 to globally disable bash output compression; on by default.
TOKEN_GOAT_ASK_BACKEND optional Optionally set to claude or codex so token-goat ask synthesizes a short answer via that CLI; unset means only retrieved pointers are printed.
TOKEN_GOAT_HARNESS_OVERRIDE optional Set automatically by shims (e.g. 'copilot_cli') to identify the host environment; users normally never set it manually.

Requires Node.js 22 or later. Run npm install -g token-goat, then token-goat install and token-goat doctor. Codex CLI users can run token-goat install --codex; Gemini, Qwen, Copilot, OpenCode, pi, and Grok CLI have corresponding install options. Restart AI sessions after installation. The background indexer is not started by install; run token-goat worker start if needed.

Check that it works

After install, run token-goat doctor and confirm it reports 'sharp: ok' with hooks registered; then in your AI client session re-read the same file twice and confirm a re-read hint appears instead of full-file content.

Troubleshooting

  1. Run `token-goat doctor` to verify hooks and confirm `sharp: ok`.
  2. If image processing fails, inspect the doctor output; the README notes that Alpine musl and some ARM environments may compile sharp from source.
  3. Fully restart the AI CLI after installing or updating hooks, especially Copilot CLI.
  4. Use `token-goat worker status` to inspect the index worker, and `worker start` or `worker stop` as needed.
  5. If the index is stale, run `token-goat index` or use `--force-refresh` on supported read commands.

Things to try

Once connected, you can ask your AI assistant things like:

  • Use token-goat read to pull just the login function from src/auth.py instead of reading the whole file.
  • Run token-goat compress --filter pytest --cmd 'pytest -v tests/' to compress the pytest output.
  • Shrink screenshot.png with token-goat image-shrink and tell me the size reduction.
  • Run token-goat stats to show how many tokens were saved this session.

Use cases

Compress verbose output from pytest, npm, Docker, Git, compilers, and other development CLIs.
Retrieve focused code and documentation slices with `token-goat read`, `section`, `symbol`, or `skeleton`.
Preserve edited files, accessed symbols, and key reads during session compaction.
Shrink screenshots and cache repeated Bash, web, and MCP outputs.
Register read, compression, and session hooks for supported AI CLIs.

Supported clients

Claude Code
Codex
Gemini CLI
Qwen Code
GitHub Copilot CLIPartial support
OpenCodePartial support
piPartial support
Grok CLIPartial support

Listed from the project's documentation, not tested by this site.

Overview

Token-Goat is a Node.js-based CLI and hook system for compressing terminal output, shrinking images, intercepting repeated reads, extracting code or document slices, generating compact manifests, caching Bash/Web/MCP output, and scanning fetched web content for prompt-injection patterns. The README claims 40–90% reductions in AI token use or cost; actual results depend on the workflow.

Similar servers

Context7 80 · B

Upstash's official server providing up-to-date third-party library docs for AI coding assistants

★ 63.3k · Tools 2 Compare with this →

Source revision cb04e92f4455 Data synced 2026-10-19 Read the FMRS scoring method