# ContextTax: Measure MCP Tool Costs in an AI Context Window

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/paveltkachenk0-contexttax
Generated for open source discovery and AI-assisted research.

ContextTax is a cross-platform CLI that measures how much MCP tool schemas and responses consume from an AI agent’s context window. Use Anthropic token counting for ground-truth figures or an offline estimate when you do not have an API key.

GitHub: https://github.com/PavelTkachenk0/ContextTax
OSRepos URL: https://osrepos.com/repo/paveltkachenk0-contexttax

## Summary

ContextTax is a cross-platform CLI that measures how much MCP tool schemas and responses consume from an AI agent’s context window. Use Anthropic token counting for ground-truth figures or an offline estimate when you do not have an API key.

## Topics

- csharp
- cli
- mcp
- ai-agents
- token-counting
- context-window-analysis

## Repository Information

Last analyzed by OSRepos: Tue Oct 13 2026 12:54:23 GMT+0100 (Western European Summer Time)
Detail views: 0
GitHub clicks: 2

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Overview

ContextTax measures the token cost of MCP server tool schemas and tool responses, then shows how much of a chosen context window they use. It is aimed at developers and agent operators who want to understand the fixed cost of loading tools and the recurring cost of calling them.

It can use Anthropic’s `count_tokens` for ground-truth measurements or provide an offline o200k-based estimate. The distinction is made explicit, which is useful when estimating costs without an API key but important when reporting precise figures.

## Key Features

- Measures schemas from a live MCP server discovered through local configuration.
- Counts captured tool responses, including comparisons before and after an optimization.
- Measures recorded sessions combining schemas and responses.
- Offers Anthropic `count_tokens` and a keyless, offline estimate as separate modes.
- Reports token usage and the share of a configurable context window.
- Supports JSON output for machine-readable results.
- Provides single-file binaries for macOS, Linux, and Windows, with no separate .NET installation required.

## Use Cases

- Agent developers can check whether enabling an MCP server consumes a significant part of the context window before useful work begins.
- Teams choosing between MCP servers can compare their tool-schema costs using the same measurement mode and window size.
- MCP server authors can measure captured responses and compare them before and after reducing verbosity.
- Operators investigating large agent sessions can measure schemas and recorded responses together to identify where context is being spent.

## Our Take

ContextTax is a focused measurement CLI with a useful distinction between exact Anthropic counts and estimates, but its quiet recent development and reliance on one contributor merit consideration before teams depend on it in a long-term workflow.

**Good fit if:**
- You need to measure MCP schema or response token costs and can use either Anthropic `count_tokens` or a clearly labelled offline estimate.
- You want a cross-platform CLI with JSON output and no runtime installation for released binaries.
- MIT licensing suits your use, and the project's single-contributor development model is acceptable for your intended use.

**Look elsewhere if:**
- You require a project with several active maintainers; most of ContextTax's development comes from one person.
- You need recent ongoing changes or issue and pull-request activity; the project is marked quiet, with no commits or issue and PR activity in the last 90 days.
- Your workflow needs measurements beyond MCP schemas, captured responses, and recorded sessions, which are the capabilities described by the project.

## Project Health

| Signal | Value |
|---|---|
| Status | **Quiet**: no commits in the last 90 days |
| Last commit | 2026-06-07 (4 months ago) |
| Commits, last 90 days | 0 |
| Releases, last 12 months | 2 (latest v1.0.1, 2026-06-07) |
| Contributors | 1 |
| Issues closed, last 90 days | 0 |
| Pull requests merged, last 90 days | 0 |
| Project age | 4 months |

Checked on 2026-10-13 with the GitHub API.

## Project Facts

- Language: C#
- License: MIT
- Stars: 5
- Forks: 0
- Topics: ai-agents, anthropic, benchmark, claude, cli, context-engineering, context-window, llm
- Archived: no

## What You Need

Detected in the repository:

- C# (main language on GitHub)
- A test suite and automated checks on GitHub Actions

## Getting Started

Install the latest binary on macOS or Linux:

```sh
curl -fsSL https://github.com/PavelTkachenk0/ContextTax/releases/latest/download/install.sh | sh
```

Then measure a configured server with `contexttax measure --server github`. See the [README](https://github.com/PavelTkachenk0/ContextTax#readme) for Windows installation, estimate mode, and other commands.

## License in Plain Words

**MIT** (permissive).

- Commercial use: yes
- Modify and redistribute: yes
- You must keep: the copyright and license notice
- Share your changes: no

A summary, not legal advice: the LICENSE file is what applies.

## Considerations

The project is marked quiet because it has had no commits in the last 90 days, despite having recent release history. Its measured contributor base is one person, so maintenance and continuity depend heavily on that contributor. CI and tests are present, and the repository is not archived, but those facts do not guarantee future support.

The offline o200k-based mode is an estimate, not a substitute for Anthropic `count_tokens`; the README notes that estimates can differ from ground truth. Ground-truth measurement requires an `ANTHROPIC_API_KEY` on a funded account. The README also warns that distributed binaries are unsigned, so users may need to clear macOS quarantine or bypass the Windows warning. The project uses the MIT license.