@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.
- package/README.md +18 -54
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -1,71 +1,35 @@
|
|
|
1
1
|
# @frontmcp/protocol
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
[](https://www.npmjs.com/package/@frontmcp/protocol) [](https://github.com/agentfront/frontmcp/blob/main/LICENSE)
|
|
7
6
|
|
|
8
|
-
|
|
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
|
-
|
|
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 |
|
|
46
|
-
| Protocol 2026-07-28 |
|
|
47
|
-
| Server | `McpServer`, `StreamableHTTPServerTransport`, `WebStandardStreamableHTTPServerTransport` |
|
|
48
|
-
| Client | `Client`, `StreamableHTTPClientTransport`, `SSEClientTransport` |
|
|
49
|
-
|
|
|
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
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
4
|
-
"description": "
|
|
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
|
-
"
|
|
12
|
-
"
|
|
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://
|
|
24
|
+
"homepage": "https://frontmcp.dev",
|
|
24
25
|
"engines": {
|
|
25
26
|
"node": ">=24.0.0"
|
|
26
27
|
},
|