MCP servers: connecting an agent to your tools without opening every door
An MCP server gives an AI agent access to a tool: email, tickets, code, a database. The flaws already published, the checklist before adding a third-party server, the skeleton of an internal server that asks for confirmation before writing, and the rules we set on our own tools.
Local server
The AI application
The MCP server
Started on the workstation
The tool
- The token: in the workstation’s environment
- The log: on each workstation, when there is one
- A flaw compromises the workstation and its secrets
Remote server
The AI application
The MCP server
Shared, on the web
The tool
- The token: issued for this server, which refuses any other
- The log: in one place for everyone
- A flaw stays bounded by its tokens
An MCP server is a program that gives an AI agent access to a tool: your email, your tickets, a code repository, a database. MCP (Model Context Protocol) is the open standard that sets how AI applications and these servers talk to each other. Connecting a server is easy, which is exactly why you have to decide beforehand what the agent will be able to do.
Anthropic released MCP in November 2024; since December 2025 it has been maintained by the Agentic AI Foundation, under the Linux Foundation, and the current version of the specification dates from 28 July 2026. This article gives the checklist we run before adding a third-party server, the skeleton of an internal server, and the rules set on our own tools.
What an MCP server really gives the agent
A server mostly exposes tools, meaning actions the agent can trigger (send a message, create a ticket, change a file), and resources, data it can read. Tools carry the risk: each one is a real action, carried out with the rights of the token the server holds.
The flaws already published
- April 2025, instructions hidden in tools. Invariant Labs describes tool poisoning: instructions slipped into a tool’s description, invisible to the person, read by the model.
- May 2025, a booby-trapped issue. The same team shows that a malicious issue in a public repository can lead an agent connected to GitHub through MCP to leak data from private repositories: a problem with the agent’s architecture, not a flaw in GitHub’s server.
- July 2025, flaws in widely used components. The mcp-remote tool (CVE-2025-6514, command execution) and the official filesystem server (CVE-2025-53109 and CVE-2025-53110, an escape from the allowed folder).
- September 2025, a fake server. An npm package posing as the MCP server of the email service Postmark secretly copied messages to an outside address; Postmark confirmed it had never been involved.
- April 2026, the local interface. OX Security shows that the local interface of the official kits (STDIO) turns a configuration into an executed command, in many products built on it.
- September and October 2026, badly checked tokens. A flaw in the LiteLLM gateway, which gave access to MCP tools without a valid key, enters CISA’s catalogue of actively exploited vulnerabilities (CVE-2026-59822); the official TypeScript kit fixes a flaw that made a server accept tokens issued for another service.
OWASP is preparing a list dedicated to MCP, still in beta, which names token mismanagement, tool poisoning and servers installed without approval (“shadow MCP”), among others.
Local or remote server: where the token and the log live
Local server | Remote server | |
|---|---|---|
Where it runs | On the person’s workstation, started by their AI application | On a shared server, called over the web |
Where the token lives | In the workstation’s environment, often with the person’s rights | On the server side: the agent presents an OAuth token issued for this server, which refuses any other token |
The log | On each workstation, when there is one | In one place for everyone |
What a flaw compromises | The workstation and its secrets | What the server may do, bounded by its tokens |
For a team | For trials, isolated in a container or a sandbox | Published in an approved internal catalogue |
The specification makes a protected remote server an OAuth 2.1 resource server: it must check that every token was issued for it, and never accept or relay any other. In practice, we are far from it: a study by Astrix Security (October 2025) of more than 5,200 open-source servers found that 53% rely on static access keys or personal tokens, and only 8.5% on OAuth.
The checklist before adding a third-party server
- It comes from the vendor’s official source; MCP’s official registry, still in preview, helps find it but guarantees nothing.
- Its version is pinned, like any dependency, and every update is reviewed.
- Its code is read, or its vendor known: a package named like a known vendor is suspect until checked.
- It gets a token of its own, limited to what it has to do; never an administrator’s personal token.
- Its tool descriptions and annotations are reviewed when it is added and at every update: the specification asks to treat them as untrusted when the server is not trusted.
- Its write tools are identified and go through a person’s confirmation: the specification wants a person to always be able to refuse a tool call.
- What it can send outside is known, and limited.
- Every call is logged: which agent, which tool, which parameters, which result.
- A local server runs isolated, in a container or a sandbox.
- It has an owner, and a review date.
The skeleton of a minimal internal server
For your internal tools, an in-house server exposes exactly what the agent must be able to do, and nothing else: a read tool, a write tool that waits for the person’s confirmation, parameters checked by the server, and OAuth tokens issued for it alone. The example of a ticketing tool, with version 2 of the official TypeScript kit, which follows the specification of 28 July 2026:
import { McpServer, acceptedContent, createMcpHandler, inputRequired, inputResponse } from '@modelcontextprotocol/server'
import type { CallToolResult, InputRequiredResult } from '@modelcontextprotocol/server'
import { createMcpExpressApp, getOAuthProtectedResourceMetadataUrl, mcpAuthMetadataRouter, requireBearerAuth } from '@modelcontextprotocol/express'
import { toNodeHandler } from '@modelcontextprotocol/node'
import * as z from 'zod/v4'
import { oauthMetadata, verifyAccessToken } from './identity.js' // your identity provider
import { tickets } from './tickets.js' // your tool’s client, which keeps its own key
// The server checks the parameters itself, without trusting the model.
const ticketId = z.string().regex(/^T-[0-9]{1,8}$/)
const confirmation = z.object({ confirm: z.boolean() })
function buildServer() {
const server = new McpServer({ name: 'internal-tickets', version: '1.0.0' })
// Read-only: the agent reads without asking.
server.registerTool('get_ticket', {
title: 'Read a ticket',
description: 'Returns the title, status and last message of a ticket.',
inputSchema: z.object({ id: ticketId }),
annotations: { readOnlyHint: true, openWorldHint: false },
}, async ({ id }): Promise<CallToolResult> => {
const ticket = await tickets.get(id)
return { content: [{ type: 'text', text: JSON.stringify({ title: ticket.title, status: ticket.status }) }] }
})
// Write: nothing happens until the person has confirmed.
server.registerTool('close_ticket', {
title: 'Close a ticket',
description: 'Closes a ticket after the person confirms.',
inputSchema: z.object({ id: ticketId, reason: z.string().max(500) }),
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
}, async ({ id, reason }, ctx): Promise<CallToolResult | InputRequiredResult> => {
const view = inputResponse(ctx.mcpReq.inputResponses, 'confirm')
if (view.kind === 'elicit' && view.action !== 'accept') {
return { content: [{ type: 'text', text: 'Cancelled by the person.' }], isError: true }
}
const answer = acceptedContent(ctx.mcpReq.inputResponses, 'confirm', confirmation)
if (answer?.confirm !== true) {
return inputRequired({ inputRequests: { confirm: inputRequired.elicit({ message: `Close ${id}?`, requestedSchema: confirmation }) } })
}
await tickets.close(id, reason)
return { content: [{ type: 'text', text: `Ticket ${id} closed.` }] }
})
return server
}
// Remote server: it only accepts tokens issued for it (OAuth 2.1).
const url = new URL('https://mcp.your-company.example/mcp')
const auth = requireBearerAuth({
verifier: { verifyAccessToken },
requiredScopes: ['tickets'],
resourceMetadataUrl: getOAuthProtectedResourceMetadataUrl(url),
expectedResource: url,
})
const app = createMcpExpressApp({ host: '0.0.0.0', allowedHosts: ['mcp.your-company.example'] })
app.use(mcpAuthMetadataRouter({ oauthMetadata, resourceServerUrl: url }))
const handler = createMcpHandler(buildServer)
app.all('/mcp', auth, (req, res) => void toNodeHandler(handler)(req, res, req.body))
app.listen(3000)The annotations (read-only, destructive) help the application present the tool, but protect nothing: the protection is the confirmation, the rights the server checks and the limited token. The tool’s client keeps its own key; the agent never sees it.
The tools we connected to our agents
Our administration agents use two sensitive tools, connected in two ways:
- Electronic signature, through a restricted MCP connector. Opened on our account, with no key in the repository: the agent reads, creates drafts and adds the planned signers; our settings deny it sending a signature request and changing or removing signers. Sending remains a person’s click.
- The management tool, through a command-line interface. No MCP connector: the agent calls a dedicated interface, which keeps the key in its own environment and returns only filtered data.
In both cases, the same rule: the key never goes through the agent, and whatever commits the company waits for a person. The other guardrails, least privilege, logs, a stop button, are detailed in our article on securing AI agents.
This is what we set up in One shared foundation for all your AI agents, with the guardrails of our offer AI agents under control. See also our article on rolling out coding agents, and the page Agentic AI.
Frequently asked questions
What is MCP?
An open standard for connecting an AI application, such as an agent, to outside systems (tools, data, services) in a way shared by all vendors.
Is an MCP server safe?
No more and no less than its code, its origin and the rights it is given. An official server, at a pinned version, with a limited token and human approval of sensitive actions, carries a controlled risk; a package found at random with an administrator token does not.
Who maintains the protocol today?
Since December 2025, the Agentic AI Foundation, under the Linux Foundation, co-founded by Anthropic, Block and OpenAI.
Do you need one MCP server per tool?
Usually, one server per connected service. Fewer servers mean a smaller attack surface: add a server only for a specific use.
Sources
Written with an AI assistant from the sources cited, facts checked and reviewed by Mehdi Chafik on 26 October 2026.
- Model Context Protocol, specification of 28 July 2026.
- MCP specification, authorization; security best practices; tools.
- Anthropic, donating MCP to the Agentic AI Foundation, 9 December 2025.
- MCP, official registry (preview).
- Official MCP TypeScript SDK, version 2; its security advisories.
- Invariant Labs, tool poisoning attacks, 1 April 2025.
- Invariant Labs, GitHub MCP and private repositories, 26 May 2025.
- NVD, CVE-2025-6514 (mcp-remote), 9 July 2025.
- Cymulate, CVE-2025-53109 and CVE-2025-53110 (filesystem server), July 2025.
- Postmark, on the malicious postmark-mcp package, 25 September 2025.
- Astrix Security, state of MCP server security, 15 October 2025.
- OX Security, “The Mother of All AI Supply Chains”, 15 April 2026.
- NVD, CVE-2026-59822 (LiteLLM), added to the CISA catalogue on 2 September 2026.
- OWASP, MCP Top 10 project (beta).