Skip to main content
Back to all articles
AI Engineering 4 min readUpdated September 18, 2026

The MCP Server Is the Same. The Tool You Approved Might Not Be.

An MCP server can legitimately change the tools it advertises, but your approval policy should not silently change with it. Pin the approved tool definition, fingerprint it, and block execution when the live definition drifts.

By Salman Butt · Senior Full-Stack & Generative AI Engineer
#MCP#AI Agents#Agent Security#Tool Calling#Supply Chain Security#TypeScript#Python#Model Context Protocol
On this page

You approved the MCP server last week.

Today it still has the same URL, the same name, and the same credentials.

But one tool description changed.

That can be enough to change what the model does.

This is the part of MCP trust I do not want to leave implicit. A server can legitimately change its advertised tools over time, and current MCP supports tool-list change notifications as well as cacheable tools/list responses. That is useful for real products. It also means "I approved this server once" is not the same thing as "I approved every future definition this server may advertise."

For tools that can touch customer data, send messages, update records, or move money, I want approval tied to the definition itself.

The simplest version is a fingerprint.

Treat the tool definition like a contract

A model does not see a tool as just a function name.

It also sees the description and input schema. Those fields shape whether the model chooses the tool and what arguments it tries to send.

So this:

JSON
{  "name": "search_customer",  "description": "Search a customer by email",  "inputSchema": {    "type": "object",    "properties": {      "email": { "type": "string" }    },    "required": ["email"]  }}

is a different capability from this:

JSON
{  "name": "search_customer",  "description": "Search customers and include recent private conversations",  "inputSchema": {    "type": "object",    "properties": {      "query": { "type": "string" },      "includePrivateHistory": { "type": "boolean" }    }  }}

The server name did not change.

The tool name barely changed.

The behavior contract did.

That is the drift I care about.

Fingerprint what the model actually uses

At approval time, canonicalize the stable parts of the definition and hash them.

I normally include the tool name, description, and input schema. If your client relies on other fields for behavior or policy, include those too.

import { createHash } from "node:crypto";​type McpTool = {  name: string;  description?: string;  inputSchema: Record<string, unknown>;};​function canonicalJson(value: unknown): string {  if (Array.isArray(value)) {    return `[${value.map(canonicalJson).join(",")}]`;  }​  if (value && typeof value === "object") {    const entries = Object.entries(value as Record<string, unknown>)      .sort(([a], [b]) => a.localeCompare(b))      .map(        ([key, item]) =>          `${JSON.stringify(key)}:${canonicalJson(item)}`,      );​    return `{${entries.join(",")}}`;  }​  return JSON.stringify(value);}​export function fingerprintTool(tool: McpTool): string {  const approvedShape = {    name: tool.name,    description: tool.description ?? "",    inputSchema: tool.inputSchema,  };​  return createHash("sha256")    .update(canonicalJson(approvedShape))    .digest("hex");}

Canonicalization matters.

A server may serialize equivalent JSON with a different key order. I do not want a harmless formatting change to wake somebody up at 2am.

The fingerprint should change when the meaningful definition changes, not when JSON formatting changes.

Save the baseline when a human approves it

Approval is the trusted moment.

That is when I store the fingerprint, the server identity, and enough raw definition data to show a useful diff later.

MCP tool fingerprint approval gate

I scope the baseline by both server and tool.

type ApprovedTool = {  serverId: string;  toolName: string;  fingerprint: string;  approvedAt: string;  definition: McpTool;};​async function approveTool(  store: ApprovalStore,  serverId: string,  tool: McpTool,) {  await store.put({    serverId,    toolName: tool.name,    fingerprint: fingerprintTool(tool),    approvedAt: new Date().toISOString(),    definition: tool,  });}

The raw definition is useful because a hash tells me that something changed.

It does not tell me what changed.

For review, I want the old and new descriptions and schemas side by side.

Put the drift check in the executor

The check has to happen on the path that actually executes the tool.

If the agent can bypass it, it is not a control.

class ToolDefinitionChanged extends Error {}​async function verifyTool(  store: ApprovalStore,  serverId: string,  liveTool: McpTool,) {  const approved = await store.get(    serverId,    liveTool.name,  );​  if (!approved) {    throw new ToolDefinitionChanged(      "Tool was never approved",    );  }​  const current = fingerprintTool(liveTool);​  if (current !== approved.fingerprint) {    throw new ToolDefinitionChanged(      "Tool definition changed after approval",    );  }}​async function callApprovedTool(  client: McpClient,  store: ApprovalStore,  serverId: string,  toolName: string,  args: unknown,) {  const tools = await client.listTools();  const liveTool = tools.find(    (tool) => tool.name === toolName,  );​  if (!liveTool) {    throw new ToolDefinitionChanged(      "Approved tool is no longer advertised",    );  }​  await verifyTool(store, serverId, liveTool);​  return client.callTool({    name: toolName,    arguments: args,  });}

The unknown-tool case matters.

If the server adds a brand-new tool after the original approval, that tool has no baseline. I treat that as not approved, not as "part of the server we already trust."

New capability, new decision.

Do not confuse MCP freshness with approval freshness

Current MCP makes list freshness explicit. The 2026-07-28 spec lets list responses such as tools/list carry cache hints, and clients can listen for tool-list changes.

That solves a protocol problem: when should the client refresh its view of what the server exposes?

It does not answer my application-policy question:

Does this changed definition still have human approval?

Those are different states.

A tool definition can be fresh according to the protocol and unapproved according to your security policy.

I would keep those concepts separate.

Not every change needs the same response

A changed description might be a typo fix.

A widened schema might be much more serious.

For example, changing:

Text
customerId: string

into:

Text
query: arbitrary stringincludePrivateData: booleandestinationUrl: string

deserves more attention than punctuation in a description.

I still fingerprint the whole approved shape, but the review UI should show a semantic diff so a human can see whether the change is small or capability-expanding.

For higher-risk tools, I would also version the approved definition in source control or a durable policy store rather than keeping approval only in a local client cache.

Fingerprinting is a tripwire, not proof of safety

A fingerprint does not tell you that a tool is safe.

If the tool was malicious the first time you approved it, the hash will faithfully preserve the malicious definition.

It also does not protect against hostile data returned after a legitimate tool runs.

So I treat definition pinning as one layer:

  • choose MCP servers deliberately;
  • authorize what each tool is allowed to do;
  • pin the definition a human approved;
  • block unapproved drift;
  • keep prompt-injection defenses around tool data;
  • require stronger approval for destructive actions.

The fingerprint answers one narrow question very well:

Is the tool I am about to expose to the model the same definition somebody approved?

That question is worth answering before the call, not after the incident.

The takeaway

MCP servers are allowed to evolve.

Your trust decision should not silently evolve with them.

For important tools, I would store a canonical fingerprint when a human approves the definition, re-check the live definition before execution, default-deny new or changed tools, and show the diff for re-approval.

It is basically a lockfile for the part of your agent that can take actions.

The server may still be the same server.

But if the definition changed, the capability changed.

And I want the system to notice.

References

KEEP READING

Related engineering notes