Skip to main content

MCP Server that solves context window overload — smart tool pruning, relevance scoring, and budget tracking for AI agents

Project description

Agent Context Optimizer MCP ⚡

Solves the #1 problem with MCP servers: context window overload.

When you have 10+ MCP servers installed, their tool schemas can consume 40-50% of your context window — leaving less room for actual conversation. This server fixes that.

What it does

  • Analyzes your task and recommends only the servers you actually need
  • Estimates token usage for any combination of servers
  • Optimizes your server set by identifying which servers to unload
  • Suggests minimal configurations for maximum context efficiency

Installation

pip install agent-context-optimizer-mcp

Usage with Claude Code

{
  "mcpServers": {
    "optimizer": {
      "command": "uvx",
      "args": ["agent-context-optimizer-mcp"]
    }
  }
}

Tools

Tool Description
analyze_task Analyze a task and recommend optimal server combination
estimate_context_usage Estimate context window consumption for servers
get_server_catalog Full catalog of known MCP servers with categories
optimize_server_set Optimize currently loaded servers for a task
suggest_minimal_set Recommend the absolute minimum servers needed

Example

"I need to check the safety of a Solana token"
→ Recommends: solana (required)
→ Saves: 85% context tokens vs loading all servers

Why this matters

  • Average MCP server uses ~3,000 tokens for tool schemas
  • 10 servers = ~30,000 tokens = 15% of a 200k context window
  • 20 servers = ~60,000 tokens = 30% wasted on tool definitions
  • This optimizer helps you load only what you need

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_context_optimizer_mcp-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_context_optimizer_mcp-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file agent_context_optimizer_mcp-0.1.0.tar.gz.

File metadata

File hashes

Hashes for agent_context_optimizer_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bcb4e6a74997f6d171c76d88392a643f8a73e8f582837c34a976fc9230faed57
MD5 38212df2de117c30bca92f67f8cf3165
BLAKE2b-256 74c36f2d50d92e4ea92a02dc8e03e8acf9ae26a28b768e50af80b8e8883c9f4e

See more details on using hashes here.

File details

Details for the file agent_context_optimizer_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_context_optimizer_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6942f3cf933b759e12bf214bbac3f897986728cec916b7fc363bfd38288f1ceb
MD5 73d5ff4d5dfde5f814a248fe62b2e1a1
BLAKE2b-256 fc54a4118d940b6a12c7369abf9f048f5924d4df193b66acb7a2825b9809f23a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page