How I run LLM agents in production with Claude Code and the Model Context Protocol (MCP): context engineering, tools, and the limits worth setting.
Most “agent” demos floating around solve a toy problem and fall apart the moment you point them at a real repository. The difference between an agent that helps and one that gets in the way isn’t the model, it’s what context you give it, what tools you let it use, and where you draw the line. This is what I’ve learned wiring Claude Code and the Model Context Protocol (MCP) into my daily workflow.
The problem: context is the bottleneck
An LLM doesn’t “know” your project. On every request it only sees what fits in its context window. A useful agent has to decide, without being told, which files to read, which commands to run, and when to stop. Give it too much and you dilute the signal while driving up cost and latency; give it too little and it hallucinates paths and APIs that don’t exist.
The common trap is assuming a bigger model fixes this. It doesn’t. Context engineering does: retrieving exactly what’s needed, exactly when it’s needed.
What MCP actually solves
The Model Context Protocol is an open standard for connecting an LLM to data sources and tools through servers. Instead of pasting file contents into the prompt, you expose capabilities: a filesystem server, a database server, one for your internal API. The model discovers those tools and calls them when it needs them.
The practical payoff is twofold:
- You decouple context from the prompt. The agent asks for what it needs instead of receiving everything up front.
- You reuse the same integration across different clients: whatever an MCP server exposes works for Claude Code, for a custom assistant, or for a batch pipeline.
How I use it in practice
Day to day, Claude Code acts as the orchestrator: it reads the repository, proposes changes, runs the test suite, and iterates on the result. The pattern that works best for me comes down to three rules:
- A project instructions file. Commit conventions, build commands, architecture, and what NOT to touch. It’s the difference between an agent that respects your style and one that rewrites half the repo “just because.”
- Tools with explicit permissions. Reading is cheap; writing, running commands, or touching the network is not. Those actions should go through a confirmation step, especially early on.
- Small, verifiable tasks. An agent shines when it can check its own work: passing tests, a clean type-check, a linter with no errors. Without an objective definition of “done,” the agent just spins.
An agent with no way to verify its work isn’t autonomous: it’s a plausible-text generator you still have to review line by line.
I applied exactly this way of working while building DevFlow AI, a developer tooling suite where AI-assisted development was part of the process from end to end.
Where to draw the line
Agents fail in predictable ways, so it pays to anticipate them:
- Don’t give them production access. An agent that can deploy is an agent that can break production at 3 a.m.
- Version everything. If every agent change is a reviewable commit, a mistake is a
git revert, not a crisis. - Distrust confidence. An LLM sounds just as sure when it’s right as when it invents a function. Verification is on you, not the model.
What I take away
Claude Code and MCP don’t replace engineering judgment, they amplify it. The deep work, deciding the architecture, defining what “correct” means, setting the limits, stays human. What changes is the speed at which you iterate over mechanical, well-scoped tasks.
If you’re bringing LLM agents into a team and want to skip the potholes I’ve already hit, let’s talk. It’s exactly the kind of problem I enjoy.
Related articles
LLM agents in production: from prototype to reliable system
Practical guide to LLM agents in production: orchestration, function-calling, memory, guardrails, evaluation, cost and latency. What breaks beyond the demo.
Read articleGEO: How to Get ChatGPT and Perplexity to Cite Your Site
Generative engine optimization (GEO): llms.txt, schema.org (Person, FAQPage, hasCredential), extractable content and E-E-A-T so AI cites your website.
Read articleResilient, free AI: LLM fallback that never goes down
How I built a free LLM fallback chain (Groq, OpenRouter, Pollinations) with graceful degradation: chained free tiers that survive quota limits and timeouts.
Read article