# FrontMCP vs Mastra's MCP server

> How FrontMCP and the MCPServer in Mastra's @mastra/mcp differ in protocol support, sessions, auth, testing and deployment, and when to choose each.

Source: https://frontmcp.dev/compare/mastra-mcp

[Checked against FrontMCP 1.15.2](https://frontmcp.dev/versions#how-pages-are-checked) on December 4, 2026

Mastra is a TypeScript framework for building agents and the applications around them: agents with memory, a workflow engine, routing to many model providers, evals, tracing, a Studio UI and a server. Its `@mastra/mcp` package holds an MCP client and an MCP server, `MCPServer`, which exposes Mastra tools, agents and workflows to MCP clients. This page compares that server with FrontMCP: the same tool in both, the criteria of the [comparison overview](https://frontmcp.dev/compare), and when each is the better choice. It doesn't compare Mastra's agent framework as a whole, which does much more than its MCP server.

This site documents FrontMCP, so read it knowing who wrote it. Every Mastra fact below comes from Mastra's documentation at mastra.ai and from the `@mastra/mcp` changelog, `package.json` and license at the **2.11.0** release tag, checked on **2026-12-01**, and links to them. Every FrontMCP fact links to the page on this site that shows FrontMCP 1.15.2 doing it, or to [how this was checked](https://frontmcp.dev/compare/mastra-mcp#how-this-was-checked).

<a id="quick-answer"></a>

## Quick answer

Choose Mastra's MCP server when you already build agents, workflows and tools in Mastra and want MCP clients to call them: one constructor turns each of them into an MCP tool, and the Mastra server's auth, Studio and tracing cover the MCP endpoint too. Choose FrontMCP over it when your clients speak MCP 2025-11-25 or earlier over stdio, or need sessions, sampling or roots, when you want FrontMCP to be the OAuth server, or when the MCP server is the product rather than a way into an agent application.



---

<a id="what-mastras-mcp-server-is"></a>

## What Mastra's MCP server is

[Mastra](https://github.com/mastra-ai/mastra) describes itself as a framework for building applications and agents in TypeScript ([README](https://github.com/mastra-ai/mastra/blob/@mastra/mcp@2.11.0/README.md?plain=1#L11)). Its README lists model routing to more than 40 providers, agents, a graph-based workflow engine, suspend and resume for human input, memory, evals and observability, and MCP servers as one item among them ([Why Mastra?](https://github.com/mastra-ai/mastra/blob/@mastra/mcp@2.11.0/README.md#why-mastra)). It's one monorepo, copyright Kepler Software, Inc. Content in directories named `ee/` has its own enterprise license; everything else, `packages/mcp` included, is Apache-2.0 ([LICENSE.md](https://github.com/mastra-ai/mastra/blob/@mastra/mcp@2.11.0/LICENSE.md?plain=1#L1-L20)).

The MCP package is [`@mastra/mcp`](https://www.npmjs.com/package/@mastra/mcp), first published on 2025-01-14. Version 2.0.0 came out on 2026-09-22, and 2.11.0, the version checked here, on 2026-11-25 ([npm](https://www.npmjs.com/package/@mastra/mcp?activeTab=versions)). It's built on v2 of the official SDK: its `package.json` pins `@modelcontextprotocol/server`, `client` and `core` 2.4.0 and depends on `@modelcontextprotocol/ext-apps` for MCP Apps ([`package.json`](https://github.com/mastra-ai/mastra/blob/@mastra/mcp@2.11.0/packages/mcp/package.json?plain=1#L46-L61)). It needs `@mastra/core` 1.83 or later and `zod` 4.2 or later as peer dependencies, and Node 22.13.0 or later ([`engines`](https://github.com/mastra-ai/mastra/blob/@mastra/mcp@2.11.0/packages/mcp/package.json?plain=1#L105-L107)).

Version 2.0.0 "rebuilt `@mastra/mcp` on the MCP 2026-07-28 revision. Servers serve that revision only, and every request is self-contained: there is no `initialize` handshake, session header, `ping`, or standalone HTTP+SSE transport" ([CHANGELOG](https://github.com/mastra-ai/mastra/blob/@mastra/mcp@2.11.0/packages/mcp/CHANGELOG.md?plain=1#L1613)). It removed sessions, the SSE transport, `roots` and `sampling` ([CHANGELOG](https://github.com/mastra-ai/mastra/blob/@mastra/mcp@2.11.0/packages/mcp/CHANGELOG.md?plain=1#L1686)). Version 2.6.0 added `legacy: 'stateless'`, which answers 2025-era clients over HTTP without a session; the default, `'reject'`, still turns them away ([CHANGELOG](https://github.com/mastra-ai/mastra/blob/@mastra/mcp@2.11.0/packages/mcp/CHANGELOG.md?plain=1#L786-L797)).

A Mastra application can serve MCP in two ways. An `MCPServer` you define serves the tools, agents and workflows you list, with your own resources and prompts, over stdio or HTTP; registered on the `Mastra` instance, it's served at `/api/mcp/:serverId/mcp` ([Expose a Mastra MCP server](https://mastra.ai/docs/connections/mcp#expose-a-mastra-mcp-server)). The Mastra server also has a built-in endpoint at `/api/mcp` that exposes every agent, workflow and tool of the application, through the same auth and permission checks as its HTTP API ([Built-in MCP server](https://mastra.ai/docs/server/mcp)). This page compares `MCPServer`.

On 2026-12-01, the `mastra-ai/mastra` repository, the whole of Mastra, had 29,929 GitHub stars ([GitHub API](https://api.github.com/repos/mastra-ai/mastra)), and npm counted 1,170,458 downloads of `@mastra/mcp` in the week of 2026-11-23 to 2026-11-29 ([npm API](https://api.npmjs.org/downloads/point/2026-11-23:2026-11-29/@mastra/mcp)). That count includes every application that uses the package as an MCP client, and doesn't separate client use from server use. FrontMCP had 154 stars and 12,061 downloads of `@frontmcp/sdk` in the same week.

<a id="the-same-tool-in-both"></a>

## The same tool in both

One tool, `add`, that takes two numbers and returns their sum, called with `{ "a": 2, "b": 3 }`.

<a id="in-mastra"></a>

### In Mastra

This follows the [`MCPServer` reference](https://mastra.ai/reference/tools/mcp-server#constructor): a tool made with `createTool()` from `@mastra/core`, listed in the server's `tools`, served with [`startStdio()`](https://mastra.ai/reference/tools/mcp-server#startstdio) or, inside a Node HTTP server, with [`startHTTP()`](https://mastra.ai/reference/tools/mcp-server#starthttp). We ran it with `@mastra/mcp` 2.11.0, `@mastra/core` 1.86.0, `zod` 4.6.7 and `tsx` 4.23.15, in a project with `"type": "module"`:

```ts server.ts
import http from "node:http";
import { createTool } from "@mastra/core/tools";
import { MCPServer } from "@mastra/mcp";
import { z } from "zod";

const add = createTool({
  id: "add",
  description: "Add two numbers",
  inputSchema: z.object({ a: z.number(), b: z.number() }),
  execute: async ({ a, b }) => String(a + b),
});

const server = new MCPServer({
  id: "calc",
  name: "Calculator",
  version: "1.0.0",
  tools: { add },
});

if (process.env.PORT) {
  const port = Number(process.env.PORT);
  http
    .createServer(async (req, res) => {
      await server.startHTTP({
        url: new URL(req.url || "", `http://localhost:${port}`),
        httpPath: "/mcp",
        req,
        res,
      });
    })
    .listen(port);
} else {
  await server.startStdio();
}
```

`npx tsx server.ts` serves it over stdio, and `PORT=3207 npx tsx server.ts` at `http://localhost:3207/mcp`. Mastra's own client, `MCPClient` from the same package, started one over stdio, connected to the other over HTTP and called `add` on both:

```ts client.ts
import { MCPClient } from "@mastra/mcp";

const mcp = new MCPClient({
  servers: {
    overStdio: { command: "npx", args: ["tsx", "server.ts"] },
    overHttp: { url: new URL("http://127.0.0.1:3207/mcp") },
  },
});

const tools = await mcp.listTools();
console.log("stdio", JSON.stringify(await tools.overStdio_add.execute({ a: 2, b: 3 })));
console.log("http", JSON.stringify(await tools.overHttp_add.execute({ a: 2, b: 3 })));
await mcp.disconnect();
```

```text
stdio {"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"Calculator","version":"1.0.0"}},"content":[{"type":"text","text":"5"}],"isError":false}
http {"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"Calculator","version":"1.0.0"}},"content":[{"type":"text","text":"5"}],"isError":false}
```

Both connections used MCP 2026-07-28. A client that opens with `initialize`, as clients on 2025-11-25 and earlier do, got `-32022` `Unsupported protocol version` for every older revision, over stdio and over HTTP (with status `400`), as the docs say for the default `legacy: 'reject'` ([`MCPServer` options](https://mastra.ai/reference/tools/mcp-server#configuration-properties)). With `legacy: "stateless"` added to the constructor, the HTTP server answered `initialize` for 2024-11-05 to 2025-11-25 and returned `5`, without an `Mcp-Session-Id`. Over stdio the option changed nothing: the older revisions still got `-32022`. The docs describe `legacy` for HTTP requests only.

<a id="in-frontmcp"></a>

### In FrontMCP

The same tool, in a one-app FrontMCP server. The Playground runs it and calls `add`; the **Tests** tab runs the checks below it.

Initial call configuration:

```js
{ tool: "add", arguments: { a: 2, b: 3 } }
```

```ts main.ts active
import { App, FrontMcp, Tool, ToolContext, z } from "@frontmcp/sdk";

@Tool({
  name: "add",
  description: "Add two numbers",
  inputSchema: { a: z.number(), b: z.number() },
})
export class Add extends ToolContext {
  async execute({ a, b }: { a: number; b: number }) {
    return { sum: a + b };
  }
}

@App({ id: "calc", name: "Calculator", tools: [Add] })
export class CalcApp {}

@FrontMcp({ info: { name: "calc", version: "1.0.0" }, apps: [CalcApp] })
export default class Server {}
```

```ts add.test.ts
import { test, expect } from "@frontmcp/testing";

test("adds two numbers", async ({ mcp }) => {
  const result = await mcp.tools.call("add", { a: 2, b: 3 });
  expect(result).toBeSuccessful();
  expect(result.json()).toEqual({ sum: 5 });
});

test("rejects a string where a number belongs", async ({ mcp }) => {
  const result = await mcp.tools.call("add", { a: "2", b: 3 });
  expect(result).toBeError("INVALID_INPUT");
});
```

Mastra declares a tool with a function call and lists it in the server; FrontMCP declares a class and lists it in an app, which the server lists. A Mastra tool that returns a string sends it as text; FrontMCP's returns an object, which arrives as `structuredContent` with a text copy ([Your First Tool](https://frontmcp.dev/learn/your-first-tool#returning-results-and-errors)). FrontMCP needs Node 24 or later and TypeScript's decorator settings ([Installation](https://frontmcp.dev/learn/installation)), and [`frontmcp dev`](https://frontmcp.dev/reference/cli#frontmcp-dev) runs it. On 2026-12-01, `npm install @mastra/mcp@2.11.0` added 156 packages, including the peer dependencies npm installs with it, `@mastra/core` 1.86.0 and `zod` 4.6.7; `npm install @frontmcp/sdk@1.14.0` added 128. 

<a id="side-by-side"></a>

## Side by side

| | Mastra `MCPServer` (`@mastra/mcp` 2.11.0) | FrontMCP 1.15.2 |
| --- | --- | --- |
| MCP revisions served | 2026-07-28; `legacy: 'stateless'` adds 2024-11-05 to 2025-11-25 over HTTP, without sessions ([`MCPServer` options](https://mastra.ai/reference/tools/mcp-server#configuration-properties)). Over stdio, only 2026-07-28 in our run, with or without it | 2024-11-05 to 2026-07-28 over Streamable HTTP and stdio (except 2026-07-28 on [stdio servers with Claude Code channels](https://frontmcp.dev/reference/server/protocol-versions#a-stdio-server-with-channels-declines-2026-07-28)), with a session for the older four ([Protocol versions](https://frontmcp.dev/reference/server/protocol-versions#revisions-over-stdio)) |
| Declaring a tool | `createTool({ id, inputSchema, execute })` from `@mastra/core`, listed in `tools`; agents become `ask_<key>` tools and workflows `run_<key>` tools ([Constructor](https://mastra.ai/reference/tools/mcp-server#constructor), [Exposing agents as tools](https://mastra.ai/reference/tools/mcp-server#exposing-agents-as-tools)) | A [`@Tool`](https://frontmcp.dev/reference/sdk/tool) class, or the `tool()` function, listed in an `@App` |
| Schemas | Standard JSON Schema: Zod, Valibot, ArkType; advertised as JSON Schema 2020-12, and `outputSchema` checked before a result is sent ([`createTool()`](https://mastra.ai/reference/tools/create-tool#define-schemas), [Tool schemas](https://mastra.ai/reference/tools/mcp-server#tool-schemas-and-structured-results)) | Zod 4; `outputSchema` checks every result ([Schemas Are Contracts](https://frontmcp.dev/learn/schemas-are-contracts), [Shaping Tool Results](https://frontmcp.dev/learn/shaping-tool-results)) |
| Shared services | No container documented. Tools get a `requestContext` "for accessing shared state and dependencies", and `context.mcp` with the caller's auth ([`createTool()` parameters](https://mastra.ai/reference/tools/create-tool#parameters), [MCP context](https://mastra.ai/reference/tools/mcp-server#accessing-mcp-context-in-tools)) | [`@Provider`](https://frontmcp.dev/reference/sdk/provider) services, read with `this.get()`; [hooks](https://frontmcp.dev/reference/sdk/hooks) and [plugins](https://frontmcp.dev/reference/sdk/plugin) |
| Auth | `createOAuthMiddleware` in front of `startHTTP()`: protected-resource metadata, `401` challenges, and a static, introspection or custom token check ([OAuth protection](https://mastra.ai/reference/tools/mcp-server#oauth-protection)). On a Mastra server, its `server.auth` providers, RBAC and fine-grained authorization; "Mastra doesn't act as an authorization server" ([Built-in MCP server](https://mastra.ai/docs/server/mcp#oauth-discovery), [Authentication guide](https://mastra.ai/docs/guides/mcp-authentication-authorization#protect-a-mastra-mcp-server)) | Five modes: public, static keys, JWTs from your identity provider, and FrontMCP as the OAuth server, with its own sign-in page or an upstream provider's ([Auth modes](https://frontmcp.dev/reference/auth/modes)); per-entry rules ([Authorities](https://frontmcp.dev/reference/auth/authorities)) |
| Asking the client for input | A tool calls `context.suspend()` and declares a `resumeSchema`; the server answers `input_required` and runs the tool again with the answer, for 2026-07-28 clients ([Asking the caller for input](https://mastra.ai/reference/tools/mcp-server#asking-the-caller-for-input)); sampling and roots were removed in 2.0 ([Migration](https://mastra.ai/reference/migrations/mcp-v2#roots-and-sampling)) | [`this.elicit()`](https://frontmcp.dev/reference/sdk/elicit), which becomes `input_required` for 2026-07-28 clients; [`this.sample()` and `this.listRoots()`](https://frontmcp.dev/reference/sdk/contexts#thissample-and-thislistroots) for clients that offer them |
| Testing | Studio lists MCP servers and their tools and runs tools; `executeTool()` runs a tool without a protocol client; evals score agents and workflows; no MCP test library documented ([Studio](https://mastra.ai/docs/studio/overview#mcp-servers), [`executeTool()`](https://mastra.ai/reference/tools/mcp-server#executetool), [Evals](https://mastra.ai/docs/evals/overview)) | `@frontmcp/testing` with MCP matchers, run by `frontmcp test` ([Testing](https://frontmcp.dev/reference/testing)) |
| Resources, prompts, completions | Resources and templates, prompts, with change notifications; completion not documented ([Resource handling](https://mastra.ai/reference/tools/mcp-server#resource-handling), [Prompt handling](https://mastra.ai/reference/tools/mcp-server#prompt-handling)) | Resources and templates, prompts, completion of template parameters ([`@Resource`](https://frontmcp.dev/reference/sdk/resource), [`@Prompt`](https://frontmcp.dev/reference/sdk/prompt), [completers](https://frontmcp.dev/reference/sdk/resource-template#completing-parameters)) |
| Agents, jobs, workflows, tasks | Mastra agents and workflows served as tools; tools, agents and workflows as MCP tasks, experimental ([Exposing agents as tools](https://mastra.ai/reference/tools/mcp-server#exposing-agents-as-tools), [Tasks](https://mastra.ai/reference/tools/mcp-server#tasks-experimental)) | [`@Agent`](https://frontmcp.dev/reference/sdk/agent), [`@Job`](https://frontmcp.dev/reference/sdk/job), [`@Workflow`](https://frontmcp.dev/reference/sdk/workflow); [background tasks](https://frontmcp.dev/reference/server/tasks) |
| Widgets (MCP Apps) | `appResources`: `ui://` HTML apps through `@modelcontextprotocol/ext-apps`, rendered by MCP Apps hosts and in Mastra Studio; `appsRequireClientSupport` hides them from other clients ([MCP Apps](https://mastra.ai/reference/tools/mcp-server#mcp-apps-appresources), [Build MCP Apps](https://mastra.ai/docs/connections/mcp#build-mcp-apps)) | A tool's `ui` option, for MCP Apps hosts and the OpenAI Apps SDK ([Tool UI](https://frontmcp.dev/reference/ui), [Hosts](https://frontmcp.dev/reference/ui/hosts)) |
| Transports | stdio; Streamable HTTP, stateless, through `startHTTP()` with Node request and response objects ([`startHTTP()`](https://mastra.ai/reference/tools/mcp-server#starthttp)); the HTTP+SSE transport was removed in 2.0 ([Migration](https://mastra.ai/reference/migrations/mcp-v2#removed)) | Streamable HTTP with or without sessions, the older HTTP+SSE, stdio, a Unix socket, in-memory ([`FrontMcpInstance`](https://frontmcp.dev/reference/sdk/frontmcp-instance), [`transport`](https://frontmcp.dev/reference/sdk/frontmcp#transport)) |
| Runtimes and deployment | Node 22.13+; a registered server runs in the Mastra server, built with `mastra build`, with deployers for Vercel, Netlify and Cloudflare, or on Mastra platform's Server ([Deploy](https://mastra.ai/docs/deployment/overview)); `startHTTP()` on serverless platforms through a fetch-to-Node adapter ([`startHTTP()`](https://mastra.ai/reference/tools/mcp-server#starthttp)) | Node 24+; `frontmcp build` targets for Node, Vercel, AWS Lambda, Cloudflare Workers and a browser module ([Production build](https://frontmcp.dev/reference/deployment/production-build)); [`@frontmcp/edge`](https://frontmcp.dev/reference/deployment/edge) for Cloudflare Workers with Durable Object sessions; a fetch handler for other runtimes ([`createFetchHandler()`](https://frontmcp.dev/reference/sdk/create-fetch-handler)) |
| CLI | [`create-mastra`](https://mastra.ai/reference/cli/create-mastra); `mastra dev` with Studio, `build`, `start`, `server deploy`, and `mastra api mcp tool execute` ([`mastra` CLI](https://mastra.ai/reference/cli/mastra)); `npx @mastra/mcp generate` writes types for the client ([Generate types](https://mastra.ai/docs/connections/mcp#generate-types-for-direct-tool-calls)) | `frontmcp create`, `dev`, `build`, `test`, `inspector` ([CLI](https://frontmcp.dev/reference/cli)); an [Nx plugin](https://frontmcp.dev/reference/nx) |
| License | Apache-2.0; the repository's `ee/` directories, which don't include `packages/mcp`, have their own license ([LICENSE.md](https://github.com/mastra-ai/mastra/blob/@mastra/mcp@2.11.0/LICENSE.md?plain=1#L1-L16)) | [Apache-2.0](https://github.com/agentfront/frontmcp/blob/main/LICENSE) |

<a id="what-each-does-that-the-other-doesnt"></a>

## What each does that the other doesn't

What Mastra documents, or did in our run, and this site doesn't show for FrontMCP:

- **An agent framework around the server.** Agents with [memory](https://mastra.ai/docs/memory/overview), a [workflow engine](https://mastra.ai/docs/workflows/overview) with branching, parallel steps and suspend and resume, model routing across many providers, [evals](https://mastra.ai/docs/evals/overview) and [observability](https://mastra.ai/docs/observability/overview), and [Studio](https://mastra.ai/docs/studio/overview) to try them. An agent or workflow built there becomes an MCP tool when you add it to `agents` or `workflows`. FrontMCP's agents run a model loop with adapters for two model providers ([Connecting a Real Model](https://frontmcp.dev/learn/connecting-a-real-model)), and its workflows chain jobs.
- **A built-in MCP endpoint** at `/api/mcp` that serves every agent, workflow and tool of a Mastra application, filtered per caller by the same permissions as its HTTP API, for 2026-07-28 and 2025-era clients ([Built-in MCP server](https://mastra.ai/docs/server/mcp#connect-a-client)). We didn't run it.
- **An MCP client in the same package.** `MCPClient` gives Mastra agents the tools of other MCP servers over stdio or HTTP ([Connect to MCP servers](https://mastra.ai/docs/connections/mcp#connect-to-mcp-servers)). FrontMCP's [`connect()`](https://frontmcp.dev/reference/sdk/connect) adapters connect to your own server, in-process.
- **A choice of schema library** through Standard JSON Schema: Zod, Valibot or ArkType ([`createTool()`](https://mastra.ai/reference/tools/create-tool#define-schemas)). FrontMCP's pages use Zod 4 only.
- **Input rounds that resume on any instance.** The state of an `input_required` round travels signed in the request, so every instance that shares the key can answer it ([Continuation state](https://mastra.ai/reference/tools/mcp-server#continuation-state)).
- **Traces of MCP requests** in Mastra's observability, linked to the trace of the agent or workflow on the client that made the call ([Tracing](https://mastra.ai/reference/tools/mcp-server#tracing)).

What FrontMCP does that Mastra's MCP docs don't document, or list as removed:

- **Clients on 2025-11-25 and earlier, over stdio and with sessions.** Mastra's `MCPServer` served only 2026-07-28 over stdio in our run, and answers older HTTP clients without a session when `legacy: 'stateless'` is set. FrontMCP serves all five revisions over both transports, and keeps sessions for older clients, in [Redis](https://frontmcp.dev/reference/deployment/redis) if you like.
- **Requests from the server to the client**: [`this.sample()` and `this.listRoots()`](https://frontmcp.dev/reference/sdk/contexts#thissample-and-thislistroots), which Mastra removed in 2.0 ([Migration](https://mastra.ai/reference/migrations/mcp-v2#roots-and-sampling)).
- **An OAuth server.** Mastra's docs say it "doesn't act as an authorization server". FrontMCP can issue the tokens itself, with its own sign-in page and your check of the user, or after a sign-in at an upstream provider ([Local auth](https://frontmcp.dev/reference/auth/local#checking-users-yourself), [Remote and proxied auth](https://frontmcp.dev/reference/auth/remote)).
- **A dependency container**: [providers](https://frontmcp.dev/learn/sharing-state-with-providers) with scopes, which tools, resources and prompts get with `this.get()`.
- **A test library** with MCP matchers and fixtures ([Testing Your Server](https://frontmcp.dev/learn/testing-your-server)).
- **Completion** of resource template parameters ([completers](https://frontmcp.dev/reference/sdk/resource-template#completing-parameters)).
- **The older HTTP+SSE transport and a Unix socket** ([`FrontMcpInstance`](https://frontmcp.dev/reference/sdk/frontmcp-instance)).

Both expose agents as tools (Mastra's `ask_<key>`, FrontMCP's [`invoke_<name>`](https://frontmcp.dev/reference/sdk/agent)), serve MCP Apps widgets, run tools as MCP [tasks](https://frontmcp.dev/reference/server/tasks) (experimental in Mastra), and publish events through the draft SEP-3415 extension ([Mastra](https://mastra.ai/reference/tools/mcp-server#events-experimental), experimental; [FrontMCP](https://frontmcp.dev/reference/sdk/event)). Both can serve the tools of other MCP servers ([Mastra](https://mastra.ai/reference/tools/mcp-server#tool-results), [FrontMCP](https://frontmcp.dev/reference/server/remote)).

<a id="when-to-choose-mastras-mcp-server"></a>

## When to choose Mastra's MCP server

- You already build agents, workflows and tools in Mastra and want Cursor, VS Code or another MCP client to call them: list them in an `MCPServer`, or turn on the built-in `/api/mcp` endpoint, without rewriting them.
- You want an agent framework with memory, workflows, model routing, evals, Studio and tracing, and MCP as one way into it, behind the same auth, RBAC and fine-grained authorization as your HTTP API.
- Your clients speak MCP 2026-07-28, or answering older HTTP clients without a session is enough.
- You also want an MCP client for your agents, from the same package, or Valibot or ArkType rather than Zod.
- You want the more widely used of the two today: in the week of 2026-11-23 to 2026-11-29, npm counted 1,170,458 downloads of `@mastra/mcp` and 12,061 of `@frontmcp/sdk`, though the first figure includes its client use.

<a id="when-to-choose-frontmcp"></a>

## When to choose FrontMCP

- Your clients use MCP 2025-11-25 or earlier over stdio, or need a session: a server that asks them for sampling or roots, or several instances that share sessions.
- You want FrontMCP to be the OAuth server, rather than relying on an identity provider.
- The MCP server is the product, and you want shared services, several apps, hooks, plugins and a test library to organise it ([Structuring a Server](https://frontmcp.dev/learn/structuring-a-server)), without an agent framework around it.
- You want completions, the older HTTP+SSE transport, a Unix socket, or a build that runs the server in the browser ([Production build](https://frontmcp.dev/reference/deployment/production-build)).

<a id="how-this-was-checked"></a>

## How this was checked

On 2026-12-01 we installed `@mastra/mcp` 2.11.0 with `@mastra/core` 1.86.0, `zod` 4.6.7 and `tsx` 4.23.15, on Node 24.22.1 and npm 11.19.1, ran the server above over stdio and Streamable HTTP, and called `add` with `MCPClient` from `@mastra/mcp` 2.11.0. We then sent each server an `initialize` request for every MCP revision from 2024-11-05 to 2025-11-25, and the 2026-07-28 `server/discover` and `tools/call` requests, with the `MCP-Protocol-Version: 2026-07-28` header and the revision in `_meta`. Over both transports, `server/discover` listed only `2026-07-28` in `supportedVersions` and the 2026-07-28 call returned `5`; the four older revisions got `-32022`. With `legacy: "stateless"`, the four older revisions were answered over HTTP without an `Mcp-Session-Id` and returned `5`, and still got `-32022` over stdio. We didn't run a server registered on a `Mastra` instance, the built-in `/api/mcp` endpoint, Studio or a deployment.

FrontMCP serves all five revisions over Streamable HTTP and stdio, except [stdio servers with Claude Code channels](https://frontmcp.dev/reference/server/protocol-versions#a-stdio-server-with-channels-declines-2026-07-28), which decline 2026-07-28. Its stdio router returns discovery and `resultType` results for 2026-07-28, and keeps `initialize` sessions for older clients. The [overview](https://frontmcp.dev/compare#how-this-was-checked) describes the method for every library.
