Dev Dave

Dark green MCP versus REST cover with a highlighted use-both headline and a terminal panel showing two interfaces sharing backend permissions

MCP vs REST: When to Use Both

By David Topoika — Flutter & backend developerPublished Updated
AIMCPNode.jsAPI IntegrationBackend

If your app already has a working REST API, adding an AI assistant usually does not mean rebuilding the backend around MCP. Keep the application rules you already need, and add an MCP adapter when compatible AI clients need a standard way to discover and invoke a carefully selected set of capabilities.

That distinction matters as agents move beyond chat. On November 10, 2026, Google announced Gemini 4 Carbon with an emphasis on longer-running developer workflows. On October 27, IBM announced agent identity and access-control capabilities. My takeaway from these announcements is that connecting a model is becoming a smaller part of the engineering problem. Deciding what that connection is allowed to do is becoming a larger one.

Here is how I would approach that decision for a Node.js backend serving a mobile app, a dashboard, and an AI assistant. The example is illustrative; it is not a claim that I have deployed this particular system for a client.

What is the difference between MCP and a REST API?

REST is an architectural style for distributed systems, with constraints such as stateless communication and a uniform interface. In everyday app development, a REST-style API commonly exposes resources through HTTP endpoints, such as an order resource retrieved by a mobile client.

MCP, the Model Context Protocol, standardizes how AI applications connect to external capabilities. An MCP server can expose tools with names, descriptions, and input schemas that a compatible client can discover and invoke. The tools specification describes that interaction.

They address different layers of the system. Your Flutter app can keep using its existing API while an AI client uses an MCP tool backed by the same application service. MCP can also call an existing HTTP API; it does not have to access the database directly or live in the same process.

When is a REST API enough?

Start with the simplest integration that serves the actual product:

  • A mobile app or dashboard with known workflows can use its existing API.
  • One assistant under your control can call a small, explicit set of backend functions through your chosen model's tool interface.
  • A service that does not need discovery by independent AI clients may gain little from maintaining another protocol adapter.

Avoid adding MCP only because it is in the news. It adds an interface to operate, secure, document, and test. For a first release, an unnecessary integration can consume time better spent finishing the user journey. That is the same scope discipline I recommend when planning a Flutter MVP.

When does an MCP server earn its place?

MCP becomes useful when there is a clear interoperability requirement: several compatible AI clients need access to the same product capabilities, or a customer specifically needs to connect their assistant to your service.

Define the useful operation first. For customer support, that might be lookup_order_status, rather than a general-purpose “run a database query” tool. A narrow operation is easier to explain, authorize, evaluate, and revoke. It also keeps the assistant focused on the customer's task. If the main task is answering questions from approved documents, start with the retrieval and permission decisions in RAG for business apps.

Before committing to it, verify which clients and protocol versions you need to support, how users will authorize access, and who will operate the server. A standard protocol reduces some integration differences; it does not remove those product decisions.

Share application rules across both interfaces

My starting architecture would put the order lookup and its access rules in one application service. The REST handler and MCP tool handler would both validate their transport inputs and invoke that service with a trusted, authenticated principal.

A mobile or web client uses a REST adapter, and an AI client uses an MCP adapter; both call shared application services that enforce access rules before using the database
Two interfaces, one application boundary. Client-provided tool arguments do not select the authenticated user or tenant.

The following small Node.js service demonstrates that boundary:

export function createOrderLookup(repository) {
  return async function lookupOrder(args, principal) {
    if (!principal?.userId || !principal.tenantId ||
        !principal.scopes?.includes("orders:read")) {
      throw new Error("Forbidden");
    }
    if (!args || typeof args.orderId !== "string" ||
        !/^[a-zA-Z0-9_-]{1,64}$/.test(args.orderId) ||
        Object.keys(args).some((key) => key !== "orderId")) {
      throw new Error("Invalid arguments");
    }
    const order = await repository.findForCustomer({
      id: args.orderId,
      tenantId: principal.tenantId,
      customerId: principal.userId,
    });
    if (!order || order.tenantId !== principal.tenantId ||
        order.customerId !== principal.userId) {
      throw new Error("Not found");
    }
    return { orderId: order.id, status: order.status };
  };
}

The important detail is where principal comes from: trusted authentication middleware, not the prompt or tool arguments. The repository query is scoped to the customer and tenant, and the return value includes only the fields the operation needs.

This is an application-service example, not a complete MCP server. Protocol registration, token verification, schema declarations, database implementation, rate limits, and transport error handling still need to be supplied. In a real repository, both adapters should call this same service rather than copy its checks into two separate implementations.

I tested the accompanying downloadable service example and boundary tests for permitted lookups, missing permission, unexpected arguments, cross-tenant and cross-customer results, and accidental disclosure of extra fields. Those tests exercise the service boundary; they are not a production security audit.

What security still belongs to your backend?

MCP is an integration protocol, not blanket authorization. The official security guidance specifically rejects token passthrough: an MCP server must validate that tokens were issued for it, rather than blindly forwarding an incoming bearer token to another service.

For an initial integration, I would require:

  • Verified identity and scope: establish who is acting and what they can do on each request. Never trust a user ID supplied by the model.
  • Object-level permission checks: a valid token is not permission to read another customer's order.
  • Narrow outputs: return the information the task requires, not an entire database record with billing or internal fields attached.
  • Operational controls: use timeouts, rate limits, audit records, and a way to revoke the integration.
  • Separate treatment for writes: refunds, messages, deletions, and payments need action-specific authorization and confirmation where appropriate.

