MCP as a Safe AI Integration Boundary

MCP is interesting because it makes AI integrations feel less like prompt magic and more like software boundaries.

That is the part I care about. A model should not get vague access to an application. It should get a small set of tools with names, schemas, permission checks, and predictable results. The boundary should be visible enough that an engineer can review it and a user can understand what the assistant is allowed to do.

A safe tool can be very small.

const GetJobStatusInput = z.object({
  jobId: z.string(),
});

This tool does one thing: it reads the status of a job the user is allowed to see. It does not update records, skip permissions, or infer hidden state from private data. The boring shape is useful.

I like starting AI integrations with read-only tools. They help users ask questions without giving the assistant mutation power too early. If read-only tools are not useful, mutating tools probably will not be safe just because they are more powerful.

When a tool does change something, I want the app to answer a few questions clearly:

  • who is allowed to call it
  • what input shape is accepted
  • what state can change
  • whether the user must confirm first
  • what gets logged after execution
  • how failure is reported

MCP does not solve those questions by itself. It gives a place to express the boundary. The product still needs permission checks, confirmation states, audit logs, and careful copy.

The risk is that tool names can sound safe while the implementation is too broad. A tool called updateRecord is not a product boundary. It is a vague remote control. A better tool should describe a specific action with a narrow input and a clear result.

Too broad: updateRecord
Better: draftStatusChange
Better: confirmStatusChange

That split matters. Drafting a change and applying a change are different actions. One can be safe for the assistant to prepare. The other may need the user to review and confirm.

The trade-off is speed. A narrow tool set takes more design work than giving the assistant a general API client. I think that work is worthwhile when the product contains important data. The assistant should make workflows easier, not create a second path around normal product rules.

I would use MCP when I want the AI boundary to be explicit and reviewable. I would still keep the same product rules behind the tools that I keep behind normal routes and APIs. The model can choose a tool, but the server should still decide what is allowed.

Related Posts

Astro for Documentation and a Professional Site

I use Astro because this site is mostly writing. I do not need a heavy app framework for pages that should load fast and be easy to edit. That sounds simple, but it is the mai

read more

Localization in Product Apps

Localization is not only replacing English strings with another language. In a product app, language touches workflow. It changes labels, validation messages, dates, empty states, permissions copy, d

read more

Zod, OpenAPI, and Swagger for API Contracts

A public API is not just backend code. It is a product surface for another developer. That means the contract has to be readable. It also has to be enforced at runtime. Types in the app are useful, b

read more

pg-boss for Durable Background Jobs

The customer problem was not "we need a queue". The problem was that a slow operation made the user wait with no clear answer. That distinction matters. A queue is an implementation detail. The produ

read more

Pragmatic Drag and Drop for Real Ordering Tasks

Drag and drop is easy to add for a demo and harder to make reliable for real work. The product question is not "can the item move on screen?" The question is whether the user can safely change an ord

read more

Prisma and PostgreSQL as the Product Source of Truth

I do not think of PostgreSQL as only infrastructure. In a product app, it is where the product remembers what happened. That makes database design a product decision. I

read more

React Router for Full-Stack Product Workflows

A route is not only a URL. In a product app, a route often represents a task the user is trying to finish. That sounds obvious, but it changes how I design the code. A settings page that starts an im

read more

shadcn-Style UI as an Owned Product System

I like copied UI primitives because they make the component library feel like part of the app, not something the app is borrowing. That is the part of the shadcn/ui-style ap

read more

Dense Operational UI with Tables and Editors

Sometimes a simple form is the wrong UI. If the user needs to compare many values and make careful edits, a table can be kinder than a long page of inputs. Dense UI has a bad reputation when it is us

read more

Vercel AI SDK with Explicit Tool Boundaries

The risky part of an AI feature is not the chat UI. The risky part is what the chat is allowed to do. It is easy to make an assistant feel powerful by giving it tools. With something like the [Vercel

read more

Vertical Slice Architecture with Dependency-Cruiser

I like vertical slices because they make a feature easier to delete, move, or review. The folder structure is not the main value. The value is that the code for one workflow is not spread across ten u

read more

Testing Product Workflows with Vitest and Playwright

I do not want a test suite that only proves functions work. I want it to protect the workflows that would hurt if they broke. That does not mean every rule needs a browser test. Browser tests are val

read more

Zod Beyond Validation

Zod is usually introduced as a validation library. That is true, but the more useful idea is boundary definition. A TypeScript type only helps after data is already inside the pro

read more