All posts

Build context-aware MCPs, not API wrappers

Published on

  • mcp
  • ai
  • composable
  • architecture
  • saas

We keep teaching agents how to use tools, but not when or why.
That's why most Model Context Protocol (MCP) servers fail: they offer power without perspective.

You can see it happen. The model calls getEntries, then getEntries again, then hallucinates publishBlogPost because it has no idea what your content model looks like.
It's like giving a mechanic a warehouse full of parts and no car to fix.

Context is the missing ingredient.
A well-designed MCP doesn't just expose capabilities, it understands what the project is, who the user is, and why the operation matters. That awareness turns a general-purpose agent into a precision tool.

Summary

After building and testing multiple MCP servers, one thing stands out: wrapping APIs isn't enough.
An effective MCP behaves like an application that adapts to its environment. Without context, even the smartest agent becomes a confused one.

  • Avoid generic API wrappers.
  • Make MCPs context-aware so they adapt to each project or SaaS instance.
  • Dynamically adjust tool metadata, examples, and schemas at runtime.
  • Keep tool counts small (under 15) for accuracy and cost efficiency.
  • Treat context as the product, not a side feature.

The illusion of control

It's tempting to think that giving a model more tools gives it more control.
The irony is the opposite: real control comes from constraint and relevance.

Every tool you add expands the cognitive surface area. The model now has to reason about which of the 30 functions to use before it even starts working.
Context narrows that space, focuses attention, lowers cost, and increases confidence.

The real definition of MCP

For those new to it: MCP defines how large language models connect to external tools and systems. You can think of it as the “API layer” for AI reasoning, a contract that says, here's what you can do, and here's how to do it safely.

Each tool in MCP has:

  • A name and description (to inform the model),
  • A schema for inputs and outputs,
  • A few examples to ground usage.

Most implementations stop there. They register endpoints and call it a day, like deploying a CMS with no templates or editorial rules.
It's technically functional but contextually blind.

The problem of excess tools

Once you load up a server with more than ~15 tools, smaller or cheaper models start to fall apart. They hallucinate tool names, confuse parameters, or loop on irrelevant reasoning steps.

Why? Because the model's attention budget is finite. Every tool definition consumes context-window space, and every extra option increases cognitive load.
In other words, the model stops thinking and starts guessing.

The fix isn't smarter reasoning loops, it's shrinking and specializing.
Expose fewer tools, and make each one deeply contextual. The model should only see the affordances that matter right now.

Generic vs. context-aware MCPs

FeatureGeneric MCPContext-aware MCP
Tool count30+<15
DescriptionsStaticProject-specific
ExamplesGeneric API callsBased on real data
SchemaUniversalTailored per project
Model accuracyUnstablePrecise and low-cost

Building context-aware MCPs

Here's where MCP gets interesting, and where most implementations fail.

A context-aware MCP behaves like an app that assembles itself dynamically:

  • It fetches project metadata, schemas, or permissions at startup.
  • It rewrites tool descriptions to match the project's language and domain.
  • It generates examples that reflect real workflows.
  • It adjusts tool visibility depending on user role, active features, or current task.

In short, your MCP becomes a contextual orchestrator rather than a static gateway.

Think of it as the backend equivalent of “visual editing” for agents, the model sees a filtered, project-specific version of reality, not the entire universe of possibilities.

A practical example

Imagine integrating with a headless CMS.

An average MCP wrapper might expose:

  • getEntries
  • createEntry
  • publishEntry
  • getAssets

A context-aware version could:

  • Detect the active content model and generate field-specific schemas.
  • Rename tools to match editorial language (e.g., “update blog post” instead of “update entry”).
  • Limit access to only relevant content types.
  • Inject examples based on actual API usage (e.g., “publish the latest blog post in French”).

This contextualization doesn't just improve accuracy, it reduces cost by cutting reasoning noise.

The trade-offs of dynamic MCPs

Dynamic MCPs are harder to build and test. They blur the line between infrastructure and application logic.
You'll need caching, authentication, and version control for your dynamically generated toolsets.

But the complexity pays off: faster responses, fewer hallucinations, cleaner execution logs, and long-term scalability.
Most importantly, it future-proofs your MCP for multi-model, multi-tenant environments.

The evolution toward adaptive middleware

As agent ecosystems mature, MCP servers will evolve from “tool catalogs” into context providers.
OpenAI's work on context connectors and semantic grounding points in that direction, the line between “server” and “app” will keep fading.

Expect to see:

  • Auto-contextual MCPs that build tool definitions from embeddings or metadata.
  • Role-aware schemas that adapt access by persona.
  • Composable MCP layers that federate across GitHub, Notion, and Vercel automatically.

In that world, MCP servers become the new middleware: intelligent, adaptive, and domain-aware.

The conclusion

An MCP server isn't just a set of endpoints. It's a contextual engine that mediates between models and systems.
When it adapts to the project, the user, and the model's limits, it transcends the “API wrapper” stage and becomes something more powerful, an application with awareness.

Tomorrow's agents won't just integrate with systems, they'll inhabit them.
And context, not capability, will define intelligence.

That's how we make agents faster, cheaper, and genuinely useful.

Frequently asked questions

  • Why not just expose all the tools and let the model choose?

    Because reasoning over too many options is inefficient and expensive. Smaller models, especially, lose coherence fast.

  • What makes a context-aware MCP different?

    It uses live project data to inform how tools are described and how examples are generated. The model sees only what's relevant, so precision skyrockets.

  • Is this approach scalable?

    Yes, if you treat the MCP as an app that builds itself dynamically. It's more work upfront but scales cleanly across tenants, models, and projects.