Tool descriptions and schema validation help define an interface. They do not prove that an action is permitted, and untrusted content can still influence a model. Keep the enforcement outside it; I discuss the broader threat in AI agent security.

How should a small team start?

Choose one read-only operation with a clear owner and a measurable use case. Define what a successful answer looks like and what data must never leave the service. Test denied requests as carefully as allowed ones, then try the integration in the actual clients you intend to support.

Measure task completion, latency, errors, and support effort before exposing more capabilities. If the existing API solves the problem cleanly, keeping it is a reasonable outcome. If client interoperability matters, an MCP adapter can extend that backend without turning it into a second set of business rules.

Define a tool contract around a real support task

Consider an agent helping a signed-in customer find an order's delivery state. The useful operation accepts an order ID and returns the limited fields needed for the answer. It does not accept arbitrary SQL, a user ID to impersonate, or a tenant selected by the model.

An illustrative input schema could be:

{
  "type": "object",
  "properties": {
    "orderId": { "type": "string", "maxLength": 64 }
  },
  "required": ["orderId"],
  "additionalProperties": false
}

A transport adapter validates that schema and calls the shared application service. The authenticated principal comes from the adapter's trusted identity handling, not from a field added to the tool arguments. The sample service in this article makes that distinction explicit and checks ownership again on the repository result.

Schema validation narrows the request shape. It does not establish permission, prove the model chose the correct order, or make the returned explanation accurate. Those remain separate application and evaluation concerns.

Trace a denied request through both interfaces

A useful integration review includes the same customer's permitted lookup through REST and the MCP tool. Then request another customer's order using both interfaces. Both paths should deny disclosure, even if the external client displays errors differently.

Test a missing scope, an expired credential, an unexpected argument, an oversized identifier, and a repository result outside the principal's tenant. Also inspect what appears in logs and tool error messages. A denial that includes the restricted customer's address in its explanation still discloses information.

Keep the service boundary tests fast and separate from end-to-end client tests. The downloadable order service includes local tests for the narrow service. It does not implement a complete protocol server, identity provider, or database, so passing those tests does not prove that an arbitrary MCP deployment is secure.

Add writes as a different product decision

A read-only order lookup has a smaller consequence than issuing a refund or changing a delivery address. Before exposing a write, define who approves it, which objects may change, the allowed amount or action scope, and what happens when the agent or network retries.

For an illustrative refund workflow, the assistant might prepare a request and show its details for authorized review. The backend would check the order, current eligibility, permitted amount, and stable operation identity before committing the action. A confirmation received for one amount must not silently authorize a later, different action.

Persist an audit record and result that can be inspected after a timeout. A model saying “done” is not proof that the operation committed, and a tool call that times out is not proof that nothing happened. The payment idempotency guide explains the uncertainty around external side effects in more detail.

Plan the integration's operational boundaries

Set request and response size limits, timeouts, rate limits, and a maximum amount of work each operation can trigger. Avoid a narrow-looking tool that internally performs an unbounded crawl or loads every customer record before filtering in memory.

Document supported clients, protocol versions, identity setup, and revocation. Test the actual target client instead of assuming that every implementation supports the same capabilities. If a client disconnects, decide whether the operation should stop or continue, and how an operator can recover its result.

Keep data retention intentional. Tool arguments and outputs can contain personal information, so an unrestricted debug transcript should not become the default production log. Record useful request IDs, action types, outcomes, and timing while keeping sensitive content limited to the systems that need it.

For a first release, one well-defined operation, an end-to-end client check, and denied-request tests can provide better evidence than a catalogue of untested tools. Add another interface because a user or integration needs it, then measure whether it helps that workflow complete reliably.

If you are connecting an assistant to an existing product, my backend and API development services and AI integration services cover the application boundary as well as the integration. Discuss the workflow with me before deciding which protocols the first release actually needs.

Want help with something similar?

If this article matches a problem you're facing, I can help you scope it and ship it — starting with a quick consultation.

Related Articles

Agent Skills Explained
Dark green Agent Skills Explained cover with layered reference, script, and SKILL.md cards in the established green editorial style

November 14, 2026

Agent Skills Explained

Learn how agent skills turn repeatable development work into reviewable workflows, with a complete SKILL.md example, permission boundaries, and evalua...

AIDeveloper ToolsAgent SkillsWorkflows
AI Chips Explained
Dark green AI chips cover with chips highlighted and a detailed processor illustration labelled GPU, TPU, and NPU

November 14, 2026

AI Chips Explained

Understand GPUs, TPUs, and NPUs through real app workloads: model memory, inference latency, batching, local AI, and the questions to ask before choos...

AIAI ChipsInfrastructureBackend
Android Apps for AI Agents
Dark green Android Apps for AI Agents cover showing an agent connecting to an app inside an outlined phone

November 14, 2026

Android Apps for AI Agents

A practical guide to Android AppFunctions and agent-ready apps: capability design, Flutter integration, account permissions, confirmation flows, and t...

AndroidAIFlutterMobile Development

Get In Touch

Let's Work Together

I'm currently open to new opportunities and collaborations. Whether you have a project in mind or just want to say hello, feel free to reach out!

Dev Dave

© 2026 Topoika. All rights reserved.

This site uses cookies to understand how visitors use it and to improve the experience. You can accept or reject analytics cookies at any time — read the privacy note.