@frontmcp/protocol 1.9.6 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +18 -54
  2. package/package.json +7 -6
package/README.md CHANGED
@@ -1,71 +1,35 @@
1
1
  # @frontmcp/protocol
2
2
 
3
- The single boundary between FrontMCP and the upstream
4
- [`@modelcontextprotocol/sdk`](https://www.npmjs.com/package/@modelcontextprotocol/sdk).
3
+ FrontMCP's single point of contact with the upstream [`@modelcontextprotocol/sdk`](https://www.npmjs.com/package/@modelcontextprotocol/sdk): it re-exports the MCP protocol types, server, client and transports that the other `@frontmcp/*` packages use. This is an internal package, published only so those packages can depend on it. Don't import it from application code: import MCP types from [`@frontmcp/sdk`](https://www.npmjs.com/package/@frontmcp/sdk), and use `McpClient` from [`@frontmcp/testing`](https://www.npmjs.com/package/@frontmcp/testing) when a test needs a raw client.
5
4
 
6
- [![NPM](https://img.shields.io/npm/v/@frontmcp/protocol.svg)](https://www.npmjs.com/package/@frontmcp/protocol)
5
+ [![npm](https://img.shields.io/npm/v/@frontmcp/protocol.svg)](https://www.npmjs.com/package/@frontmcp/protocol) [![License](https://img.shields.io/npm/l/@frontmcp/protocol.svg)](https://github.com/agentfront/frontmcp/blob/main/LICENSE)
7
6
 
8
- > **Internal package.** It is published so the other `@frontmcp/*` packages can
9
- > resolve it — you should not import it from application code. Import MCP types
10
- > from [`@frontmcp/sdk`](https://www.npmjs.com/package/@frontmcp/sdk) instead,
11
- > and use `McpClient` from `@frontmcp/testing` for a raw client in tests.
7
+ ## Install
12
8
 
13
- ## Why it exists
14
-
15
- `libs/protocol/src/types.ts` is the **only** file in the whole monorepo that
16
- transitively imports `@modelcontextprotocol/sdk`. Everything else — SDK,
17
- adapters, plugins, auth, tests — imports from `@frontmcp/protocol`.
18
-
19
- That indirection means swapping, pinning, or dropping the upstream package is a
20
- one-file change instead of a repo-wide refactor. The
21
- [`@nx/dependency-checks`](https://nx.dev) lint rule enforces it: adding a direct
22
- upstream import anywhere else fails the build.
23
-
24
- ✅ Route through the boundary:
25
-
26
- <!-- prettier-ignore -->
27
- ```ts
28
- import { CallToolRequestSchema, McpError, type Tool } from '@frontmcp/protocol';
29
- ```
30
-
31
- ❌ Never import the upstream package directly — that locks every call site to it:
32
-
33
- <!-- prettier-ignore -->
34
- ```ts
35
- import { McpError } from '@modelcontextprotocol/sdk/types.js';
36
- ```
37
-
38
- If a type you need is not reachable from `@frontmcp/protocol`, re-export it from
39
- `libs/protocol/src/types.ts` rather than reaching around the boundary.
9
+ You don't install it yourself: `@frontmcp/sdk` depends on it. It needs Node.js 24 or later.
40
10
 
41
11
  ## What it exports
42
12
 
43
- | Area | Contents |
44
- | ------------------- | ---------------------------------------------------------------------------------------- |
45
- | Protocol types | Requests, results, notifications, schemas, `McpError`, capabilities |
46
- | Protocol 2026-07-28 | Types the upstream SDK does not ship yet — see below |
47
- | Server | `McpServer`, `StreamableHTTPServerTransport`, `WebStandardStreamableHTTPServerTransport` |
48
- | Client | `Client`, `StreamableHTTPClientTransport`, `SSEClientTransport` |
49
- | Transports | stdio (Node + browser), in-memory |
50
- | Auth types | `AuthInfo` and friends |
13
+ | Area | Contents |
14
+ | ------------------- | ---------------------------------------------------------------------------------------------------------------- |
15
+ | Protocol types | Everything in `@modelcontextprotocol/sdk/types.js`: requests, results, notifications, schemas, `McpError` |
16
+ | Protocol 2026-07-28 | `MCP_20260728_META`, `MCP_20260728_ERROR_CODES`, `CacheableResult`, `DiscoverResult`, `InputRequiredResult`, … |
17
+ | Server | `McpServer`, `StreamableHTTPServerTransport`, `WebStandardStreamableHTTPServerTransport`, `StdioServerTransport` |
18
+ | Client | `Client`, `StreamableHTTPClientTransport`, `SSEClientTransport`, `StdioClientTransport` |
19
+ | Other | `InMemoryTransport`, `Transport`, `RequestHandlerExtra`, `AuthInfo` |
51
20
 
52
- Node and browser/worker variants are selected automatically through package
53
- [subpath imports](https://nodejs.org/api/packages.html#subpath-imports), so the
54
- same import works in every runtime FrontMCP targets.
21
+ The browser build swaps in browser versions of the server and Streamable HTTP modules through the package's `imports` map. The stdio transports need Node.js: in a browser or worker build they throw when constructed.
55
22
 
56
23
  ## Protocol 2026-07-28
57
24
 
58
- The upstream SDK tops out at `2025-11-25`. Revision `2026-07-28` is therefore
59
- defined here — `MCP_20260728_META`, `MCP_20260728_ERROR_CODES`, `CacheableResult`,
60
- `DiscoverResult`, `InputRequiredResult`, `SubscriptionFilter`, and the rest.
25
+ `@modelcontextprotocol/sdk` 1.29 supports protocol revisions up to `2025-11-25`, so the types of revision `2026-07-28` are defined here. They only add to the earlier types, because a FrontMCP server serves both revisions on the same endpoint. See [Protocol versions](https://frontmcp.dev/reference/server/protocol-versions) for what the revision changed and how FrontMCP picks one per request.
26
+
27
+ ## Contributing
61
28
 
62
- Everything is **additive**: the 2025-and-earlier types are untouched, because a
63
- FrontMCP server serves both eras on the same endpoint. When upstream catches up,
64
- `types-20260728.ts` is the only file that has to change.
29
+ Source: [`libs/protocol`](https://github.com/agentfront/frontmcp/tree/main/libs/protocol). Issues and pull requests are welcome; see [CONTRIBUTING.md](https://github.com/agentfront/frontmcp/blob/main/CONTRIBUTING.md).
65
30
 
66
- See the [protocol versions guide](https://frontmcp.dev/reference/server/protocol-versions)
67
- for what the revision changed and how FrontMCP selects one per request.
31
+ Inside the monorepo, this is the only package that imports `@modelcontextprotocol/sdk`. Import MCP types from `@frontmcp/protocol` instead of the upstream package, and when a type you need is missing, re-export it from [`src/types.ts`](https://github.com/agentfront/frontmcp/blob/main/libs/protocol/src/types.ts) (or [`src/types-20260728.ts`](https://github.com/agentfront/frontmcp/blob/main/libs/protocol/src/types-20260728.ts) for the newer revision). That way, upgrading or replacing the upstream package touches only this package.
68
32
 
69
33
  ## License
70
34
 
71
- Apache-2.0
35
+ Apache-2.0. See [LICENSE](https://github.com/agentfront/frontmcp/blob/main/LICENSE).
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@frontmcp/protocol",
3
- "version": "1.9.6",
4
- "description": "Centralized MCP protocol types, server, and client re-exports for FrontMCP",
3
+ "version": "1.10.0",
4
+ "description": "Internal FrontMCP package: the single re-export point for @modelcontextprotocol/sdk types, server, client and transports",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "license": "Apache-2.0",
7
7
  "keywords": [
8
+ "frontmcp",
8
9
  "mcp",
10
+ "model-context-protocol",
9
11
  "protocol",
10
12
  "modelcontextprotocol",
11
- "agentfront",
12
- "frontmcp",
13
- "typescript"
13
+ "typescript",
14
+ "agentfront"
14
15
  ],
15
16
  "repository": {
16
17
  "type": "git",
@@ -20,7 +21,7 @@
20
21
  "bugs": {
21
22
  "url": "https://github.com/agentfront/frontmcp/issues"
22
23
  },
23
- "homepage": "https://github.com/agentfront/frontmcp/blob/main/libs/protocol/README.md",
24
+ "homepage": "https://frontmcp.dev",
24
25
  "engines": {
25
26
  "node": ">=24.0.0"
26
27
  },