@absolutejs/mcp 0.8.0 → 0.9.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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # @absolutejs/mcp
2
2
 
3
+ MCP tool discovery preserves the OpenID AuthZEN COAZ `coaz` marker and
4
+ `x-coaz-mapping` JSON Schema extension end to end. Use `@absolutejs/policy` to
5
+ validate and evaluate the mapping before dispatching an authorized tool call.
6
+
3
7
  Serve a remote [Model Context Protocol](https://modelcontextprotocol.io) endpoint
4
8
  — streamable HTTP, stateless — from a tool/prompt/resource registry. You supply
5
9
  **which** tools to expose and **how** to authorize a request into a caller; the
package/dist/index.js CHANGED
@@ -265,6 +265,7 @@ var createMcpClient = (options) => {
265
265
  const tools = isRecord(result) && Array.isArray(result.tools) ? result.tools : [];
266
266
  collected.push(...tools.filter(isRecord).map((tool) => ({
267
267
  annotations: isRecord(tool.annotations) ? tool.annotations : undefined,
268
+ coaz: typeof tool.coaz === "boolean" ? tool.coaz : undefined,
268
269
  description: typeof tool.description === "string" ? tool.description : undefined,
269
270
  inputSchema: isRecord(tool.inputSchema) ? tool.inputSchema : undefined,
270
271
  name: typeof tool.name === "string" ? tool.name : "",
@@ -763,6 +764,7 @@ var toolsList = async (config, caller, scopes, id, params) => {
763
764
  const tools = await config.tools({ caller, meta: {} });
764
765
  const visible = Object.entries(tools).filter(([, tool]) => scopeAllows(tool, scopes) && agencyAllows(config, tool, scopes)).map(([name, tool]) => ({
765
766
  annotations: tool.annotations,
767
+ ...tool.coaz === undefined ? {} : { coaz: tool.coaz },
766
768
  description: tool.description,
767
769
  inputSchema: tool.inputSchema,
768
770
  name,
package/dist/manifest.js CHANGED
@@ -5916,6 +5916,14 @@ var serializedTool = Type.Object({
5916
5916
  });
5917
5917
  var manifestSchema = Type.Object({
5918
5918
  contract: Type.Union([Type.Literal(1), Type.Literal(2)]),
5919
+ discovery: Type.Optional(Type.Object({
5920
+ audiences: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),
5921
+ certificationUrl: Type.Optional(Type.String()),
5922
+ intents: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),
5923
+ keywords: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),
5924
+ protocols: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),
5925
+ url: Type.Optional(Type.String())
5926
+ })),
5919
5927
  identity: Type.Object({
5920
5928
  accent: Type.Optional(Type.String({ pattern: "^#[0-9a-fA-F]{3,8}$" })),
5921
5929
  category: Type.String({ minLength: 1 }),
@@ -34,6 +34,7 @@ export type McpClientOptions = {
34
34
  };
35
35
  export type McpRemoteTool = {
36
36
  annotations?: McpToolAnnotations;
37
+ coaz?: boolean;
37
38
  description?: string;
38
39
  inputSchema?: Record<string, unknown>;
39
40
  name: string;
@@ -110,6 +110,9 @@ export type McpToolCallContext = {
110
110
  /** One callable tool. `inputSchema` is a JSON Schema object. */
111
111
  export type McpTool = {
112
112
  annotations?: McpToolAnnotations;
113
+ /** OpenID AuthZEN COAZ opt-in marker. When true, inputSchema MUST carry an
114
+ * `x-coaz-mapping`; hosts should evaluate it before invoking the handler. */
115
+ coaz?: boolean;
113
116
  /** Enforceable semantic effects from manifest contract 2. A tool carrying
114
117
  * this is hidden unless the server configures `agency`. */
115
118
  authorization?: ToolAuthorization;
package/package.json CHANGED
@@ -11,8 +11,8 @@
11
11
  "elysia": ">=1.1.0"
12
12
  },
13
13
  "dependencies": {
14
- "@absolutejs/agency": "^0.3.0",
15
- "@absolutejs/manifest": "^0.2.0",
14
+ "@absolutejs/agency": "^0.4.0",
15
+ "@absolutejs/manifest": "^0.3.0",
16
16
  "@sinclair/typebox": "^0.34.0"
17
17
  },
18
18
  "license": "BUSL-1.1",
@@ -58,5 +58,5 @@
58
58
  "typecheck": "tsc --noEmit --project tsconfig.json"
59
59
  },
60
60
  "types": "./dist/src/index.d.ts",
61
- "version": "0.8.0"
61
+ "version": "0.9.0"
62
62
  }