@zuplo/runtime 6.70.49 → 6.70.51

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.
@@ -4,6 +4,7 @@ import { CallToolResult } from "@zuplo/mcp/types";
4
4
  import { KeyLike } from "jose";
5
5
  import { RequestGeneric as RequestGeneric_2 } from "../../request.js";
6
6
  import type { ValidateFunction } from "ajv";
7
+ import { z } from "zod/v4";
7
8
 
8
9
  /**
9
10
  * Converts Anthropic Messages API format requests to OpenAI Chat Completions format.
@@ -5641,8 +5642,892 @@ declare type LokiTransportVersion = 1 | 2;
5641
5642
 
5642
5643
  /* Excluded from this release type: LookupResult */
5643
5644
 
5645
+ /**
5646
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
5647
+ * with browser login delegated to Auth0.
5648
+ *
5649
+ * Auth0-friendly wrapper around `McpOAuthInboundPolicy`. Provide `auth0Domain`
5650
+ * and `clientId`; the constructor derives the OIDC issuer, JWKS URL, and Auth0
5651
+ * authorize/token endpoints automatically and runs the resulting shape through
5652
+ * the same Zod schema as the generic policy.
5653
+ *
5654
+ * Validation runs lazily inside the policy constructor, which the runtime
5655
+ * caches per policy name — so a misconfigured policy fails the first request
5656
+ * with a `ConfigurationError` (surfaced in the 500 problem body) rather than
5657
+ * crashing boot.
5658
+ *
5659
+ * @public
5660
+ * @title MCP Auth0 OAuth
5661
+ * @product mcp-gateway
5662
+ */
5663
+ export declare class McpAuth0OAuthInboundPolicy extends InboundPolicy<McpAuth0OAuthInboundPolicyOptions> {
5664
+ #private;
5665
+ constructor(rawOptions: unknown, policyName: string);
5666
+ handler(
5667
+ request: ZuploRequest,
5668
+ context: ZuploContext
5669
+ ): Promise<ZuploRequest | Response>;
5670
+ }
5671
+
5672
+ /**
5673
+ * The options for this policy.
5674
+ * @public
5675
+ */
5676
+ export declare interface McpAuth0OAuthInboundPolicyOptions {
5677
+ /**
5678
+ * Your Auth0 tenant domain. The OIDC issuer, JWKS URL, /authorize URL, and /oauth/token URL are derived from this.
5679
+ */
5680
+ auth0Domain: string;
5681
+ /**
5682
+ * Optional Auth0 API audience. When set, the gateway sends it as the Auth0 authorize?audience= parameter and validates returned provider access tokens against it. Leave unset when Auth0 is only used for browser identity.
5683
+ */
5684
+ audience?: string;
5685
+ /**
5686
+ * The Auth0 client_id registered for the gateway's browser login flow.
5687
+ */
5688
+ clientId: string;
5689
+ /**
5690
+ * The Auth0 client_secret. Use $env(...) to source from a secret environment variable.
5691
+ */
5692
+ clientSecret: string;
5693
+ /**
5694
+ * OIDC scopes requested during browser login.
5695
+ */
5696
+ scope?: string;
5697
+ /**
5698
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
5699
+ */
5700
+ gateway?: {
5701
+ /**
5702
+ * Lifetime of access tokens issued by /oauth/token.
5703
+ */
5704
+ accessTokenTtlSeconds?: number;
5705
+ /**
5706
+ * Lifetime of refresh tokens issued by /oauth/token.
5707
+ */
5708
+ refreshTokenTtlSeconds?: number;
5709
+ /**
5710
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
5711
+ */
5712
+ cimdEnabled?: boolean;
5713
+ };
5714
+ /**
5715
+ * Optional overrides for the derived browser-login settings.
5716
+ */
5717
+ browserLoginOverrides?: {
5718
+ remoteTimeoutMs?: number;
5719
+ stateTtlSeconds?: number;
5720
+ sessionTtlSeconds?: number;
5721
+ };
5722
+ }
5723
+
5724
+ /**
5725
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
5726
+ * with browser login delegated to Clerk.
5727
+ *
5728
+ * Clerk-friendly wrapper around `McpOAuthInboundPolicy`. Provide Clerk's
5729
+ * Frontend API URL plus the OAuth application client id and secret; the
5730
+ * constructor derives the Clerk issuer, JWKS URL, authorize URL, and token URL.
5731
+ *
5732
+ * @title MCP Clerk OAuth
5733
+ * @public
5734
+ * @product mcp-gateway
5735
+ */
5736
+ export declare class McpClerkOAuthInboundPolicy extends InboundPolicy<McpClerkOAuthInboundPolicyOptions> {
5737
+ #private;
5738
+ constructor(rawOptions: unknown, policyName: string);
5739
+ handler(
5740
+ request: ZuploRequest,
5741
+ context: ZuploContext
5742
+ ): Promise<ZuploRequest | Response>;
5743
+ }
5744
+
5745
+ /**
5746
+ * The options for this policy.
5747
+ * @public
5748
+ */
5749
+ export declare interface McpClerkOAuthInboundPolicyOptions {
5750
+ /**
5751
+ * The Clerk Frontend API URL origin, without a trailing path, query string, or fragment.
5752
+ */
5753
+ frontendApiUrl: string;
5754
+ /**
5755
+ * The Clerk OAuth application client_id registered for the gateway's browser login flow.
5756
+ */
5757
+ clientId: string;
5758
+ /**
5759
+ * The Clerk OAuth application client_secret. Use $env(...) to source from a secret environment variable.
5760
+ */
5761
+ clientSecret: string;
5762
+ /**
5763
+ * OIDC scopes requested during browser login.
5764
+ */
5765
+ scope?: string;
5766
+ /**
5767
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
5768
+ */
5769
+ gateway?: {
5770
+ /**
5771
+ * Lifetime of access tokens issued by /oauth/token.
5772
+ */
5773
+ accessTokenTtlSeconds?: number;
5774
+ /**
5775
+ * Lifetime of refresh tokens issued by /oauth/token.
5776
+ */
5777
+ refreshTokenTtlSeconds?: number;
5778
+ /**
5779
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
5780
+ */
5781
+ cimdEnabled?: boolean;
5782
+ };
5783
+ /**
5784
+ * Optional overrides for the derived browser-login settings.
5785
+ */
5786
+ browserLoginOverrides?: {
5787
+ remoteTimeoutMs?: number;
5788
+ stateTtlSeconds?: number;
5789
+ sessionTtlSeconds?: number;
5790
+ };
5791
+ }
5792
+
5793
+ /**
5794
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
5795
+ * with browser login delegated to Amazon Cognito.
5796
+ *
5797
+ * Cognito-friendly wrapper around `McpOAuthInboundPolicy`. Provide an AWS
5798
+ * region, user pool id, user pool domain, client id, and client secret; the
5799
+ * constructor derives the Cognito issuer, JWKS URL, authorize URL, and token
5800
+ * URL.
5801
+ *
5802
+ * @title MCP Amazon Cognito OAuth
5803
+ * @public
5804
+ * @product mcp-gateway
5805
+ */
5806
+ export declare class McpCognitoOAuthInboundPolicy extends InboundPolicy<McpCognitoOAuthInboundPolicyOptions> {
5807
+ #private;
5808
+ constructor(rawOptions: unknown, policyName: string);
5809
+ handler(
5810
+ request: ZuploRequest,
5811
+ context: ZuploContext
5812
+ ): Promise<ZuploRequest | Response>;
5813
+ }
5814
+
5815
+ /**
5816
+ * The options for this policy.
5817
+ * @public
5818
+ */
5819
+ export declare interface McpCognitoOAuthInboundPolicyOptions {
5820
+ /**
5821
+ * The AWS region that contains the Amazon Cognito user pool.
5822
+ */
5823
+ awsRegion: string;
5824
+ /**
5825
+ * The Amazon Cognito user pool ID.
5826
+ */
5827
+ userPoolId: string;
5828
+ /**
5829
+ * The hosted UI domain for the user pool, without https://, a trailing slash, or a path.
5830
+ */
5831
+ userPoolDomain: string;
5832
+ /**
5833
+ * The Cognito app client_id registered for the gateway's browser login flow.
5834
+ */
5835
+ clientId: string;
5836
+ /**
5837
+ * The Cognito app client_secret. Use $env(...) to source from a secret environment variable.
5838
+ */
5839
+ clientSecret: string;
5840
+ /**
5841
+ * OIDC scopes requested during browser login.
5842
+ */
5843
+ scope?: string;
5844
+ /**
5845
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
5846
+ */
5847
+ gateway?: {
5848
+ /**
5849
+ * Lifetime of access tokens issued by /oauth/token.
5850
+ */
5851
+ accessTokenTtlSeconds?: number;
5852
+ /**
5853
+ * Lifetime of refresh tokens issued by /oauth/token.
5854
+ */
5855
+ refreshTokenTtlSeconds?: number;
5856
+ /**
5857
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
5858
+ */
5859
+ cimdEnabled?: boolean;
5860
+ };
5861
+ /**
5862
+ * Optional overrides for the derived browser-login settings.
5863
+ */
5864
+ browserLoginOverrides?: {
5865
+ remoteTimeoutMs?: number;
5866
+ stateTtlSeconds?: number;
5867
+ sessionTtlSeconds?: number;
5868
+ };
5869
+ }
5870
+
5871
+ /**
5872
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
5873
+ * with browser login delegated to Microsoft Entra ID.
5874
+ *
5875
+ * Entra-friendly wrapper around `McpOAuthInboundPolicy`. Provide a tenant UUID,
5876
+ * application client id, and client secret; the constructor derives the Entra
5877
+ * v2 issuer, JWKS URL, authorize URL, and token URL.
5878
+ *
5879
+ * @title MCP Microsoft Entra OAuth
5880
+ * @public
5881
+ * @product mcp-gateway
5882
+ */
5883
+ export declare class McpEntraOAuthInboundPolicy extends InboundPolicy<McpEntraOAuthInboundPolicyOptions> {
5884
+ #private;
5885
+ constructor(rawOptions: unknown, policyName: string);
5886
+ handler(
5887
+ request: ZuploRequest,
5888
+ context: ZuploContext
5889
+ ): Promise<ZuploRequest | Response>;
5890
+ }
5891
+
5892
+ /**
5893
+ * The options for this policy.
5894
+ * @public
5895
+ */
5896
+ export declare interface McpEntraOAuthInboundPolicyOptions {
5897
+ /**
5898
+ * The Microsoft Entra tenant UUID. Multi-tenant aliases like common and organizations are not supported by this policy yet.
5899
+ */
5900
+ tenantId: string;
5901
+ /**
5902
+ * The Microsoft Entra application (client) ID UUID registered for the gateway's browser login flow.
5903
+ */
5904
+ clientId: string;
5905
+ /**
5906
+ * The Microsoft Entra client secret. Use $env(...) to source from a secret environment variable.
5907
+ */
5908
+ clientSecret: string;
5909
+ /**
5910
+ * OIDC scopes requested during browser login.
5911
+ */
5912
+ scope?: string;
5913
+ /**
5914
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
5915
+ */
5916
+ gateway?: {
5917
+ /**
5918
+ * Lifetime of access tokens issued by /oauth/token.
5919
+ */
5920
+ accessTokenTtlSeconds?: number;
5921
+ /**
5922
+ * Lifetime of refresh tokens issued by /oauth/token.
5923
+ */
5924
+ refreshTokenTtlSeconds?: number;
5925
+ /**
5926
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
5927
+ */
5928
+ cimdEnabled?: boolean;
5929
+ };
5930
+ /**
5931
+ * Optional overrides for the derived browser-login settings.
5932
+ */
5933
+ browserLoginOverrides?: {
5934
+ remoteTimeoutMs?: number;
5935
+ stateTtlSeconds?: number;
5936
+ sessionTtlSeconds?: number;
5937
+ };
5938
+ }
5939
+
5644
5940
  /* Excluded from this release type: McpGatewayOAuthProtectedResourcePlugin */
