frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Bad MCP design costs your agent 5x more tokens

9•JohnnyZhang483•19h ago
I recently did some tests on two MCPs with identical functionalities. Turns out one of them has really bad performance. So I wanna share those bad MCP design patterns that cause this.

It all started when I wrote an MCP Server (MCP-A) for a to-do list app. Later, the app officially released its own MCP Server (MCP-B). Both MCPs have the same functionalities and hit the same backend API.

The experiment is set up as follows:

- Both MCP Servers connect to the same ToDo list account, and it will be reset after each test. - 40 test prompts to simulate typical use cases for these MCPs. - The test was conducted with the same model, system prompt, and Agent framework

Here are the results:

| Metric | MCP-A | MCP-B | Gap | | ------------------- | ----------- | ----------- | ----- | | Tool Desc Length | 11,464 | 3,682 | — | | Pass Rate | 36/40 (90%) | 36/40 (90%) | Same | | Total input tokens | 637,244 | 3,174,329 | 4.98× | | Total output tokens | 17,301 | 23,238 | 1.34× | | Total Agent steps | 122 | 157 | 1.29× | | Total time | 597s | 676s | 1.13× |

---

The result shows that MCP-B took 35 more ReAct loops to complete 40 test cases compared to MCP-A, which means 30% more output tokens. I examined the log and found that the root cause is poor query tool design.

Take the `search tool` for example, its job is to find a todo item in the ToDo list. In MCP-B, this tool returns this:

{ "id": "6a1916b48f08cb3a4c857ed0", "title": "buy some groceries", "url": "https://todo.example.com/tasks/6a1916b48f08cb3a4c857ed0" }

But other CRUD operations require `project_id`, and `search_tool` doesn't return it. So the Agent has to call another tool `get_task_by_id`. On the other hand, MCP-A's query_tasks returns all necessary info to perform the next action in a single call:

Task 1: ID: 6a19143e8f084a8c8101612f Title: buy some groceries Project ID: 6a1914378f084a8c810160a9 Start Date: 2025-07-19 10:00:00 Priority: Medium Status: Active Unfiltered API Data was dumped into context window

If MCP returns pure API results to the Agent's context unprocessed, the Agent's context window will accumulate very fast.

Take MCP-B's `create_task` tool, for example. Its job is to create a to-do item. This is what this tool returns:

{ "id": "6a180de78f086bdead0608be", "projectId": "inbox125587327", ..... "createdTime": "2026-05-28T09:41:59+0000", "modifiedTime": "2026-05-28T09:41:59+0000", "focusSummaries": null }

These 600+ characters mean nothing to the Agent's task, but are still dumped into the Agent's context. On the other hand, MCP-A's create_tasks does a layer of filtering and formatting. This little tweak makes a huge difference in input token usage.

Another issue is tool count. More tools mean a larger candidate set for the model to choose from, which directly increases decision difficulty. In MCP-A, 47 tools were compressed down to 14, covering the same functionality with fewer tools.

---

So here are my takeaways on good MCP tool design: - When designing a tool, think about what the Agent will need next, not just what it's asking for right now. Return enough context in the result so the Agent can take the next action without making another round-trip.

- Too many tools will increase the model's decision burden. So it'd be better to minimize the number of tools within an MCP. Make sure they don't overlap functionalities.

- When your MCP returns data to the LLM, try to keep it LLM-friendly, which means readable. You can filter out unnecessary fields from the API response and format the data, rather than passing through raw JSON.

---

All the tests above were run by MCP-Eval. It's an MCP Server benchmarking tool. If you want to check your MCP's performance, feel free to check this out.

https://github.com/Code-MonkeyZhang/mcp-eval

Ask HN: What was your "oh shit" moment with GenAI?

90•andrehacker•23h ago•250 comments

Ask HN: What is your (AI) dev tech stack / workflow?

107•dv35z•7h ago•100 comments

Bad MCP design costs your agent 5x more tokens

9•JohnnyZhang483•19h ago•0 comments

Ask HN: My competitors have flawed products but I can't get traction

5•saveitincork•21h ago•5 comments

Ask HN: Are orbital data centers possible / a good idea?

20•aronowb14•6h ago•36 comments

Ask HN: So what happened to Facebook "localhost" tracking?

99•juliusceasar•1d ago•99 comments

Ask HN: Why isn't AI image generation closely linked with graphics code gen?

2•amichail•9h ago•1 comments

Ask HN: Is the web for machines (/llm.txt) the one we wished we had as humans?

35•sunshine-o•12h ago•54 comments

Ask HN: How did you discover Hacker News?

5•chistev•8h ago•8 comments

Ask HN: How do you find deep technical content?

36•f311a•1d ago•26 comments

Ask HN: Gin rummy strategies

24•bix6•1d ago•4 comments

Ask HN: How do you stay up to date without information overload?

3•bohdanstefaniuk•6h ago•2 comments

Ask HN: Who is hiring? (June 2026)

239•whoishiring•4d ago•424 comments

Ask HN: Is Azure capacity this constraind or am I doing it wrong?

10•lanycrost•12h ago•12 comments

Ask HN: Who wants to be hired? (June 2026)

149•whoishiring•4d ago•523 comments

Ask HN: Do you know any company that's making money with LLMs?

4•camillomiller•15h ago•2 comments

Ask HN: Is Everyone an Engineer Now?

4•piratesAndSons•22h ago•6 comments

Supply chain attack alert: .github/setup.js

16•antihero•13h ago•10 comments

I'm tired of LLM skill slop, so I built mine with regression tests

5•iliaov•1d ago•0 comments

Life saving / first aid posters

36•cpu_•3d ago•3 comments

I underestimated how hard audio waveforms are in the browser

5•syncara•21h ago•2 comments

Ask HN: Hey, you, tech worker–how are you feeling?

5•arm32•1d ago•11 comments

Being privacy-conscious comes with some downsides

7•wqtz•1d ago•4 comments

Ask HN: Is Claude Code down, or its just my region?

4•codetiger•15h ago•1 comments

Google killed my $1M ARR startup overnight

14•vadumo•1d ago•9 comments

Ask HN: Good books/resources for learning SQL?

5•CobaltFire•1d ago•3 comments

Ask HN: AI efficiency in the workplace

3•localhoster•1d ago•5 comments

Ask HN: A Brief History of LLMs

9•menomatter•2d ago•6 comments

Tell HN: Max messenger app removed from App Store

9•secondary_op•1d ago•4 comments

Ask HN: What is your opinion on index rule changes to accommodate Mega-Cap IPOs?

18•figmert•3d ago•11 comments