惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
博客园_首页
WordPress大学
WordPress大学
大猫的无限游戏
大猫的无限游戏
有赞技术团队
有赞技术团队
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
酷 壳 – CoolShell
酷 壳 – CoolShell
Y
Y Combinator Blog
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
博客园 - 司徒正美
Engineering at Meta
Engineering at Meta
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
G
Google Developers Blog
Last Week in AI
Last Week in AI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Stop Building Another REST API — Make It MCP-Ready From D...
Mano Nagaraj · 2026-05-01 · via DEV Community

Okay, I'll say it. Every time someone kicks off a new backend project and opens a browser tab for "REST API best practices," a small part of me quietly weeps into my coffee.

Not because REST is bad. REST is fine. REST has been very good to us. But we keep reaching for the same hammer without asking whether the thing we're hitting is still a nail.

It is 2025. The AI agents are not coming. They are already here, already poking at your endpoints, already confused about what your /users/search route actually does, and already making things up when your docs are not clear enough. So maybe it is time we build with that reality in mind.

Let me introduce you to MCP, and let me try to make it make sense without putting you to sleep.

What Even Is MCP

MCP stands for Model Context Protocol. It is an open standard, originally from Anthropic, that defines how AI models and agents communicate with external tools and data sources. Think of it as a universal translator between "what the AI wants to do" and "what your system can actually do."

If REST is like a menu at a restaurant, MCP is like having a chef who can look at your fridge, understand what you have, and cook something sensible without you having to explain the entire menu from scratch.

The core idea is that instead of just exposing raw HTTP endpoints and hoping whoever calls them reads the documentation, you expose structured capabilities. You tell the agent: here are the things you can do, here is what they mean, here is what goes in and what comes out. And the agent actually understands that in a way it never quite did with a Swagger doc.

The REST Problem Nobody Talks About

Here is a scenario that should feel familiar.

You have a beautiful REST API. Versioned. Documented. Rate-limited. You even have a Postman collection. You are proud of it and you should be.

Then someone builds an AI agent on top of it.

The agent hits /orders and gets back 200 records with no context. It does not know what "status: 3" means. It does not know which fields matter. It starts guessing. The guessing is confident and wrong. Someone files a bug. The bug is hilarious and also a little frightening.

This is not an API quality problem. Your API is fine. It is a context problem. REST was designed for developers who read docs and write code. It was not designed for autonomous agents that need to understand intent, not just structure.

MCP bridges that gap. Instead of "here is a JSON payload, figure it out," MCP says "here is a tool called getRecentOrders, it takes a userId and a dayRange, it returns a list of orders with human-readable status labels, and here is exactly what each field means."

That is a different conversation entirely.

So How Does MCP Actually Work

At the core, an MCP server exposes three things.

Tools are functions the AI can call. Think of them like your API endpoints but with enough context baked in that the agent knows what they are for. A tool has a name, a description in plain language, a typed input schema, and a typed output. No ambiguity. No "check the docs."

Resources are data the AI can read. Files, database records, configuration, documents. The agent can browse them and pull what is relevant to the task at hand.

Prompts are reusable templates that help the agent reason correctly. You define the shape of the interaction upfront so the AI is not reinventing the wheel every time.

Your MCP server sits next to your existing backend. It does not replace your REST API. It wraps your business logic and presents it in a way that is legible to an AI agent. Your existing endpoints can stay exactly where they are. You are just adding a smarter front door.

The Real Reason You Should Care Right Now

I have been in this industry long enough to know that "future-proofing" is usually code for "over-engineering something nobody asked for." I say this as someone who has committed that sin more than once.

But this is different, and here is why.

The tools developers use are already MCP-aware. Claude, GitHub Copilot Workspace, Cursor, and a growing list of IDEs and agent frameworks support MCP out of the box. Your developers' AI assistants are already trying to understand your codebase and your APIs. If you make your system MCP-readable, you are not preparing for some distant AI future. You are improving the experience for your team today.

When we started thinking about how AI-assisted workflow building would work, it became obvious fast that dumping our REST surface area in front of an agent and hoping for the best was not a plan. The agent needed to know what a "workflow step" meant in our domain, not just what shape the JSON had. MCP gave us the vocabulary to express that.

And once we started thinking in terms of tools and resources rather than endpoints and payloads, our API design got cleaner too. That was a nice bonus we did not expect.

How to Get Started Without Rewriting Everything

This is the part people always want, so here it is.

You do not rewrite your existing API. Please do not rewrite your existing API. You create an MCP server alongside it.

Start by picking your three or four most important capabilities. Not all of them. The ones an AI agent would actually need to help a user get something done. For a project management tool, maybe that is creating a task, listing tasks by status, and updating a task. That is it for now.

For each one, write a tool definition. Give it a name that describes intent rather than implementation. createTask beats POST /tasks. Write a description that explains what it is for, not just what it does. Include every field in the input schema with a description. Do the same for outputs.

Then wire that tool definition to the actual function in your codebase. The MCP SDK for your language of choice handles the protocol layer. You focus on the business logic.

Test it with Claude Desktop or any MCP-compatible client. Ask the agent to do something. Watch what it does. You will immediately see where your tool descriptions are confusing and where they are clear. That feedback loop is extremely fast and extremely useful.

Then iterate. Add more tools. Add resources if your agents need to browse data. Add prompts if you want to guide the agent toward correct reasoning in your domain.

A Few Things to Get Right Early

Authentication matters. MCP does not define how you authenticate, which means you need to. OAuth 2.0 works well here. Make sure your tools respect the same permission model your REST API does. An AI agent should not be able to do things a user cannot do.

Versioning matters. Your tool definitions will change as you learn more about how agents use them. Plan for that. A description rewrite is not a breaking change, but a schema change is.

Logging matters more than you think. When an agent calls your tools, you want to know what it asked for, what you returned, and how long it took. This is how you catch the weird edge cases and the occasional "why did it do that" moments.

Keep tool scope narrow. One tool should do one thing well. Resist the urge to build a mega-tool that accepts fifteen optional parameters and does different things depending on which ones you pass. That works okay for human developers who read docs. It does not work for AI agents that are trying to reason about what a tool is for.

The Bigger Idea

REST APIs were designed for a world where the consumer was a developer writing code against a known contract. That world is not going away. But a new world is sitting right next to it, where the consumer is an AI agent trying to accomplish a goal on behalf of a user.

Building MCP-ready systems is not about chasing a trend. It is about recognizing that the assumptions baked into REST do not all hold when the client is an AI. And fixing those assumptions now, while you are building, costs a fraction of what it costs to retrofit them later.

You already know this pattern. You designed your REST API for the client consuming it. Now design your MCP layer for the AI agent consuming it.

Same principle. New client.

Your future self, and your future AI colleagues, will thank you.


Mano works as Senior Development Manager and Software Architect at Cavintek, where the team builds Cflow, a workflow automation platform. He has been writing software and occasionally regretting earlier versions of it for about 13 years.