Skip to content
gentic.news — AI News Intelligence Platform
Connecting to the Living Graph…

Listen to today's AI briefing

Daily podcast — 5 min, AI-narrated summary of top stories

A developer types code on a laptop, with a diagram of a server-client architecture on the screen, illustrating MCP…

4 Rules to Build an MCP Server That Won't Waste Your Tokens (or Your Time)

Build MCP servers for Claude Code as LLM UIs: cap at 20 tools, design for intent, use JMESPath to cut payloads 80-90%.

·8h ago·3 min read··2 views·AI-Generated·Report error
Share:
Source: dev.tovia devto_mcpSingle Source
How do I build an efficient MCP server for Claude Code that minimizes token usage?

Cap your MCP server to 15–20 tools, design tools around user intentions, write descriptions that steer the model, and filter response payloads with JMESPath to reduce payload sizes by 80–90%.

TL;DR

Treat your MCP server as an LLM UI, not an API proxy, and cap tools at 20 to slash token costs.

What Changed — The MCP Server Design Rules You Need

A new guide from Bump.sh lays out four concrete rules for building efficient MCP servers. The key insight: treat your MCP server as a user interface for an LLM, not a thin API proxy. This shift in mindset changes everything about how you design tools, write descriptions, and handle responses.

If you've been wrapping REST endpoints one-to-one and calling it a day, you're burning tokens—and Claude Code's patience.

Rule 1: Cap Your Tools at 15–20

Every tool you expose costs tokens. The server's tool list is sent to Claude Code on every request. More tools = bigger context window = slower responses + higher costs.

The rule: Limit each MCP server to roughly 15–20 tools. If you need more, split into multiple servers by domain.

For Claude Code users, this means:

  • Group related operations into a single tool (e.g., create_resource instead of create_project, create_task, create_document)
  • Remove rarely-used tools
  • Consider a single "query" tool with parameters rather than 10 separate query tools

Rule 2: Design Tools Around User Intentions, Not API Endpoints

Your API has endpoints like POST /users/{id}/permissions. Your MCP server should have a tool called grant_user_access.

Cover image for Integration Digest for June 2026

The difference: Claude Code doesn't care about your RESTful resource hierarchy. It cares about what the user wants to accomplish.

For Claude Code specifically:

  • Name tools with action verbs the model understands: search_code, deploy_service, run_test
  • Group multi-step operations into a single tool when the steps are always done together
  • Avoid exposing CRUD operations directly—wrap them in intent-based tools

Rule 3: Write Tool Descriptions That Steer the Model

Tool descriptions are your primary way to influence how Claude Code uses your server. Generic descriptions like "Creates a user" leave too much to the model's interpretation.

Better: "Creates a new user account. Requires 'name' and 'email'. Returns the user ID. Use this when the user asks to sign up or register. Do NOT use this for admin user creation—use 'create_admin_user' instead."

Error messages matter too. Instead of "400 Bad Request", return: "The email domain 'example.com' is not allowed. Use a company email address." This helps Claude Code correct its behavior without retrying the same mistake.

Rule 4: Aggressively Filter Response Payloads

This is the biggest token saver. Most API responses contain fields Claude Code doesn't need. Sending them wastes tokens on every call.

The fix: Use JMESPath (or equivalent) to filter responses before returning them to the model.

Example: Instead of returning a full user object with 40 fields, filter to: {id, name, email, role}.

The guide reports 80–90% payload reduction from this practice alone. For Claude Code users, that means faster responses and lower costs on every tool call.

Try It Now

  1. Audit your MCP servers — Count tools per server. If any has >20, split it.
  2. Rewrite tool descriptions — Add "Use this when..." and "Do NOT use this when..." guidance.
  3. Install JMESPath — Add response filtering to your server's tool handlers.
  4. Test the difference — Run a typical workflow before and after, compare token counts.

Why This Matters for Claude Code

Claude Code's agentic loop calls tools frequently. Every unnecessary tool in the list, every verbose description, every bloated response payload—they all compound. These four rules directly reduce the token overhead of every interaction, making your Claude Code sessions faster and cheaper.

Bottom line: Your MCP server is an LLM UI. Design it like one.


Source: dev.to

Source: gentic.news · · author= · citation.json

AI-assisted reporting. Generated by gentic.news from multiple verified sources, fact-checked against the Living Graph of 4,300+ entities. Edited by Ala SMITH.

Following this story?

Get a weekly digest with AI predictions, trends, and analysis — free.

AI Analysis

Claude Code users should immediately audit their existing MCP servers. If you've been wrapping APIs 1:1, you're likely exceeding the 15-20 tool limit. The fix: merge related tools into intent-based ones (e.g., combine `create_project`, `update_project`, `delete_project` into a single `manage_project` tool with an `action` parameter). Next, rewrite all tool descriptions with explicit steering language. Add 'Use this when...' and 'Do NOT use this when...' clauses. This prevents Claude Code from misusing tools and retrying failed calls. Also add JMESPath filtering to every tool handler that returns data. The 80-90% payload reduction is too significant to ignore—it directly translates to faster Claude Code responses and lower token costs.

Mentioned in this article

Enjoyed this article?
Share:

AI Toolslive

Five one-click lenses on this article. Cached for 24h.

Pick a tool above to generate an instant lens on this article.

Related Articles

From the lab

The framework underneath this story

Every article on this site sits on top of one engine and one framework — both built by the lab.

More in Products & Launches

View all