@20baht/elysia-openapi-mcp 0.0.0-stage → 0.2.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/CHANGELOG.md +154 -0
- package/README.md +628 -2
- package/dist/auth/access.d.ts +13 -0
- package/dist/auth/access.d.ts.map +1 -0
- package/dist/auth/authenticate.d.ts +24 -0
- package/dist/auth/authenticate.d.ts.map +1 -0
- package/dist/auth/bearer.d.ts +3 -0
- package/dist/auth/bearer.d.ts.map +1 -0
- package/dist/auth/prm.d.ts +4 -0
- package/dist/auth/prm.d.ts.map +1 -0
- package/dist/auth/resolve.d.ts +110 -0
- package/dist/auth/resolve.d.ts.map +1 -0
- package/dist/auth/resource.d.ts +2 -0
- package/dist/auth/resource.d.ts.map +1 -0
- package/dist/auth/verify.d.ts +3 -0
- package/dist/auth/verify.d.ts.map +1 -0
- package/dist/execute.d.ts +43 -0
- package/dist/execute.d.ts.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1404 -0
- package/dist/index.js.map +24 -0
- package/dist/openapi/derive.d.ts +61 -0
- package/dist/openapi/derive.d.ts.map +1 -0
- package/dist/openapi/naming.d.ts +21 -0
- package/dist/openapi/naming.d.ts.map +1 -0
- package/dist/openapi/schema.d.ts +83 -0
- package/dist/openapi/schema.d.ts.map +1 -0
- package/dist/openapi/types.d.ts +79 -0
- package/dist/openapi/types.d.ts.map +1 -0
- package/dist/plugin.d.ts +143 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/transport.d.ts +32 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/warnings.d.ts +14 -0
- package/dist/warnings.d.ts.map +1 -0
- package/package.json +64 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticate.d.ts","sourceRoot":"","sources":["../../src/auth/authenticate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,QAAQ,E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.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYrF"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/** Validate and normalise the `auth` option block. */
|
|
2
|
+
import type { ToolSpec } from '../openapi/derive.js';
|
|
3
|
+
import { type FetchLike, type TokenVerifier } from './verify.js';
|
|
4
|
+
export interface McpifyAuthOptions {
|
|
5
|
+
/** Canonical URI of this MCP server; the audience every token must carry (RFC 8707). */
|
|
6
|
+
resource: string;
|
|
7
|
+
/** Issuer identifiers of the authorization servers allowed to mint tokens for it. */
|
|
8
|
+
authorizationServers: string[];
|
|
9
|
+
/** Replace the default JWKS verifier (e.g. `verifyWithOAuthProvider(...)`). */
|
|
10
|
+
verify?: TokenVerifier;
|
|
11
|
+
/** Where the RFC 9728 document is served. Default: `/.well-known/oauth-protected-resource<resource path>`. */
|
|
12
|
+
prmPath?: string;
|
|
13
|
+
/** Scopes every MCP request must hold (403 `insufficient_scope` otherwise). */
|
|
14
|
+
scopes?: string[];
|
|
15
|
+
/**
|
|
16
|
+
* Let requests without an `Authorization` header connect, list tools, and
|
|
17
|
+
* call tools marked `detail.mcp: { public: true }`; any other call gets the
|
|
18
|
+
* 401 challenge that starts sign-in. A token that is present is always
|
|
19
|
+
* verified. Default false.
|
|
20
|
+
*/
|
|
21
|
+
allowAnonymous?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Expose only tools that declare `detail.mcp.scopes` or `detail.mcp.public`;
|
|
24
|
+
* the rest are left out of the tool set with a warning. Default false: any
|
|
25
|
+
* token valid for `resource` (and holding `scopes`) can call every tool that
|
|
26
|
+
* declares no scopes of its own.
|
|
27
|
+
*/
|
|
28
|
+
requireToolScopes?: boolean;
|
|
29
|
+
/** Advertised in the PRM document and the 401 challenge. */
|
|
30
|
+
scopesSupported?: string[];
|
|
31
|
+
resourceName?: string;
|
|
32
|
+
resourceDocumentation?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Seconds of slack when checking `exp`. Default: `jwks.clockTolerance`
|
|
35
|
+
* (30) with the built-in verifier, 0 with a custom `verify`.
|
|
36
|
+
*/
|
|
37
|
+
clockTolerance?: number;
|
|
38
|
+
/** Default verifier tuning; ignored when `verify` is set. */
|
|
39
|
+
jwks?: {
|
|
40
|
+
uri?: string | Record<string, string>;
|
|
41
|
+
algorithms?: string[];
|
|
42
|
+
clockTolerance?: number;
|
|
43
|
+
/** Required JOSE `typ` header. Default `at+jwt` (RFC 9068); `false` skips the check. */
|
|
44
|
+
typ?: string | false;
|
|
45
|
+
fetch?: FetchLike;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* `verify` refusing with its own answer: a JSON-RPC error with this HTTP
|
|
50
|
+
* `status` (400-599), `code` (default -32001) and `message`, so a caller who
|
|
51
|
+
* is signed in but may not use the endpoint learns why.
|
|
52
|
+
*/
|
|
53
|
+
export interface RequestAuthRefusal {
|
|
54
|
+
status: number;
|
|
55
|
+
code?: number;
|
|
56
|
+
message: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* `verify` admitting with limits. Only the tools that pass every given
|
|
60
|
+
* filter are listed by `tools/list` and callable by `tools/call`; any other
|
|
61
|
+
* is answered like an unknown tool. At least one field must be present.
|
|
62
|
+
*/
|
|
63
|
+
export interface RequestAuthAdmission {
|
|
64
|
+
/**
|
|
65
|
+
* Scopes the caller holds. A tool that declares `detail.mcp.scopes` is kept
|
|
66
|
+
* only when every one of them is here, as in OAuth mode; a tool without
|
|
67
|
+
* scopes is kept.
|
|
68
|
+
*/
|
|
69
|
+
scopes?: string[];
|
|
70
|
+
/** Keep only the tools for which this returns `true`. */
|
|
71
|
+
tools?: (tool: ToolSpec) => boolean;
|
|
72
|
+
/** `true` keeps only the tools marked `readOnlyHint` (GET routes). */
|
|
73
|
+
readOnly?: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* `true` admits with every tool, an admission object admits with a filtered
|
|
77
|
+
* tool set, a refusal object answers with its own error; anything else
|
|
78
|
+
* (`false`, a throw, any other value) is a bare 401.
|
|
79
|
+
*/
|
|
80
|
+
export type RequestAuthResult = boolean | RequestAuthRefusal | RequestAuthAdmission;
|
|
81
|
+
/**
|
|
82
|
+
* Request mode, for apps that already guard their routes with an API key or a
|
|
83
|
+
* session cookie: `verify` sees every MCP request (including `tools/list`)
|
|
84
|
+
* and decides with a `RequestAuthResult`. No OAuth discovery is offered.
|
|
85
|
+
*/
|
|
86
|
+
export interface McpifyRequestAuthOptions {
|
|
87
|
+
verify: (request: Request) => RequestAuthResult | Promise<RequestAuthResult>;
|
|
88
|
+
resource?: never;
|
|
89
|
+
authorizationServers?: never;
|
|
90
|
+
}
|
|
91
|
+
/** OAuth when `resource` is set; request mode otherwise (and then OAuth-only keys are an error). */
|
|
92
|
+
export declare function isRequestAuth(auth: McpifyAuthOptions | McpifyRequestAuthOptions): auth is McpifyRequestAuthOptions;
|
|
93
|
+
export interface ResolvedAuth {
|
|
94
|
+
resource: string;
|
|
95
|
+
resourceUrl: URL;
|
|
96
|
+
authorizationServers: string[];
|
|
97
|
+
verify: TokenVerifier;
|
|
98
|
+
prmPath: string;
|
|
99
|
+
resourceMetadataUrl: string;
|
|
100
|
+
scopes: string[];
|
|
101
|
+
allowAnonymous: boolean;
|
|
102
|
+
requireToolScopes: boolean;
|
|
103
|
+
scopesSupported?: string[];
|
|
104
|
+
resourceName?: string;
|
|
105
|
+
resourceDocumentation?: string;
|
|
106
|
+
/** Seconds of slack applied to the `exp` check. */
|
|
107
|
+
clockTolerance: number;
|
|
108
|
+
}
|
|
109
|
+
export declare function resolveAuth(auth: McpifyAuthOptions): ResolvedAuth;
|
|
110
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/auth/resource.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,mBAAmB,GACpB,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { createJwksVerifier, metadataCandidates, verifyWithOAuthProvider, } from '@20baht/elysia-resource-server';
|
|
2
|
+
export type { FetchLike, JwksVerifierOptions, OAuthProviderLike, TokenClaims, TokenVerifier, } from '@20baht/elysia-resource-server';
|
|
3
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/auth/verify.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,aAAa,GACd,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool execution: unflatten arguments, build a synthetic `Request`, run it
|
|
3
|
+
* through `app.handle()` (full Elysia lifecycle), and turn the `Response`
|
|
4
|
+
* into an MCP `CallToolResult`.
|
|
5
|
+
*/
|
|
6
|
+
import { type CallToolResult } from '@modelcontextprotocol/server';
|
|
7
|
+
import type { ToolSpec } from './openapi/derive.js';
|
|
8
|
+
export interface Handler {
|
|
9
|
+
handle(request: Request): Promise<Response>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* True for the request a `tools/call` runs through the app, so hooks and
|
|
13
|
+
* handlers can tell an agent's call from a direct HTTP request (to audit it,
|
|
14
|
+
* or to refuse what only people may do). Elysia hands that same object to
|
|
15
|
+
* every lifecycle hook as `request`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isToolCall(request: Request): boolean;
|
|
18
|
+
/** What `onToolCall` hears after each tool call that reached the app. */
|
|
19
|
+
export interface ToolCallEvent {
|
|
20
|
+
tool: ToolSpec;
|
|
21
|
+
/** The arguments as the client sent them. */
|
|
22
|
+
args: Record<string, unknown>;
|
|
23
|
+
/** The synthetic request the route ran on (`isToolCall(request)` is true; its body is spent). */
|
|
24
|
+
request: Request;
|
|
25
|
+
/** A copy of the route's response, free to read. */
|
|
26
|
+
response: Response;
|
|
27
|
+
/** Time spent in `app.handle()`, in milliseconds. */
|
|
28
|
+
durationMs: number;
|
|
29
|
+
}
|
|
30
|
+
export type OnToolCall = (event: ToolCallEvent) => void | Promise<void>;
|
|
31
|
+
/** Decide which incoming MCP request headers reach the synthetic request. */
|
|
32
|
+
export type HeaderPolicy = (incoming: Headers) => HeadersInit;
|
|
33
|
+
export declare const defaultHeaderPolicy: HeaderPolicy;
|
|
34
|
+
export declare function buildToolRequest(tool: ToolSpec, args: Record<string, unknown>, original: Request, headerPolicy?: HeaderPolicy): Request;
|
|
35
|
+
export declare function toCallToolResult(tool: ToolSpec, res: Response): Promise<CallToolResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Run one tool call through the app. `onToolCall` is awaited after the
|
|
38
|
+
* result is built; it gets a clone of the response, so reading it does not
|
|
39
|
+
* disturb the result. Errors it throws reach the caller (the plugin catches
|
|
40
|
+
* and reports them).
|
|
41
|
+
*/
|
|
42
|
+
export declare function callTool(app: Handler, tool: ToolSpec, args: Record<string, unknown>, original: Request, headerPolicy?: HeaderPolicy, onToolCall?: OnToolCall): Promise<CallToolResult>;
|
|
43
|
+
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAA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AE,UAAU,GACtB,OAAO,CAAC,cAAc,CAAC,CASzB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { mcpify, DEFAULT_SPEC_PATH } from './plugin.js';
|
|
2
|
+
export type { McpifyAuthMode, McpifyBaseOptions, McpifyCorsOption, McpifyOptions, } from './plugin.js';
|
|
3
|
+
export type { McpifyAuthOptions, McpifyRequestAuthOptions, RequestAuthAdmission, RequestAuthRefusal, RequestAuthResult, ResolvedAuth, } from './auth/resolve.js';
|
|
4
|
+
export { MCPIFY_WARNING_KINDS } from './warnings.js';
|
|
5
|
+
export type { McpifyWarning, McpifyWarningKind } from './warnings.js';
|
|
6
|
+
export { resolveAuth } from './auth/resolve.js';
|
|
7
|
+
export { createJwksVerifier, verifyWithOAuthProvider, metadataCandidates } from './auth/verify.js';
|
|
8
|
+
export type { TokenClaims, TokenVerifier, JwksVerifierOptions, OAuthProviderLike, FetchLike, } from './auth/verify.js';
|
|
9
|
+
export { authenticate, audienceMatches } from './auth/authenticate.js';
|
|
10
|
+
export type { AuthOutcome } from './auth/authenticate.js';
|
|
11
|
+
export { bearerChallenge, extractBearer } from './auth/bearer.js';
|
|
12
|
+
export type { ChallengeOptions, BearerErrorCode } from './auth/bearer.js';
|
|
13
|
+
export { protectedResourceMetadata } from './auth/prm.js';
|
|
14
|
+
export { normalizeResource, resourcesEqual, validateResourceUri } from './auth/resource.js';
|
|
15
|
+
export { deriveTools, toMcpTool, toolNameFor, isExcluded, DEFAULT_EXCLUDED_PATHS, } from './openapi/derive.js';
|
|
16
|
+
export type { ToolSpec, DeriveOptions, DeriveResult } from './openapi/derive.js';
|
|
17
|
+
export { deriveToolName, elysiaDefaultOperationId, sanitizeToolName, templateParams, } from './openapi/naming.js';
|
|
18
|
+
export { dereference, flattenOperation, unflattenArgs, outputSchemaFor, simplifyNumeric, WRAPPED_RESULT_KEY, } from './openapi/schema.js';
|
|
19
|
+
export type { FlatSchema, PropertyOrigin, OutputSchema, UnflattenedArgs, } from './openapi/schema.js';
|
|
20
|
+
export type { McpRouteOptions, OpenAPIDocument, OpenAPIOperation, OpenAPIParameter, JsonSchema, } from './openapi/types.js';
|
|
21
|
+
export { buildToolRequest, toCallToolResult, callTool, defaultHeaderPolicy, isToolCall, } from './execute.js';
|
|
22
|
+
export type { HeaderPolicy, Handler, OnToolCall, ToolCallEvent } from './execute.js';
|
|
23
|
+
export { serveMcp } from './transport.js';
|
|
24
|
+
export type { ToolSet, ServeOptions } from './transport.js';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACxD,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACnG,YAAY,EACV,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACvE,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBA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