5645
5941
 
5942
+ /**
5943
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
5944
+ * with browser login delegated to Google.
5945
+ *
5946
+ * Google-friendly wrapper around `McpOAuthInboundPolicy`. Provide `clientId`
5947
+ * and `clientSecret`; the constructor uses Google's fixed OIDC issuer, JWKS
5948
+ * URL, authorize URL, and token URL, then runs the resulting shape through the
5949
+ * same Zod schema as the generic policy.
5950
+ *
5951
+ * @title MCP Google OAuth
5952
+ * @public
5953
+ * @product mcp-gateway
5954
+ */
5955
+ export declare class McpGoogleOAuthInboundPolicy extends InboundPolicy<McpGoogleOAuthInboundPolicyOptions> {
5956
+ #private;
5957
+ constructor(rawOptions: unknown, policyName: string);
5958
+ handler(
5959
+ request: ZuploRequest,
5960
+ context: ZuploContext
5961
+ ): Promise<ZuploRequest | Response>;
5962
+ }
5963
+
5964
+ /**
5965
+ * The options for this policy.
5966
+ * @public
5967
+ */
5968
+ export declare interface McpGoogleOAuthInboundPolicyOptions {
5969
+ /**
5970
+ * The Google OAuth client_id registered for the gateway's browser login flow. Google uses a fixed OIDC issuer and discovery endpoint.
5971
+ */
5972
+ clientId: string;
5973
+ /**
5974
+ * The Google OAuth client_secret. Use $env(...) to source from a secret environment variable.
5975
+ */
5976
+ clientSecret: string;
5977
+ /**
5978
+ * OIDC scopes requested during browser login.
5979
+ */
5980
+ scope?: string;
5981
+ /**
5982
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
5983
+ */
5984
+ gateway?: {
5985
+ /**
5986
+ * Lifetime of access tokens issued by /oauth/token.
5987
+ */
5988
+ accessTokenTtlSeconds?: number;
5989
+ /**
5990
+ * Lifetime of refresh tokens issued by /oauth/token.
5991
+ */
5992
+ refreshTokenTtlSeconds?: number;
5993
+ /**
5994
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
5995
+ */
5996
+ cimdEnabled?: boolean;
5997
+ };
5998
+ /**
5999
+ * Optional overrides for the derived browser-login settings.
6000
+ */
6001
+ browserLoginOverrides?: {
6002
+ remoteTimeoutMs?: number;
6003
+ stateTtlSeconds?: number;
6004
+ sessionTtlSeconds?: number;
6005
+ };
6006
+ }
6007
+
6008
+ /**
6009
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
6010
+ * with browser login delegated to Keycloak.
6011
+ *
6012
+ * Keycloak-friendly wrapper around `McpOAuthInboundPolicy`. Provide the
6013
+ * Keycloak server root, realm, client id, and client secret; the constructor
6014
+ * derives the realm issuer, JWKS URL, authorize URL, and token URL from
6015
+ * Keycloak's documented OIDC endpoint layout.
6016
+ *
6017
+ * @title MCP Keycloak OAuth
6018
+ * @public
6019
+ * @product mcp-gateway
6020
+ */
6021
+ export declare class McpKeycloakOAuthInboundPolicy extends InboundPolicy<McpKeycloakOAuthInboundPolicyOptions> {
6022
+ #private;
6023
+ constructor(rawOptions: unknown, policyName: string);
6024
+ handler(
6025
+ request: ZuploRequest,
6026
+ context: ZuploContext
6027
+ ): Promise<ZuploRequest | Response>;
6028
+ }
6029
+
6030
+ /**
6031
+ * The options for this policy.
6032
+ * @public
6033
+ */
6034
+ export declare interface McpKeycloakOAuthInboundPolicyOptions {
6035
+ /**
6036
+ * The absolute URL for the Keycloak server root. Do not include /realms/{realm}; set the realm option separately.
6037
+ */
6038
+ keycloakBaseUrl: string;
6039
+ /**
6040
+ * The Keycloak realm name.
6041
+ */
6042
+ realm: string;
6043
+ /**
6044
+ * The Keycloak OIDC client_id registered for the gateway's browser login flow.
6045
+ */
6046
+ clientId: string;
6047
+ /**
6048
+ * The Keycloak OIDC client_secret. Use $env(...) to source from a secret environment variable.
6049
+ */
6050
+ clientSecret: string;
6051
+ /**
6052
+ * OIDC scopes requested during browser login.
6053
+ */
6054
+ scope?: string;
6055
+ /**
6056
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
6057
+ */
6058
+ gateway?: {
6059
+ /**
6060
+ * Lifetime of access tokens issued by /oauth/token.
6061
+ */
6062
+ accessTokenTtlSeconds?: number;
6063
+ /**
6064
+ * Lifetime of refresh tokens issued by /oauth/token.
6065
+ */
6066
+ refreshTokenTtlSeconds?: number;
6067
+ /**
6068
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
6069
+ */
6070
+ cimdEnabled?: boolean;
6071
+ };
6072
+ /**
6073
+ * Optional overrides for the derived browser-login settings.
6074
+ */
6075
+ browserLoginOverrides?: {
6076
+ remoteTimeoutMs?: number;
6077
+ stateTtlSeconds?: number;
6078
+ sessionTtlSeconds?: number;
6079
+ };
6080
+ }
6081
+
6082
+ /**
6083
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
6084
+ * with browser login delegated to Logto.
6085
+ *
6086
+ * Logto-friendly wrapper around `McpOAuthInboundPolicy`. Provide the Logto
6087
+ * tenant endpoint, client id, and client secret; the constructor derives the
6088
+ * Logto `/oidc` issuer, JWKS URL, authorize URL, and token URL.
6089
+ *
6090
+ * @title MCP Logto OAuth
6091
+ * @public
6092
+ * @product mcp-gateway
6093
+ */
6094
+ export declare class McpLogtoOAuthInboundPolicy extends InboundPolicy<McpLogtoOAuthInboundPolicyOptions> {
6095
+ #private;
6096
+ constructor(rawOptions: unknown, policyName: string);
6097
+ handler(
6098
+ request: ZuploRequest,
6099
+ context: ZuploContext
6100
+ ): Promise<ZuploRequest | Response>;
6101
+ }
6102
+
6103
+ /**
6104
+ * The options for this policy.
6105
+ * @public
6106
+ */
6107
+ export declare interface McpLogtoOAuthInboundPolicyOptions {
6108
+ /**
6109
+ * Your Logto tenant endpoint or custom domain, without the /oidc path. The OIDC issuer, JWKS URL, authorization URL, and token URL are derived from this.
6110
+ */
6111
+ logtoEndpoint: string;
6112
+ /**
6113
+ * The Logto application client_id registered for the gateway's browser login flow.
6114
+ */
6115
+ clientId: string;
6116
+ /**
6117
+ * The Logto application client_secret. Use $env(...) to source from a secret environment variable.
6118
+ */
6119
+ clientSecret: string;
6120
+ /**
6121
+ * OIDC scopes requested during browser login.
6122
+ */
6123
+ scope?: string;
6124
+ /**
6125
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
6126
+ */
6127
+ gateway?: {
6128
+ /**
6129
+ * Lifetime of access tokens issued by /oauth/token.
6130
+ */
6131
+ accessTokenTtlSeconds?: number;
6132
+ /**
6133
+ * Lifetime of refresh tokens issued by /oauth/token.
6134
+ */
6135
+ refreshTokenTtlSeconds?: number;
6136
+ /**
6137
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
6138
+ */
6139
+ cimdEnabled?: boolean;
6140
+ };
6141
+ /**
6142
+ * Optional overrides for the derived browser-login settings.
6143
+ */
6144
+ browserLoginOverrides?: {
6145
+ remoteTimeoutMs?: number;
6146
+ stateTtlSeconds?: number;
6147
+ sessionTtlSeconds?: number;
6148
+ };
6149
+ }
6150
+
6151
+ /**
6152
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token.
6153
+ *
6154
+ * The gateway hosts its own OAuth authorization server endpoints (DCR,
6155
+ * `/authorize`, `/token`, `/callback`) — registered automatically when this
6156
+ * policy is present in `policies.json`. End-user browser login is delegated
6157
+ * to the OpenID Connect identity provider configured via the `oidc` and
6158
+ * `browserLogin` policy options.
6159
+ *
6160
+ * Validation runs lazily inside the policy constructor, which the runtime
6161
+ * caches per policy name — so a misconfigured policy fails the first request
6162
+ * with a `ConfigurationError` (surfaced in the 500 problem body) rather than
6163
+ * crashing boot.
6164
+ *
6165
+ * @public
6166
+ * @title MCP OAuth
6167
+ * @product mcp-gateway
6168
+ */
6169
+ export declare class McpOAuthInboundPolicy extends InboundPolicy<McpOAuthRuntimeConfig> {
6170
+ constructor(rawOptions: unknown, policyName: string);
6171
+ handler(
6172
+ request: ZuploRequest,
6173
+ context: ZuploContext
6174
+ ): Promise<ZuploRequest | Response>;
6175
+ }
6176
+
6177
+ /**
6178
+ * The options for this policy.
6179
+ * @public
6180
+ */
6181
+ export declare interface McpOAuthInboundPolicyOptions {
6182
+ /**
6183
+ * OpenID Connect identity provider that authenticates end-users before the gateway issues its own OAuth access token.
6184
+ */
6185
+ oidc: {
6186
+ /**
6187
+ * The OIDC issuer URL of the identity provider.
6188
+ */
6189
+ issuer: string;
6190
+ /**
6191
+ * The JWKS endpoint used to verify ID tokens issued by the identity provider.
6192
+ */
6193
+ jwksUrl: string;
6194
+ /**
6195
+ * Optional IdP audience value. Leave unset when browser login ID tokens use the OIDC client_id as their audience.
6196
+ */
6197
+ audience?: string;
6198
+ };
6199
+ /**
6200
+ * Browser-side OAuth/OIDC settings used when the gateway redirects the user to the identity provider for login.
6201
+ */
6202
+ browserLogin: {
6203
+ /**
6204
+ * The IdP /authorize endpoint to redirect the user to. For local development on loopback, use http://127.0.0.1:9000/oauth/dev-login.
6205
+ */
6206
+ url: string;
6207
+ /**
6208
+ * The IdP token endpoint used for the federated authorization code exchange. Required for federated_oidc browser login.
6209
+ */
6210
+ tokenUrl?: string;
6211
+ /**
6212
+ * The OIDC client_id registered with the identity provider for the gateway's browser login flow.
6213
+ */
6214
+ clientId?: string;
6215
+ /**
6216
+ * The OIDC client_secret. Required for federated browser login. Use $env(...) to source from a secret environment variable.
6217
+ */
6218
+ clientSecret?: string;
6219
+ /**
6220
+ * The OIDC scopes requested during browser login.
6221
+ */
6222
+ scope?: string;
6223
+ /**
6224
+ * Optional audience parameter for the IdP authorization request (Auth0-style API audiences).
6225
+ */
6226
+ audience?: string;
6227
+ /**
6228
+ * Timeout for outbound calls to the IdP (token exchange, JWKS fetch).
6229
+ */
6230
+ remoteTimeoutMs?: number;
6231
+ /**
6232
+ * Lifetime of an in-flight browser-login state record.
6233
+ */
6234
+ stateTtlSeconds?: number;
6235
+ /**
6236
+ * Lifetime of the gateway browser-login session cookie issued after a successful login.
6237
+ */
6238
+ sessionTtlSeconds?: number;
6239
+ };
6240
+ /**
6241
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
6242
+ */
6243
+ gateway?: {
6244
+ /**
6245
+ * Lifetime of access tokens issued by /oauth/token.
6246
+ */
6247
+ accessTokenTtlSeconds?: number;
6248
+ /**
6249
+ * Lifetime of refresh tokens issued by /oauth/token.
6250
+ */
6251
+ refreshTokenTtlSeconds?: number;
6252
+ /**
6253
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
6254
+ */
6255
+ cimdEnabled?: boolean;
6256
+ };
6257
+ }
6258
+
6259
+ declare type McpOAuthRuntimeConfig = z.infer<
6260
+ typeof mcpOAuthRuntimeConfigSchema
6261
+ >;
6262
+
6263
+ declare const mcpOAuthRuntimeConfigSchema: z.ZodObject<
6264
+ {
6265
+ oidc: z.ZodObject<
6266
+ {
6267
+ issuer: z.ZodURL;
6268
+ jwksUrl: z.ZodURL;
6269
+ audience: z.ZodOptional<z.ZodString>;
6270
+ },
6271
+ z.core.$strip
6272
+ >;
6273
+ browserLogin: z.ZodObject<
6274
+ {
6275
+ url: z.ZodURL;
6276
+ tokenUrl: z.ZodOptional<z.ZodURL>;
6277
+ clientId: z.ZodOptional<z.ZodString>;
6278
+ clientSecret: z.ZodOptional<z.ZodString>;
6279
+ scope: z.ZodDefault<z.ZodString>;
6280
+ audience: z.ZodOptional<z.ZodString>;
6281
+ remoteTimeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
6282
+ stateTtlSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
6283
+ sessionTtlSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
6284
+ },
6285
+ z.core.$strict
6286
+ >;
6287
+ gateway: z.ZodDefault<
6288
+ z.ZodOptional<
6289
+ z.ZodDefault<
6290
+ z.ZodObject<
6291
+ {
6292
+ accessTokenTtlSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
6293
+ refreshTokenTtlSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
6294
+ cimdEnabled: z.ZodDefault<z.ZodBoolean>;
6295
+ },
6296
+ z.core.$strict
6297
+ >
6298
+ >
6299
+ >
6300
+ >;
6301
+ },
6302
+ z.core.$strict
6303
+ >;
6304
+
6305
+ /**
6306
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
6307
+ * with browser login delegated to Okta.
6308
+ *
6309
+ * Okta-friendly wrapper around `McpOAuthInboundPolicy`. Provide an Okta org
6310
+ * domain, optional authorization server id, client id, and client secret; the
6311
+ * constructor derives the Okta issuer, JWKS URL, authorize URL, and token URL.
6312
+ *
6313
+ * @title MCP Okta OAuth
6314
+ * @public
6315
+ * @product mcp-gateway
6316
+ */
6317
+ export declare class McpOktaOAuthInboundPolicy extends InboundPolicy<McpOktaOAuthInboundPolicyOptions> {
6318
+ #private;
6319
+ constructor(rawOptions: unknown, policyName: string);
6320
+ handler(
6321
+ request: ZuploRequest,
6322
+ context: ZuploContext
6323
+ ): Promise<ZuploRequest | Response>;
6324
+ }
6325
+
6326
+ /**
6327
+ * The options for this policy.
6328
+ * @public
6329
+ */
6330
+ export declare interface McpOktaOAuthInboundPolicyOptions {
6331
+ /**
6332
+ * The Okta org domain, without https://, a trailing slash, or a path.
6333
+ */
6334
+ oktaDomain: string;
6335
+ /**
6336
+ * Optional Okta custom authorization server id. Omit this to use the org authorization server.
6337
+ */
6338
+ authorizationServerId?: string;
6339
+ /**
6340
+ * The Okta OIDC application client_id registered for the gateway's browser login flow.
6341
+ */
6342
+ clientId: string;
6343
+ /**
6344
+ * The Okta OIDC application client_secret. Use $env(...) to source from a secret environment variable.
6345
+ */
6346
+ clientSecret: string;
6347
+ /**
6348
+ * OIDC scopes requested during browser login.
6349
+ */
6350
+ scope?: string;
6351
+ /**
6352
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
6353
+ */
6354
+ gateway?: {
6355
+ /**
6356
+ * Lifetime of access tokens issued by /oauth/token.
6357
+ */
6358
+ accessTokenTtlSeconds?: number;
6359
+ /**
6360
+ * Lifetime of refresh tokens issued by /oauth/token.
6361
+ */
6362
+ refreshTokenTtlSeconds?: number;
6363
+ /**
6364
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
6365
+ */
6366
+ cimdEnabled?: boolean;
6367
+ };
6368
+ /**
6369
+ * Optional overrides for the derived browser-login settings.
6370
+ */
6371
+ browserLoginOverrides?: {
6372
+ remoteTimeoutMs?: number;
6373
+ stateTtlSeconds?: number;
6374
+ sessionTtlSeconds?: number;
6375
+ };
6376
+ }
6377
+
6378
+ /**
6379
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
6380
+ * with browser login delegated to OneLogin.
6381
+ *
6382
+ * OneLogin-friendly wrapper around `McpOAuthInboundPolicy`. Provide the
6383
+ * OneLogin account subdomain, client id, and client secret; the constructor
6384
+ * derives OneLogin's OIDC issuer, JWKS URL, authorize URL, and token URL.
6385
+ *
6386
+ * @title MCP OneLogin OAuth
6387
+ * @public
6388
+ * @product mcp-gateway
6389
+ */
6390
+ export declare class McpOneLoginOAuthInboundPolicy extends InboundPolicy<McpOneLoginOAuthInboundPolicyOptions> {
6391
+ #private;
6392
+ constructor(rawOptions: unknown, policyName: string);
6393
+ handler(
6394
+ request: ZuploRequest,
6395
+ context: ZuploContext
6396
+ ): Promise<ZuploRequest | Response>;
6397
+ }
6398
+
6399
+ /**
6400
+ * The options for this policy.
6401
+ * @public
6402
+ */
6403
+ export declare interface McpOneLoginOAuthInboundPolicyOptions {
6404
+ /**
6405
+ * The OneLogin account subdomain, without https://, .onelogin.com, a trailing slash, or a path.
6406
+ */
6407
+ oneLoginSubdomain: string;
6408
+ /**
6409
+ * The OneLogin OIDC application client_id registered for the gateway's browser login flow.
6410
+ */
6411
+ clientId: string;
6412
+ /**
6413
+ * The OneLogin OIDC application client_secret. Use $env(...) to source from a secret environment variable.
6414
+ */
6415
+ clientSecret: string;
6416
+ /**
6417
+ * OIDC scopes requested during browser login.
6418
+ */
6419
+ scope?: string;
6420
+ /**
6421
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
6422
+ */
6423
+ gateway?: {
6424
+ /**
6425
+ * Lifetime of access tokens issued by /oauth/token.
6426
+ */
6427
+ accessTokenTtlSeconds?: number;
6428
+ /**
6429
+ * Lifetime of refresh tokens issued by /oauth/token.
6430
+ */
6431
+ refreshTokenTtlSeconds?: number;
6432
+ /**
6433
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
6434
+ */
6435
+ cimdEnabled?: boolean;
6436
+ };
6437
+ /**
6438
+ * Optional overrides for the derived browser-login settings.
6439
+ */
6440
+ browserLoginOverrides?: {
6441
+ remoteTimeoutMs?: number;
6442
+ stateTtlSeconds?: number;
6443
+ sessionTtlSeconds?: number;
6444
+ };
6445
+ }
6446
+
6447
+ /**
6448
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
6449
+ * with browser login delegated to PingOne.
6450
+ *
6451
+ * PingOne-friendly wrapper around `McpOAuthInboundPolicy`. Provide a PingOne
6452
+ * environment ID plus optional region, or a PingOne custom domain, with client
6453
+ * ID and client secret; the constructor derives the PingOne issuer, JWKS URL,
6454
+ * authorize URL, and token URL.
6455
+ *
6456
+ * @title MCP Ping OAuth
6457
+ * @public
6458
+ * @product mcp-gateway
6459
+ */
6460
+ export declare class McpPingOAuthInboundPolicy extends InboundPolicy<McpPingOAuthInboundPolicyOptions> {
6461
+ #private;
6462
+ constructor(rawOptions: unknown, policyName: string);
6463
+ handler(
6464
+ request: ZuploRequest,
6465
+ context: ZuploContext
6466
+ ): Promise<ZuploRequest | Response>;
6467
+ }
6468
+
6469
+ /**
6470
+ * The options for this policy.
6471
+ * @public
6472
+ */
6473
+ export declare interface McpPingOAuthInboundPolicyOptions {
6474
+ /**
6475
+ * The PingOne environment ID. Required unless customDomain is set.
6476
+ */
6477
+ environmentId?: string;
6478
+ /**
6479
+ * The PingOne geography for the environment. Ignored when customDomain is set.
6480
+ */
6481
+ region?:
6482
+ | "north-america"
6483
+ | "canada"
6484
+ | "europe"
6485
+ | "singapore"
6486
+ | "australia"
6487
+ | "asia-pacific";
6488
+ /**
6489
+ * Optional PingOne custom domain, without https://, a trailing slash, or a path. When set, environmentId and region are not used.
6490
+ */
6491
+ customDomain?: string;
6492
+ /**
6493
+ * The PingOne OIDC application client_id registered for the gateway's browser login flow.
6494
+ */
6495
+ clientId: string;
6496
+ /**
6497
+ * The PingOne OIDC application client_secret. Use $env(...) to source from a secret environment variable.
6498
+ */
6499
+ clientSecret: string;
6500
+ /**
6501
+ * OIDC scopes requested during browser login.
6502
+ */
6503
+ scope?: string;
6504
+ /**
6505
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
6506
+ */
6507
+ gateway?: {
6508
+ /**
6509
+ * Lifetime of access tokens issued by /oauth/token.
6510
+ */
6511
+ accessTokenTtlSeconds?: number;
6512
+ /**
6513
+ * Lifetime of refresh tokens issued by /oauth/token.
6514
+ */
6515
+ refreshTokenTtlSeconds?: number;
6516
+ /**
6517
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
6518
+ */
6519
+ cimdEnabled?: boolean;
6520
+ };
6521
+ /**
6522
+ * Optional overrides for the derived browser-login settings.
6523
+ */
6524
+ browserLoginOverrides?: {
6525
+ remoteTimeoutMs?: number;
6526
+ stateTtlSeconds?: number;
6527
+ sessionTtlSeconds?: number;
6528
+ };
6529
+ }
6530
+
5646
6531
  /**
5647
6532
  * An MCP Server handler for Zuplo
5648
6533
  * Only POST requests are supported for the HTTP streamable MCP transport.
@@ -5657,6 +6542,72 @@ export declare function mcpServerHandler(
5657
6542
  context: ZuploContext
5658
6543
  ): Promise<Response>;
5659
6544
 
6545
+ /**
6546
+ * Authenticate MCP gateway requests using a gateway-issued OAuth access token,
6547
+ * with browser login delegated to WorkOS.
6548
+ *
6549
+ * WorkOS-friendly wrapper around `McpOAuthInboundPolicy`. Provide `clientId`
6550
+ * and `clientSecret`; the constructor derives the WorkOS OIDC issuer, JWKS URL,
6551
+ * authorize URL, and token URL automatically and runs the resulting shape
6552
+ * through the same Zod schema as the generic policy.
6553
+ *
6554
+ * @title MCP WorkOS OAuth
6555
+ * @public
6556
+ * @product mcp-gateway
6557
+ */
6558
+ export declare class McpWorkosOAuthInboundPolicy extends InboundPolicy<McpWorkosOAuthInboundPolicyOptions> {
6559
+ #private;
6560
+ constructor(rawOptions: unknown, policyName: string);
6561
+ handler(
6562
+ request: ZuploRequest,
6563
+ context: ZuploContext
6564
+ ): Promise<ZuploRequest | Response>;
6565
+ }
6566
+
6567
+ /**
6568
+ * The options for this policy.
6569
+ * @public
6570
+ */
6571
+ export declare interface McpWorkosOAuthInboundPolicyOptions {
6572
+ /**
6573
+ * The WorkOS client_id registered for the gateway's browser login flow. The OIDC issuer and JWKS URL are derived from this client ID.
6574
+ */
6575
+ clientId: string;
6576
+ /**
6577
+ * The WorkOS client_secret. Use $env(...) to source from a secret environment variable.
6578
+ */
6579
+ clientSecret: string;
6580
+ /**
6581
+ * OIDC scopes requested during browser login.
6582
+ */
6583
+ scope?: string;
6584
+ /**
6585
+ * Gateway-side OAuth token settings. The gateway issuer and advertised URLs are derived from the incoming request origin.
6586
+ */
6587
+ gateway?: {
6588
+ /**
6589
+ * Lifetime of access tokens issued by /oauth/token.
6590
+ */
6591
+ accessTokenTtlSeconds?: number;
6592
+ /**
6593
+ * Lifetime of refresh tokens issued by /oauth/token.
6594
+ */
6595
+ refreshTokenTtlSeconds?: number;
6596
+ /**
6597
+ * Whether to advertise client_id_metadata_document_supported in AS metadata.
6598
+ */
6599
+ cimdEnabled?: boolean;
6600
+ };
6601
+ /**
6602
+ * Optional overrides for the derived browser-login settings.
6603
+ */
6604
+ browserLoginOverrides?: {
6605
+ remoteTimeoutMs?: number;
6606
+ stateTtlSeconds?: number;
6607
+ sessionTtlSeconds?: number;
6608
+ };
6609
+ }
6610
+
5660
6611
  declare interface MemoryCacheOptions {
5661
6612
  maxSize: number;
5662
6613
  }