xmcp 0.5.8 → 0.6.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "xmcp",
3
3
  "description": "The MCP framework",
4
- "version": "0.5.8",
4
+ "version": "0.6.0",
5
5
  "author": {
6
6
  "name": "xmcp",
7
7
  "email": "support@xmcp.dev",
@@ -1,12 +0,0 @@
1
- import { RequestHandler } from "express";
2
- import { ProxyOAuthServerProvider } from "./providers/proxy-provider";
3
- import { OAuthProxyConfig } from "./types";
4
- export interface OAuthProxy {
5
- provider: ProxyOAuthServerProvider;
6
- router: RequestHandler;
7
- middleware: RequestHandler;
8
- }
9
- /**
10
- * Creates an OAuth proxy setup
11
- */
12
- export declare function createOAuthProxy(config: OAuthProxyConfig): OAuthProxy;
@@ -1,5 +0,0 @@
1
- export * from "./types";
2
- export * from "./storage/memory-storage";
3
- export { ProxyOAuthServerProvider } from "./providers/proxy-provider";
4
- export { createOAuthRouter, createOAuthMiddleware } from "./router";
5
- export { createOAuthProxy } from "./factory";
@@ -1,13 +0,0 @@
1
- import { ProxyOAuthServerProvider as IProxyOAuthServerProvider, ProxyOAuthProviderConfig, AccessToken, AuthorizeParams, TokenParams, RevokeParams, TokenResponse } from "../types";
2
- export declare class ProxyOAuthServerProvider implements IProxyOAuthServerProvider {
3
- private config;
4
- private storage;
5
- constructor(config: ProxyOAuthProviderConfig);
6
- get endpoints(): import("../types").OAuthEndpoints;
7
- verifyAccessToken(token: string): Promise<AccessToken>;
8
- authorize(params: AuthorizeParams): Promise<string>;
9
- token(params: TokenParams): Promise<TokenResponse>;
10
- revoke(params: RevokeParams): Promise<void>;
11
- private verifyTokenWithProvider;
12
- private createOAuthError;
13
- }
@@ -1,4 +0,0 @@
1
- import { Router, Request, Response, NextFunction } from "express";
2
- import { OAuthRouterConfig } from "./types";
3
- export declare function createOAuthRouter(config: OAuthRouterConfig): Router;
4
- export declare function createOAuthMiddleware(provider: any): (req: Request, res: Response, next: NextFunction) => Promise<void>;
@@ -1,12 +0,0 @@
1
- import { OAuthStorage, TokenStorage, AccessToken } from "../types";
2
- export declare class MemoryTokenStorage implements TokenStorage {
3
- tokens: Map<string, AccessToken>;
4
- getToken(token: string): Promise<AccessToken | null>;
5
- saveToken(token: AccessToken): Promise<void>;
6
- deleteToken(token: string): Promise<void>;
7
- deleteTokensByClient(clientId: string): Promise<void>;
8
- }
9
- export declare class MemoryOAuthStorage implements OAuthStorage {
10
- tokens: TokenStorage;
11
- constructor();
12
- }
@@ -1,112 +0,0 @@
1
- export interface OAuthClient {
2
- client_id: string;
3
- client_secret?: string;
4
- redirect_uris: string[];
5
- grant_types?: string[];
6
- response_types?: string[];
7
- scopes?: string[];
8
- }
9
- export interface AccessToken {
10
- token: string;
11
- clientId: string;
12
- scopes: string[];
13
- expiresAt?: Date;
14
- refreshToken?: string;
15
- }
16
- export interface OAuthEndpoints {
17
- authorizationUrl: string;
18
- tokenUrl: string;
19
- revocationUrl?: string;
20
- userInfoUrl?: string;
21
- registerUrl: string;
22
- }
23
- export interface OAuthError {
24
- error: string;
25
- error_description?: string;
26
- error_uri?: string;
27
- }
28
- export interface TokenResponse {
29
- access_token: string;
30
- token_type: string;
31
- expires_in?: number;
32
- refresh_token?: string;
33
- scope?: string;
34
- }
35
- export interface OAuthStorage {
36
- tokens: TokenStorage;
37
- }
38
- export interface TokenStorage {
39
- getToken(token: string): Promise<AccessToken | null>;
40
- saveToken(token: AccessToken): Promise<void>;
41
- deleteToken(token: string): Promise<void>;
42
- deleteTokensByClient(clientId: string): Promise<void>;
43
- }
44
- export interface ProxyOAuthProviderConfig {
45
- endpoints: OAuthEndpoints;
46
- storage?: OAuthStorage;
47
- verifyAccessToken?: (token: string) => Promise<AccessToken>;
48
- issuerUrl?: string;
49
- defaultScopes?: string[];
50
- }
51
- export interface OAuthRouterConfig {
52
- provider: ProxyOAuthServerProvider;
53
- issuerUrl: URL;
54
- baseUrl: URL;
55
- serviceDocumentationUrl?: URL;
56
- pathPrefix?: string;
57
- }
58
- export interface ProxyOAuthServerProvider {
59
- verifyAccessToken(token: string): Promise<AccessToken>;
60
- authorize(params: AuthorizeParams): Promise<string>;
61
- token(params: TokenParams): Promise<TokenResponse>;
62
- revoke(params: RevokeParams): Promise<void>;
63
- readonly endpoints: OAuthEndpoints;
64
- }
65
- export interface AuthorizeParams {
66
- response_type: string;
67
- client_id: string;
68
- redirect_uri: string;
69
- scope?: string;
70
- state?: string;
71
- code_challenge: string;
72
- code_challenge_method: string;
73
- }
74
- export interface TokenParams {
75
- grant_type: string;
76
- client_id: string;
77
- client_secret?: string;
78
- code?: string;
79
- redirect_uri?: string;
80
- refresh_token?: string;
81
- code_verifier?: string;
82
- }
83
- export interface RevokeParams {
84
- token: string;
85
- token_type_hint?: string;
86
- client_id?: string;
87
- client_secret?: string;
88
- }
89
- export interface OAuthConfigOptions {
90
- endpoints: {
91
- authorizationUrl: string;
92
- tokenUrl: string;
93
- revocationUrl?: string;
94
- userInfoUrl?: string;
95
- registerUrl: string;
96
- };
97
- issuerUrl: string;
98
- baseUrl: string;
99
- serviceDocumentationUrl?: string;
100
- pathPrefix?: string;
101
- defaultScopes?: string[];
102
- }
103
- export interface OAuthProxyConfig {
104
- endpoints: OAuthEndpoints;
105
- issuerUrl: string;
106
- baseUrl: string;
107
- serviceDocumentationUrl?: string;
108
- pathPrefix?: string;
109
- storage?: OAuthStorage;
110
- verifyAccessToken?: (token: string) => Promise<any>;
111
- defaultScopes?: string[];
112
- }
@@ -1,100 +0,0 @@
1
- import { z } from "zod/v3";
2
- export declare const oauthEndpointsSchema: z.ZodObject<{
3
- authorizationUrl: z.ZodString;
4
- tokenUrl: z.ZodString;
5
- revocationUrl: z.ZodOptional<z.ZodString>;
6
- userInfoUrl: z.ZodOptional<z.ZodString>;
7
- registerUrl: z.ZodString;
8
- }, "strip", z.ZodTypeAny, {
9
- authorizationUrl: string;
10
- tokenUrl: string;
11
- registerUrl: string;
12
- revocationUrl?: string | undefined;
13
- userInfoUrl?: string | undefined;
14
- }, {
15
- authorizationUrl: string;
16
- tokenUrl: string;
17
- registerUrl: string;
18
- revocationUrl?: string | undefined;
19
- userInfoUrl?: string | undefined;
20
- }>;
21
- export type OauthEndpoints = z.infer<typeof oauthEndpointsSchema>;
22
- export declare const oauthConfigSchema: z.ZodEffects<z.ZodObject<{
23
- endpoints: z.ZodObject<{
24
- authorizationUrl: z.ZodString;
25
- tokenUrl: z.ZodString;
26
- revocationUrl: z.ZodOptional<z.ZodString>;
27
- userInfoUrl: z.ZodOptional<z.ZodString>;
28
- registerUrl: z.ZodString;
29
- }, "strip", z.ZodTypeAny, {
30
- authorizationUrl: string;
31
- tokenUrl: string;
32
- registerUrl: string;
33
- revocationUrl?: string | undefined;
34
- userInfoUrl?: string | undefined;
35
- }, {
36
- authorizationUrl: string;
37
- tokenUrl: string;
38
- registerUrl: string;
39
- revocationUrl?: string | undefined;
40
- userInfoUrl?: string | undefined;
41
- }>;
42
- issuerUrl: z.ZodString;
43
- baseUrl: z.ZodString;
44
- serviceDocumentationUrl: z.ZodOptional<z.ZodString>;
45
- pathPrefix: z.ZodOptional<z.ZodString>;
46
- defaultScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
47
- }, "strip", z.ZodTypeAny, {
48
- endpoints: {
49
- authorizationUrl: string;
50
- tokenUrl: string;
51
- registerUrl: string;
52
- revocationUrl?: string | undefined;
53
- userInfoUrl?: string | undefined;
54
- };
55
- issuerUrl: string;
56
- baseUrl: string;
57
- serviceDocumentationUrl?: string | undefined;
58
- pathPrefix?: string | undefined;
59
- defaultScopes?: string[] | undefined;
60
- }, {
61
- endpoints: {
62
- authorizationUrl: string;
63
- tokenUrl: string;
64
- registerUrl: string;
65
- revocationUrl?: string | undefined;
66
- userInfoUrl?: string | undefined;
67
- };
68
- issuerUrl: string;
69
- baseUrl: string;
70
- serviceDocumentationUrl?: string | undefined;
71
- pathPrefix?: string | undefined;
72
- defaultScopes?: string[] | undefined;
73
- }>, {
74
- endpoints: {
75
- authorizationUrl: string;
76
- tokenUrl: string;
77
- registerUrl: string;
78
- revocationUrl?: string | undefined;
79
- userInfoUrl?: string | undefined;
80
- };
81
- issuerUrl: string;
82
- baseUrl: string;
83
- pathPrefix: string;
84
- defaultScopes: string[];
85
- serviceDocumentationUrl?: string | undefined;
86
- }, {
87
- endpoints: {
88
- authorizationUrl: string;
89
- tokenUrl: string;
90
- registerUrl: string;
91
- revocationUrl?: string | undefined;
92
- userInfoUrl?: string | undefined;
93
- };
94
- issuerUrl: string;
95
- baseUrl: string;
96
- serviceDocumentationUrl?: string | undefined;
97
- pathPrefix?: string | undefined;
98
- defaultScopes?: string[] | undefined;
99
- }>;
100
- export type OAuthConfig = z.infer<typeof oauthConfigSchema>;