Your MCP Doesn't Need 30 Tools: Code Is Enough

This article explores a novel approach using a single-tool MCP server that accepts programming code as input. The author points out challenges with CLI tools, such as platform dependency, version dependency, and lack of documentation, making them difficult for agent tools to use. In contrast, an MCP server can maintain state and expose a single tool (e.g., a Python interpreter running eval()), allowing agent tools to better manage sessions and compose tools. The author demonstrates the effectiveness of this approach with pexpect-mcp, which transforms the MCP server into a stateful Python interpreter, simplifying debugging and improving efficiency. Furthermore, the author explores replacing Playwright's MCP with one exposing the Playwright API via JavaScript, reducing tool definitions and improving data transfer efficiency. While security concerns exist, the author argues this approach has significant potential and warrants further exploration.