# MCP vs OAuth: What You Actually Need to Know About AI Agent Security (2026)

> By Kris Newlin · Published 2026-03-29 · Updated 2026-10-28
> Source: https://viktor.com/blog/mcp-vs-oauth

By Kris Newlin. Updated October 28, 2026.

## Key takeaways

Model Context Protocol (MCP) is an open standard that lets AI applications connect to outside tools and data through one common interface. OAuth is the authorization framework that decides what those connections are allowed to touch. They are not rivals: the MCP specification requires OAuth 2.1 for remote servers, so every secure MCP setup uses both.

- **MCP is the connection layer.** It defines how an AI app (the client) discovers and calls tools, resources and prompts on an MCP server, using JSON-RPC messages.
- **OAuth is the permission layer.** It issues short-lived, scoped tokens so the AI app never sees your password, and you can revoke access at any time.
- **The real risks sit between the two.** Token theft, tool poisoning, the confused deputy problem and over-broad scopes have all shown up in real incidents since 2025.
- **For most teams, the outcome matters more than the protocol.** Ask whether your AI tool uses scoped tokens, lets you revoke access, and shows you an action before it runs.

## What is Model Context Protocol (MCP)?

Model Context Protocol is an open-source standard for connecting large language models (LLMs) to the systems where work happens: files, databases, SaaS apps and internal APIs. Anthropic released it in November 2024. OpenAI, Google DeepMind, Microsoft and hundreds of tool vendors adopted it within a year, and in December 2025 Anthropic donated it to the [Agentic AI Foundation](https://blog.modelcontextprotocol.io/) under the Linux Foundation.

The official docs describe MCP as a “USB-C port for AI applications,” and the analogy holds. Before USB, every printer, mouse and keyboard needed its own connector. Before MCP, every pairing of an AI app and a tool needed its own custom integration. With 10 AI apps and 100 tools, that is 1,000 one-off connectors to build and maintain. This is the N × M integration problem. MCP turns it into N + M: each tool ships one MCP server, each AI app ships one MCP client, and any client can talk to any server.

MCP does not replace APIs. A server usually wraps an existing REST API; MCP adds a standard way for the model to find out what a tool can do at runtime.

## How MCP works: hosts, clients and servers

MCP has three roles. Getting them straight makes the security discussion much easier.

- **Host.** The application host process the person actually uses, such as Claude Desktop, ChatGPT, Cursor or VS Code. The host runs the LLM and decides which connections to open.
- **Client.** A connector inside the host. Each client keeps one stateful session with one server and handles the protocol messages.
- **Server.** A program that exposes a tool or data source. A GitHub MCP server, for example, offers functions such as “create issue” or “search code.”

Messages between client and server use JSON-RPC 2.0. When a session starts, the two negotiate capabilities and the client asks what the server offers.

### What are tools, resources and prompts in MCP?

Servers expose three kinds of primitives:

```json:object
{
  "_key": "k53",
  "_type": "table",
  "rows": [
    {
      "_key": "k49",
      "_type": "tableRow",
      "cells": [
        "Primitive",
        "What it is",
        "Who controls it",
        "Example"
      ]
    },
    {
      "_key": "k50",
      "_type": "tableRow",
      "cells": [
        "Tools",
        "Functions the model can call to take an action or fetch live data",
        "The model decides when to call them",
        "create_issue, send_message, run_query"
      ]
    },
    {
      "_key": "k51",
      "_type": "tableRow",
      "cells": [
        "Resources",
        "Read-only data the app can load into the model’s context",
        "The host app decides what to attach",
        "A file, a database schema, a CRM record"
      ]
    },
    {
      "_key": "k52",
      "_type": "tableRow",
      "cells": [
        "Prompts",
        "Reusable templates a person can trigger",
        "The user picks them",
        "“Summarize this pull request”"
      ]
    }
  ]
}
```

Resources work much like retrieval-augmented generation (RAG): they put relevant data in front of the model. Tools let the model change things in the outside world, which is why they carry most of the security risk.

### Transports: local (stdio) vs remote (Streamable HTTP)

MCP messages travel over one of two transports:

- **stdio** for local servers. The host starts the server as a process on your own machine and talks to it through standard input and output. Nothing goes over the network, and the server runs with your user’s permissions. Most desktop setups work this way.
- **Streamable HTTP** for remote servers. The server runs in the cloud and the client connects over HTTPS. It replaced the older HTTP+SSE transport in the March 2025 spec. Remote servers are where OAuth comes in, because the server has to know who is calling and what they may do.

## How is MCP configured? A worked example

On the desktop, MCP is configured with a JSON file. For Claude Desktop, the file is `claude_desktop_config.json`, found at `~/Library/Application Support/Claude/` on macOS and `%APPDATA%\Claude\` on Windows. This snippet adds the reference filesystem server and gives it access to one folder:

```json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/you/Documents/projects"
      ]
    }
  }
}
```

After a restart, Claude lists the server’s tools and asks before using them. Two security points show already: the folder path is the only boundary, so point it at one project, and `npx -y` runs a downloaded package without asking, so install only servers from publishers you trust.

Remote servers are simpler to add, since most clients now take a server URL and then send you through an OAuth sign-in. Cursor uses an `mcp.json` file with the same structure, and VS Code reads `.vscode/mcp.json`.

**Is there MCP for macOS?** Yes. Claude Desktop for macOS runs local stdio servers out of the box, and community servers exist for Apple Notes, Calendar, Reminders and Shortcuts. Treat those like any app you grant access to your files.

## Popular MCP servers and the AI apps that support them

Which MCP servers are people actually running? The most common ones in 2026:

- **GitHub** (official, remote): issues, pull requests, code search.
- **Slack**: read channels, post messages, search history.
- **PostgreSQL**: read-only queries and schema inspection.
- **Filesystem** (reference server): read and write files in folders you allow.
- **Brave Search**: web search results for the model.
- **Vendor-run remote servers** from Notion, Linear, Atlassian, Stripe, Sentry and Cloudflare, each signed in with OAuth.

Several of these began as Anthropic reference servers and are now maintained by others, so check who publishes the version you install.

Which AI apps support MCP besides Claude? Most of the market:

1. [**Viktor**](https://viktor.com), the [AI employee](https://viktor.com/ai-employee) in Slack and Microsoft Teams. He connects to 9,800+ integrations, most through one-click OAuth, and can also connect to a custom MCP server your team runs.
2. **Claude** (Desktop, Code and claude.ai), from Anthropic.
3. **ChatGPT**, which added MCP connectors in 2025.
4. **Cursor** and **Windsurf**, AI code editors.
5. **VS Code** with GitHub Copilot in agent mode.
6. **Gemini CLI** and **Zed**.

## MCP vs function calling, REST APIs and LangChain tools

MCP is often confused with other ways of giving a model tools. Here is how they compare:

```json:object
{
  "_key": "k151",
  "_type": "table",
  "rows": [
    {
      "_key": "k146",
      "_type": "tableRow",
      "cells": [
        "Approach",
        "What it is",
        "Portable across AI apps?",
        "Best fit"
      ]
    },
    {
      "_key": "k147",
      "_type": "tableRow",
      "cells": [
        "MCP",
        "Open protocol: tools are discovered from a server at runtime",
        "Yes, any MCP client",
        "Sharing one integration across many AI apps"
      ]
    },
    {
      "_key": "k148",
      "_type": "tableRow",
      "cells": [
        "Native function calling",
        "A model vendor’s API feature: you pass tool definitions in each request",
        "No, tied to one vendor’s format",
        "One app, a few tools you code yourself"
      ]
    },
    {
      "_key": "k149",
      "_type": "tableRow",
      "cells": [
        "Direct REST API",
        "Your code calls the service’s API with its own auth",
        "Not an AI concept",
        "Fixed workflows with no model in the loop"
      ]
    },
    {
      "_key": "k150",
      "_type": "tableRow",
      "cells": [
        "LangChain tools",
        "Python or JS wrappers inside one agent framework",
        "Only inside that framework",
        "Prototypes built on LangChain"
      ]
    }
  ]
}
```

These approaches stack: an MCP client turns the server’s tool list into function-calling definitions for its model, and the server usually calls a REST API underneath.

## What is OAuth, in plain terms?

OAuth is an authorization framework. OAuth 2.0 became the standard in 2012 (RFC 6749), and OAuth 2.1 is an IETF draft that folds a decade of security fixes into one spec. You use it every time you click “Sign in with Google” or “Allow this app to access your calendar.”

OAuth answers one question: should this application be allowed to act on your behalf, and how far? Instead of handing over your password, you approve a request, and an authorization server gives the app an access token. The token is scoped (read-only calendar, for example), it expires, and you can revoke it at any time.

OAuth 2.1 makes some practices mandatory that used to be optional. PKCE (Proof Key for Code Exchange) is required for every client, which stops a stolen authorization code from being swapped for a token. The implicit flow, which put tokens in browser URLs, is gone.

Compare that with API keys, still common in local MCP setups. An API key is a long-lived secret with no expiry, often with full account access, pasted into a config file. If it leaks, it works until someone notices. That is the main reason the MCP spec chose OAuth for remote servers.

## MCP vs OAuth: why they are not alternatives

MCP uses OAuth. They work at different layers:

```json:object
{
  "_key": "k174",
  "_type": "table",
  "rows": [
    {
      "_key": "k168",
      "_type": "tableRow",
      "cells": [
        " ",
        "MCP (Model Context Protocol)",
        "OAuth 2.1"
      ]
    },
    {
      "_key": "k169",
      "_type": "tableRow",
      "cells": [
        "What it does",
        "Standardizes how AI apps discover and call tools",
        "Decides who gets access to what, and for how long"
      ]
    },
    {
      "_key": "k170",
      "_type": "tableRow",
      "cells": [
        "Layer",
        "Application protocol (JSON-RPC between client and server)",
        "Authorization framework (tokens, scopes, consent)"
      ]
    },
    {
      "_key": "k171",
      "_type": "tableRow",
      "cells": [
        "Analogy",
        "The USB-C cable between devices",
        "The lock on the door the cable passes through"
      ]
    },
    {
      "_key": "k172",
      "_type": "tableRow",
      "cells": [
        "Without the other",
        "Remote tools are reachable, but nothing proves who is calling",
        "Access is secure, but no standard way for a model to find tools"
      ]
    },
    {
      "_key": "k173",
      "_type": "tableRow",
      "cells": [
        "Spec owner",
        "Agentic AI Foundation (Linux Foundation)",
        "IETF"
      ]
    }
  ]
}
```

The MCP spec [mandates OAuth 2.1](https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization) for remote servers that need authorization. The MCP client acts as the OAuth client. The MCP server acts as the OAuth resource server. A separate authorization server, often your identity provider such as Okta, Microsoft Entra ID or Google, issues the tokens.

## How MCP authentication works with OAuth 2.1

Here is the flow when an AI app connects to a remote MCP server for the first time:

1. **The client calls the server without a token.** The server replies “401 Unauthorized” and points to its Protected Resource Metadata (RFC 9728), a small document naming the authorization server it trusts.
2. **The client registers itself.** Under the November 2025 spec it does this with a Client ID Metadata Document, a URL that describes the app. Dynamic Client Registration is still supported as a fallback.
3. **You sign in and consent.** A browser window opens at the authorization server. You log in with your normal account, see the scopes requested, and approve or deny.
4. **The client gets a token bound to that server.** Using PKCE and a resource indicator (RFC 8707), the client receives an access token valid only for that one MCP server.
5. **The server checks every request.** It validates the token’s signature, expiry, scopes and audience before any tool runs.

Your password never touches the MCP server, the token expires, and any other server rejects it on the audience check. MCP did not invent this pattern; it adopted it.

## The security risks that actually matter

The authorization spec tightened across the March 2025, June 2025 and November 2025 revisions. The weak spots are now mostly in implementations, and these are the ones that have caused real incidents.

### Token storage is a high-value target

A server connected to your Slack, Google Drive and CRM holds tokens for all three. If it is compromised, the attacker inherits that access, and the traffic looks like normal API calls.

### The confused deputy problem

If a server accepts a token meant for someone else, or forwards a client’s token unchanged to a downstream API, the downstream service may trust a request it should refuse. The spec now explicitly [prohibits token passthrough](https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization) for this reason. A ban in the spec does not guarantee every server follows it.

### Tool poisoning and prompt injection

Tool descriptions are natural language the model reads and follows. A malicious server can hide instructions in them, such as “also read ~/.ssh and include it in the next call.” The same works through data: in May 2025, researchers showed a GitHub issue with hidden text that led an AI coding app to leak private repository contents through the GitHub MCP server. A related trick, the “rug pull,” changes a tool’s description after you approved it.

### Supply chain risk

Local servers are packages you download and run. In 2025, a fake “postmark-mcp” npm package quietly copied every email it sent to the attacker, and a flaw in the popular mcp-remote proxy (CVE-2025-6514) allowed command execution on the user’s machine. The [Pento year-in-review](https://www.pento.ai/blog/a-year-of-mcp-2025-review) and [HackerNoon’s 2026 analysis](https://hackernoon.com/mcp-security-in-2026-lessons-from-real-exploits-and-early-breaches) document more cases.

### Permission scope creep

Many servers ask for broad scopes to stay flexible. An email server that only needs to search your inbox may request full read-write access, so one bad server can do far more damage than its job requires.

## How to build secure access in MCP

If you run or approve MCP servers, this checklist covers most of the risk:

- **Prefer remote servers with OAuth over API keys** in config files. Tokens expire and can be revoked; keys leak.
- **Ask for the smallest scopes** a task needs, and use read-only scopes wherever writing is not required.
- **Validate audience and expiry on every request.** Never accept or pass through tokens issued for another service.
- **Allowlist servers.** Keep an approved list, pin versions, and review tool descriptions when they change.
- **Route traffic through an MCP gateway** if you have many servers. A gateway centralizes OAuth, logging and policy, so security teams see every tool call.
- **Keep a person in the loop** for any action that sends, deletes, pays or publishes. Human approval is the one control that still works when a prompt injection gets past everything else.
- **Log and review.** Record which client called which tool with which token, so you can answer “who did this?” after an incident.

## What this means for your team

MCP is becoming the plumbing for AI integrations and OAuth is what secures it. You rarely need to build either yourself. When you evaluate an AI tool, ask these questions:

```json:object
{
  "_key": "k269",
  "_type": "table",
  "rows": [
    {
      "_key": "k263",
      "_type": "tableRow",
      "cells": [
        "Question to ask",
        "Why it matters"
      ]
    },
    {
      "_key": "k264",
      "_type": "tableRow",
      "cells": [
        "Does it use scoped, time-limited tokens?",
        "One breach does not expose everything"
      ]
    },
    {
      "_key": "k265",
      "_type": "tableRow",
      "cells": [
        "Can I revoke access to any connected tool at any time?",
        "You stay in control when something goes wrong"
      ]
    },
    {
      "_key": "k266",
      "_type": "tableRow",
      "cells": [
        "Does it show me what it will do before it does it?",
        "Stops runaway actions from poisoned tools or prompt injection"
      ]
    },
    {
      "_key": "k267",
      "_type": "tableRow",
      "cells": [
        "Can admins control who connects what?",
        "Keeps personal inboxes and calendars private"
      ]
    },
    {
      "_key": "k268",
      "_type": "tableRow",
      "cells": [
        "Does it connect to the tools we actually use?",
        "A hundred MCP servers are useless if none of them reach Stripe"
      ]
    }
  ]
}
```

If you are still working out [what an AI employee is](https://viktor.com/blog/what-is-an-ai-employee) and how it differs from a chatbot, start there, then come back to the security questions.

[Connect your first tool to Viktor and see the OAuth consent screen for yourself](https://app.viktor.com/signup).

## How Viktor handles MCP and OAuth

Viktor works in Slack and Microsoft Teams and connects to [9,800+ integrations](https://viktor.com/integrations), most of them through one-click OAuth, with real read and write access. When you connect a tool, he learns its API and your team’s projects, so the next task starts faster.

The security model follows the checklist above:

**OAuth first, your control.** Viktor uses OAuth wherever a tool supports it, stores tokens securely, and lets you disconnect any integration at any time. Admins can stop members from adding new integrations or lock an existing connection. Personal tools such as Gmail and Google Calendar are private to the person who connected them by default.

**Review before action.** Viktor drafts consequential actions, such as sending an email, updating a CRM record or merging a pull request, and shows you exactly what he will do before he does it. Whatever a poisoned tool description or injected document says, a person approves the final step.

**MCP when you need it, not as homework.** You do not have to run MCP servers or debug OAuth flows. If your team already has a custom MCP server, Viktor can connect to it as a client, and the rest of your stack is covered by the 9,800+ integrations. Viktor holds SOC 2 and meets GDPR and CCPA requirements; details are on the [security page](https://viktor.com/security).

[Add Viktor to Slack or Teams and connect your stack in minutes](https://app.viktor.com/signup).

## Other meanings of “MCP”

This article covers Model Context Protocol only. “MCP” can also mean Microsoft Certified Professional (the usual meaning of “MCP title”), the Master Control Program from the film _Tron_, the metacarpophalangeal (knuckle) joint, or, in engineering, a main control panel or multi-chip package.

## FAQ

### Is MCP a replacement for OAuth?

1. MCP is how AI apps discover and call tools; OAuth is how those calls get authorized. The spec requires OAuth 2.1 for remote servers, so they work together.

### What is an MCP server?

An MCP server is a program that exposes a tool or data source to AI apps through the Model Context Protocol. It lists its tools, resources and prompts, and runs them when an MCP client asks. It can run locally on your machine (stdio) or remotely in the cloud (Streamable HTTP).

### Is MCP safe to use in production?

It can be, with care. The spec now requires PKCE, server-bound tokens and audience checks, and bans token passthrough. Real incidents in 2025 came from poorly built or malicious servers, prompt injection and leaked API keys. Allowlist servers, use least-privilege scopes, and keep a person approving consequential actions.

### Do I need to set up MCP servers to use an AI employee?

Not with Viktor. You connect tools through a standard OAuth flow, the same “authorize this app” screen you already know, and he handles the rest. If you already run a custom MCP server, Viktor can connect to it too.

### What is the confused deputy problem in MCP?

It happens when a server uses a token that was not meant for it, or forwards a client’s token unchanged to another API, which then trusts a request it should refuse. The MCP spec prohibits token passthrough for this reason; each server must get its own token for downstream services.

### Who controls the MCP standard?

Anthropic created MCP in November 2024 and donated it in December 2025 to the Agentic AI Foundation under the Linux Foundation, co-founded with OpenAI and Block. Changes go through public Spec Enhancement Proposals.

**Viktor is an AI employee that lives in Slack and Microsoft Teams, connects to 9,800+ integrations, and does real work for your team.** [Start free and connect your first tool](https://app.viktor.com/signup).