Skip to main content
MCP server CX Codex

TokenSafe · tokensafe-dev — Claude Code MCP server: features and setup

The TokenSafe MCP server for Claude Code trims irrelevant material from an AI agent’s working context. It narrows code snippets and cleans tool output during coding sessions.

MIT ★ 47 updated 2026-11-16

Install into Claude Code · Platform CLI: remote server All methods and platforms ↓
claude mcp add --transport http tokensafe https://api.tokensafe.dev/mcp
Open on GitHub

What TokenSafe does

TokenSafe uses Tree-sitter to select code fragments, searches the repository, and removes outdated tool results from long transcripts. It also strips terminal control sequences and resizes images before they reach the model. Image handling uses Pillow or macOS sips.

The local npx setup runs basic tools without a key. Cloud features such as team metrics, a shared team cache, and managed distillation connect to https://api.tokensafe.dev/mcp and require a TS2 license key. The Claude Code HTTP setup registers the cloud server; a separate local command runs TokenSafe through npx.

What it helps with

  • trim lockfiles and build output from an agent’s context
  • locate API calls and their corresponding server routes
  • remove superseded tool results from long session transcripts
  • strip ANSI control codes from command output

Example prompts for the agent

  • Keep only the code fragments relevant to this session.
  • Find the client API calls and matching server routes in this repository.
  • Remove terminal control sequences from the test output.

How to install TokenSafe

1Platform CLI: remote server

claude mcp add --transport http tokensafe https://api.tokensafe.dev/mcp

2Platform CLI

claude mcp add tokensafe-dev-tokensafe -- npx -y tokensafe

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about TokenSafe

How do I install TokenSafe in Claude Code?

For a local setup, run claude mcp add tokensafe-dev-tokensafe -- npx -y tokensafe. This is one installation method.

What does TokenSafe do?

It narrows code context, searches repositories, and prunes outdated tool output from agent transcripts. It can also process images and clean terminal output.

What does TokenSafe need for its cloud features?

Cloud features require a TS2 license key and connect through https://api.tokensafe.dev/mcp. The basic local tools run without a key.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

TokenSafe by other authors comes first.

TokenSafe ampactor-labs TokenSafe screens Solana SPL tokens from inside the chat: a 0-100 risk score, a risk level and a short plain-language summary. CX Codex +1 697installs codegraph onsager-ai codegraph — a skill for Claude Code and Codex that navigates indexed repositories through a tree-sitter graph and 8 MCP tools. Maps callers and subsystem layout across large codebases. CX Codex +1 891installs grepai-languages yoanbernabeu Provides GrepAI language support specifications for indexing and call-graph analysis. Supplies the agent with extension mappings and symbol extraction rules during setup. CX Codex +1 742installs jcodemunch-mcp-code-retrieval reason-machines The jcodemunch-mcp-code-retrieval skill lets an agent query repository symbols and their relationships through MCP. Use it to inspect a codebase by asking for specific implementations instead of browsing files line by line. CX Codex +1 230installs codedb-mcp-fast-code-intelligence reason-machines The codedb-mcp-fast-code-intelligence skill guides setup of a local MCP server that indexes a repository for symbol lookup, reference searches, and dependency analysis. Use it to explore a codebase without dumping whole files into chat. CX Codex +1 116installs jCodemunch MCP jgravelle jCodemunch MCP retrieves code by symbol using tree-sitter AST parsing instead of dumping entire files. Cuts context window usage when AI agents explore large codebases. CX Codex +1 ★ 2,857repo stars Octocode Muvon Octocode indexes codebases using AST parsing and semantic search to map file dependencies, symbol calls, and project structure for AI agents. CX Codex +1 ★ 529repo stars

Project sponsors

Companies that keep this analytics open