MCP servers expose many tools that consume significant context window tokens — often 32k+ tokens just for tool descriptions before any code is written. The post argues MCP server developers should implement selective tool disabling via environment variables, allowing users to exclude tools they don't need. This reduces token usage, improves model reliability (less context rot), shrinks attack surface, and enables compliance controls. Two implementation patterns are shown: simple conditional registration (Python) and registry-based runtime filtering (Go). GitHub's MCP server is called out as the worst offender, consuming 46k tokens across 91 tools with no disable mechanism.

5m read timeFrom smcleod.net
Post cover image
Table of contents
The Problem is Real #Implementation Advice #Example Implementation Approaches #Just Do It #Appendix - A Note On The Worst Offender: Github #

Sort: