|
| 1 | +// Public API for @modelcontextprotocol/client (browser / Cloudflare Workers entry). |
| 2 | +// |
| 3 | +// Mirrors ./index.ts exactly, except stdio symbols come from ./stdioStub.js so |
| 4 | +// the bundle does not pull `node:child_process`, `node:stream`, or `cross-spawn`. |
| 5 | +// Selected via the `browser` and `workerd` export conditions. |
| 6 | + |
| 7 | +export type { |
| 8 | + AddClientAuthentication, |
| 9 | + AuthProvider, |
| 10 | + AuthResult, |
| 11 | + ClientAuthMethod, |
| 12 | + OAuthClientProvider, |
| 13 | + OAuthDiscoveryState, |
| 14 | + OAuthServerInfo |
| 15 | +} from './client/auth.js'; |
| 16 | +export { |
| 17 | + auth, |
| 18 | + buildDiscoveryUrls, |
| 19 | + discoverAuthorizationServerMetadata, |
| 20 | + discoverOAuthMetadata, |
| 21 | + discoverOAuthProtectedResourceMetadata, |
| 22 | + discoverOAuthServerInfo, |
| 23 | + exchangeAuthorization, |
| 24 | + extractResourceMetadataUrl, |
| 25 | + extractWWWAuthenticateParams, |
| 26 | + fetchToken, |
| 27 | + isHttpsUrl, |
| 28 | + parseErrorResponse, |
| 29 | + prepareAuthorizationCodeRequest, |
| 30 | + refreshAuthorization, |
| 31 | + registerClient, |
| 32 | + selectClientAuthMethod, |
| 33 | + selectResourceURL, |
| 34 | + startAuthorization, |
| 35 | + UnauthorizedError |
| 36 | +} from './client/auth.js'; |
| 37 | +export type { |
| 38 | + AssertionCallback, |
| 39 | + ClientCredentialsProviderOptions, |
| 40 | + CrossAppAccessContext, |
| 41 | + CrossAppAccessProviderOptions, |
| 42 | + PrivateKeyJwtProviderOptions, |
| 43 | + StaticPrivateKeyJwtProviderOptions |
| 44 | +} from './client/authExtensions.js'; |
| 45 | +export { |
| 46 | + ClientCredentialsProvider, |
| 47 | + createPrivateKeyJwtAuth, |
| 48 | + CrossAppAccessProvider, |
| 49 | + PrivateKeyJwtProvider, |
| 50 | + StaticPrivateKeyJwtProvider |
| 51 | +} from './client/authExtensions.js'; |
| 52 | +export type { ClientOptions } from './client/client.js'; |
| 53 | +export { Client } from './client/client.js'; |
| 54 | +export { getSupportedElicitationModes } from './client/client.js'; |
| 55 | +export type { DiscoverAndRequestJwtAuthGrantOptions, JwtAuthGrantResult, RequestJwtAuthGrantOptions } from './client/crossAppAccess.js'; |
| 56 | +export { discoverAndRequestJwtAuthGrant, exchangeJwtAuthGrant, requestJwtAuthorizationGrant } from './client/crossAppAccess.js'; |
| 57 | +export type { LoggingOptions, Middleware, RequestLogger } from './client/middleware.js'; |
| 58 | +export { applyMiddlewares, createMiddleware, withLogging, withOAuth } from './client/middleware.js'; |
| 59 | +export type { SSEClientTransportOptions } from './client/sse.js'; |
| 60 | +export { SSEClientTransport, SseError } from './client/sse.js'; |
| 61 | +export type { |
| 62 | + ReconnectionScheduler, |
| 63 | + StartSSEOptions, |
| 64 | + StreamableHTTPClientTransportOptions, |
| 65 | + StreamableHTTPReconnectionOptions |
| 66 | +} from './client/streamableHttp.js'; |
| 67 | +export { StreamableHTTPClientTransport } from './client/streamableHttp.js'; |
| 68 | + |
| 69 | +// stdio: stubbed for browser / Cloudflare Workers — throws on use |
| 70 | +export type { StdioServerParameters } from './stdioStub.js'; |
| 71 | +export { DEFAULT_INHERITED_ENV_VARS, getDefaultEnvironment, StdioClientTransport } from './stdioStub.js'; |
| 72 | + |
| 73 | +// experimental exports |
| 74 | +export { ExperimentalClientTasks } from './experimental/tasks/client.js'; |
| 75 | + |
| 76 | +// runtime-aware wrapper (shadows core/public's fromJsonSchema with optional validator) |
| 77 | +export { fromJsonSchema } from './fromJsonSchema.js'; |
| 78 | + |
| 79 | +// re-export curated public API from core |
| 80 | +export * from '@modelcontextprotocol/core/public'; |
0 commit comments