@12-apps/mcp 3.11.0 → 3.13.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/dist/chunk-VDD4YRNP.js +197 -0
- package/dist/chunk-VDD4YRNP.js.map +1 -0
- package/dist/{create-api-mcp-oauth-CwVXKK-A.d.ts → create-api-mcp-oauth-CsC0jlH7.d.ts} +1 -1
- package/dist/generate/index.d.ts +1 -1
- package/dist/{generate-Dx3cK8th.d.ts → generate-BCDqBUjZ.d.ts} +1 -1
- package/dist/hono/index.d.ts +1 -1
- package/dist/index.d.ts +95 -3
- package/dist/index.js +41 -8
- package/dist/index.js.map +1 -1
- package/dist/manifest/index.d.ts +93 -0
- package/dist/manifest/index.js +22 -0
- package/dist/manifest/index.js.map +1 -0
- package/dist/manifest/server.d.ts +74 -0
- package/dist/manifest/server.js +41 -0
- package/dist/manifest/server.js.map +1 -0
- package/dist/oauth/index.d.ts +2 -2
- package/dist/oauth/index.js +6 -189
- package/dist/oauth/index.js.map +1 -1
- package/package.json +33 -14
- package/src/index.ts +10 -1
- package/src/manifest/index.ts +89 -0
- package/src/manifest/server.ts +94 -0
- package/src/openapi/annotations.ts +106 -0
- package/src/openapi/endpoint.ts +36 -0
package/src/openapi/endpoint.ts
CHANGED
|
@@ -28,6 +28,37 @@ import type { z } from "zod";
|
|
|
28
28
|
/** The methods an MCP-exposed route may use. */
|
|
29
29
|
export type HttpMethod = "get" | "post" | "put" | "patch" | "delete";
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* What a PACKAGE can say about how its own tool behaves.
|
|
33
|
+
*
|
|
34
|
+
* The host still owns the final `ToolAnnotations` — every field required, and
|
|
35
|
+
* `mcp:lint` unchanged in demanding that each tool ends classified. What
|
|
36
|
+
* changes is who supplies the DEFAULT. A package declaring
|
|
37
|
+
* `getSupplierVersions` knows perfectly well that it reads and does not
|
|
38
|
+
* destroy; a host cannot know that without reading the package's source, so
|
|
39
|
+
* today it restates the classification by hand — 48 lines of policy hints for
|
|
40
|
+
* one package's eight-endpoint factory, growing with every collection plugged
|
|
41
|
+
* in, and wrong the moment the package changes a verb.
|
|
42
|
+
*
|
|
43
|
+
* Every field is OPTIONAL here, which is the whole difference from
|
|
44
|
+
* `ToolAnnotations`: this is a suggestion the host merges under its own table,
|
|
45
|
+
* so a package that knows two of the four says two and stays silent on the
|
|
46
|
+
* rest. Deliberately spelled without the `Hint` suffix and as a structural
|
|
47
|
+
* twin of `@12-apps/wiring`'s `WireMcpAnnotations`, so an `McpEndpoint` still
|
|
48
|
+
* satisfies `WireMcpTool` — restated rather than imported because this package
|
|
49
|
+
* takes no dependency on the wiring contract.
|
|
50
|
+
*/
|
|
51
|
+
export interface McpAnnotationDefaults {
|
|
52
|
+
/** Human title override; hosts may re-derive from the operation id. */
|
|
53
|
+
title?: string;
|
|
54
|
+
/** The tool only reads — never mutates host state. */
|
|
55
|
+
readOnly?: boolean;
|
|
56
|
+
/** A destructive write (delete/purge), as opposed to an additive one. */
|
|
57
|
+
destructive?: boolean;
|
|
58
|
+
/** The tool reaches beyond the host's own data (external services). */
|
|
59
|
+
openWorld?: boolean;
|
|
60
|
+
}
|
|
61
|
+
|
|
31
62
|
interface McpEndpointBase {
|
|
32
63
|
/** Stable tool id — this becomes the MCP tool name, so renaming it is a
|
|
33
64
|
* breaking change for every agent that has learned the old one. */
|
|
@@ -44,6 +75,11 @@ interface McpEndpointBase {
|
|
|
44
75
|
params?: z.ZodType;
|
|
45
76
|
/** Request body schema (writes only). */
|
|
46
77
|
body?: z.ZodType;
|
|
78
|
+
/**
|
|
79
|
+
* Behavior the package can assert about its own tool. Optional, and merged
|
|
80
|
+
* UNDER the host's table — see {@link McpAnnotationDefaults}.
|
|
81
|
+
*/
|
|
82
|
+
annotations?: McpAnnotationDefaults;
|
|
47
83
|
}
|
|
48
84
|
|
|
49
85
|
/**
|