@prefecthq/fastmcp-ts 1.2.1 → 1.3.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/dist/cli/index.cjs +3 -3
- package/dist/server.d.ts +312 -4
- package/dist/server.js +1622 -28
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -1172,7 +1172,7 @@ var init_version = __esm({
|
|
|
1172
1172
|
async run({ args }) {
|
|
1173
1173
|
if (args.json) setJsonMode(true);
|
|
1174
1174
|
const data = {
|
|
1175
|
-
fastmcp: "1.
|
|
1175
|
+
fastmcp: "1.3.0",
|
|
1176
1176
|
"mcp-sdk": "2.0.0",
|
|
1177
1177
|
node: process.version,
|
|
1178
1178
|
platform: `${process.platform} ${process.arch}`
|
|
@@ -33404,7 +33404,7 @@ var init_inspect = __esm({
|
|
|
33404
33404
|
// only case Python's inspect supports); over --url/--command the
|
|
33405
33405
|
// generation is unknowable from the wire.
|
|
33406
33406
|
generation: mode.kind === "inprocess" ? 2 : null,
|
|
33407
|
-
fastmcpVersion: "1.
|
|
33407
|
+
fastmcpVersion: "1.3.0",
|
|
33408
33408
|
mcpVersion: "2.0.0",
|
|
33409
33409
|
tools: tools2,
|
|
33410
33410
|
prompts: prompts2,
|
|
@@ -46908,7 +46908,7 @@ init_format();
|
|
|
46908
46908
|
var main = defineCommand({
|
|
46909
46909
|
meta: {
|
|
46910
46910
|
name: "fastmcp",
|
|
46911
|
-
version: "1.
|
|
46911
|
+
version: "1.3.0",
|
|
46912
46912
|
description: "FastMCP CLI \u2014 build, run, and manage MCP servers"
|
|
46913
46913
|
},
|
|
46914
46914
|
args: {
|
package/dist/server.d.ts
CHANGED
|
@@ -6,6 +6,56 @@ import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
|
6
6
|
import { Readable, Writable } from 'node:stream';
|
|
7
7
|
import { Response as Response$1 } from 'express';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Read-only, per-request snapshot of the HTTP request that carried the current
|
|
11
|
+
* MCP message. Present wherever the server is reached over an HTTP transport;
|
|
12
|
+
* `undefined` on stdio.
|
|
13
|
+
*
|
|
14
|
+
* REDACTION: credential headers (see {@link DEFAULT_SENSITIVE_HEADERS}, tuned
|
|
15
|
+
* by `FastMCPOptions.http`) are withheld from `headers` and listed in
|
|
16
|
+
* `redactedHeaderNames`, so a `null` lookup is never silent. The redaction
|
|
17
|
+
* guards accidental egress: tool results and logs flow into model context by
|
|
18
|
+
* design. A `RequestVerifier` receives the FULL wire headers instead (its
|
|
19
|
+
* `redactedHeaderNames` is empty): the verifier is the credential-handling
|
|
20
|
+
* code.
|
|
21
|
+
*
|
|
22
|
+
* TRUST: every value here is client-controlled input. Nothing in this object
|
|
23
|
+
* is authenticated. Do not derive authorization from it in handlers. For
|
|
24
|
+
* header-established identity (trusted reverse proxy), configure
|
|
25
|
+
* `FastMCPOptions.auth` with a `RequestVerifier` so identity flows through
|
|
26
|
+
* `ctx.auth` like every other authenticated request. See docs:
|
|
27
|
+
* servers/auth/trusted-proxy.
|
|
28
|
+
*/
|
|
29
|
+
interface HttpRequestContext {
|
|
30
|
+
/** Headers of the carrying HTTP request, minus the sensitive set. A per-request copy; mutations affect nothing. */
|
|
31
|
+
readonly headers: Headers;
|
|
32
|
+
/** Names (lowercase, sorted) that were present on the wire but withheld from `headers`. */
|
|
33
|
+
readonly redactedHeaderNames: readonly string[];
|
|
34
|
+
/** HTTP method of the carrying request (e.g. 'POST'). */
|
|
35
|
+
readonly method: string;
|
|
36
|
+
/**
|
|
37
|
+
* Origin-form request target (path + query, e.g. '/mcp?tenant=a'). Scheme and
|
|
38
|
+
* authority are deliberately absent: behind a proxy this server cannot know
|
|
39
|
+
* the external URL. Reconstruct it from your proxy's forwarded headers if you
|
|
40
|
+
* need it.
|
|
41
|
+
*/
|
|
42
|
+
readonly url: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Copy of `headers` that is safe to attach to an outbound request to another
|
|
46
|
+
* service. Drops credentials (authorization, cookie, proxy-*), hop-by-hop
|
|
47
|
+
* headers, message-framing headers (host, content-length, content-type,
|
|
48
|
+
* expect), and every `mcp-*` protocol header. Deployment-specific credential
|
|
49
|
+
* headers are covered by `FastMCPOptions.http.redactHeaders`: they are already
|
|
50
|
+
* absent from `ctx.http.headers`. `include` re-admits specific names.
|
|
51
|
+
* Re-admitting 'authorization' forwards the caller's credential; the MCP spec
|
|
52
|
+
* forbids passing the inbound token to upstream APIs, so mint your own
|
|
53
|
+
* upstream credential instead.
|
|
54
|
+
*/
|
|
55
|
+
declare function forwardableHeaders(headers: Headers, options?: {
|
|
56
|
+
include?: string[];
|
|
57
|
+
}): Headers;
|
|
58
|
+
|
|
9
59
|
interface AccessToken {
|
|
10
60
|
/** The raw bearer token string. */
|
|
11
61
|
token: string;
|
|
@@ -21,6 +71,34 @@ interface AccessToken {
|
|
|
21
71
|
interface TokenVerifier {
|
|
22
72
|
verify(token: string): Promise<AccessToken>;
|
|
23
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Request-level verifier for HTTP deployments where identity does not arrive
|
|
76
|
+
* as a bearer token. The typical case is a trusted reverse proxy that
|
|
77
|
+
* authenticates the caller and forwards the resolved identity as request
|
|
78
|
+
* headers.
|
|
79
|
+
*
|
|
80
|
+
* Called once per HTTP request, before dispatch, with that request's own FULL
|
|
81
|
+
* wire headers (no redaction; `request.redactedHeaderNames` is empty here —
|
|
82
|
+
* the verifier is the credential-handling code). Return an AccessToken to
|
|
83
|
+
* admit the request. The result becomes `ctx.auth`, feeds per-item `auth`
|
|
84
|
+
* checks and list filtering, and its `token` (hashed) keys response-cache
|
|
85
|
+
* partitioning. `token` MUST therefore be a stable, non-empty, per-identity
|
|
86
|
+
* value, such as the verified user id. The server rejects an empty `token`
|
|
87
|
+
* with HTTP 500. Throw `AuthorizationError` to produce 403; any other throw
|
|
88
|
+
* produces 401.
|
|
89
|
+
*
|
|
90
|
+
* SECURITY: request headers are forgeable by anyone who can reach this server
|
|
91
|
+
* directly. Trust them only after verifying provenance: a shared secret the
|
|
92
|
+
* proxy injects, mTLS, or network isolation. Add your provenance-secret
|
|
93
|
+
* header to `FastMCPOptions.http.redactHeaders` so it never surfaces in
|
|
94
|
+
* `ctx.http`. See docs: servers/auth/trusted-proxy.
|
|
95
|
+
*
|
|
96
|
+
* HTTP transports only. On stdio there is no HTTP request; configure a
|
|
97
|
+
* TokenVerifier if you need `FASTMCP_CLI_AUTH_TOKEN` support.
|
|
98
|
+
*/
|
|
99
|
+
interface RequestVerifier {
|
|
100
|
+
verifyRequest(request: HttpRequestContext): Promise<AccessToken>;
|
|
101
|
+
}
|
|
24
102
|
/**
|
|
25
103
|
* Thrown by authorization checks to produce a 403 response.
|
|
26
104
|
* Any other error thrown during verification produces a 401.
|
|
@@ -225,6 +303,16 @@ interface McpContext {
|
|
|
225
303
|
auth: AccessToken | undefined;
|
|
226
304
|
/** The MCP request ID for the current call. */
|
|
227
305
|
requestId: string | undefined;
|
|
306
|
+
/**
|
|
307
|
+
* The HTTP request carrying the current MCP message, when serving over an
|
|
308
|
+
* HTTP transport; `undefined` on stdio. Fresh per request: on a sessionful
|
|
309
|
+
* connection each request's own headers appear here, never the
|
|
310
|
+
* initialize-time ones. Credential headers are withheld by default and
|
|
311
|
+
* listed in `http.redactedHeaderNames` (tune with `FastMCPOptions.http`).
|
|
312
|
+
* Untrusted input; see HttpRequestContext's docs before deriving any
|
|
313
|
+
* authorization from it.
|
|
314
|
+
*/
|
|
315
|
+
http: HttpRequestContext | undefined;
|
|
228
316
|
/** Send a log message to the client at the specified RFC 5424 severity level. */
|
|
229
317
|
log(level: LogLevel, message: string, loggerName?: string): Promise<void>;
|
|
230
318
|
debug(message: string, loggerName?: string): Promise<void>;
|
|
@@ -642,7 +730,7 @@ interface ResourceConfig {
|
|
|
642
730
|
/** Arbitrary tags for server-side filtering. */
|
|
643
731
|
tags?: string[];
|
|
644
732
|
auth?: AuthCheck;
|
|
645
|
-
/** Apps extension metadata. Included
|
|
733
|
+
/** Apps extension metadata. Included as `_meta.ui` on resources/list entries and on every resources/read content item for UI-capable clients. */
|
|
646
734
|
ui?: ResourceUiMeta;
|
|
647
735
|
/**
|
|
648
736
|
* Autocompletion callbacks for this resource template's RFC 6570 variables,
|
|
@@ -663,12 +751,14 @@ declare class ResourceResult {
|
|
|
663
751
|
mimeType?: string;
|
|
664
752
|
text?: string;
|
|
665
753
|
blob?: string;
|
|
754
|
+
_meta?: Record<string, unknown>;
|
|
666
755
|
}>;
|
|
667
756
|
constructor(contents: Array<{
|
|
668
757
|
uri: string;
|
|
669
758
|
mimeType?: string;
|
|
670
759
|
text?: string;
|
|
671
760
|
blob?: string;
|
|
761
|
+
_meta?: Record<string, unknown>;
|
|
672
762
|
}>);
|
|
673
763
|
}
|
|
674
764
|
|
|
@@ -688,10 +778,30 @@ interface OAuthConfig {
|
|
|
688
778
|
interface FastMCPOptions {
|
|
689
779
|
name: string;
|
|
690
780
|
version?: string;
|
|
691
|
-
/**
|
|
692
|
-
|
|
781
|
+
/**
|
|
782
|
+
* Bearer-token verifier, or a RequestVerifier for header-based
|
|
783
|
+
* (trusted-proxy) deployments. See each type's docs. A RequestVerifier
|
|
784
|
+
* applies to HTTP transports only; stdio's FASTMCP_CLI_AUTH_TOKEN needs a
|
|
785
|
+
* TokenVerifier. When both `oauth` and `auth` are set, `oauth` serves the
|
|
786
|
+
* endpoint and `auth` is ignored.
|
|
787
|
+
*/
|
|
788
|
+
auth?: TokenVerifier | RequestVerifier;
|
|
693
789
|
/** Full OAuth 2.1 server with Dynamic Client Registration support. */
|
|
694
790
|
oauth?: OAuthConfig;
|
|
791
|
+
/**
|
|
792
|
+
* HTTP request context tuning for `ctx.http`. `redactHeaders` adds names to
|
|
793
|
+
* the sensitive set withheld from `ctx.http.headers` (defaults:
|
|
794
|
+
* authorization, cookie, proxy-authorization, mcp-session-id); use it for
|
|
795
|
+
* deployment-specific credentials such as a proxy shared-secret header.
|
|
796
|
+
* `exposeHeaders` removes names from the set; it is the explicit, greppable
|
|
797
|
+
* opt-out. Withheld names are listed in `ctx.http.redactedHeaderNames`.
|
|
798
|
+
* Redaction applies to `ctx.http` only; a RequestVerifier always sees the
|
|
799
|
+
* full wire headers.
|
|
800
|
+
*/
|
|
801
|
+
http?: {
|
|
802
|
+
redactHeaders?: string[];
|
|
803
|
+
exposeHeaders?: string[];
|
|
804
|
+
};
|
|
695
805
|
/** Maximum number of tools returned per listTools page. Default: 50. */
|
|
696
806
|
toolsPageSize?: number;
|
|
697
807
|
/** Maximum number of resources (or templates) returned per page. Default: 50. */
|
|
@@ -853,6 +963,7 @@ declare class FastMCP {
|
|
|
853
963
|
readonly version: string;
|
|
854
964
|
private _auth;
|
|
855
965
|
private _oauth;
|
|
966
|
+
private _sensitiveHeaders;
|
|
856
967
|
private _toolsPageSize;
|
|
857
968
|
private _resourcesPageSize;
|
|
858
969
|
private _tools;
|
|
@@ -1307,6 +1418,203 @@ type ProxyTransport = StdioTransport | HttpTransport;
|
|
|
1307
1418
|
*/
|
|
1308
1419
|
declare function createProxy(config: ProxyTransport, name?: string): Promise<FastMCP>;
|
|
1309
1420
|
|
|
1421
|
+
/**
|
|
1422
|
+
* Shared types for the OpenAPI integration.
|
|
1423
|
+
*
|
|
1424
|
+
* The intermediate representation (HTTPRoute and friends) is a direct port of
|
|
1425
|
+
* Python FastMCP's `fastmcp.utilities.openapi.models` so the two
|
|
1426
|
+
* implementations generate identical MCP components from the same spec. The
|
|
1427
|
+
* parity contract is pinned by the snapshots in `tests/fixtures/openapi/`.
|
|
1428
|
+
*/
|
|
1429
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD' | 'TRACE';
|
|
1430
|
+
type ParameterLocation = 'path' | 'query' | 'header' | 'cookie';
|
|
1431
|
+
type JsonSchema = Record<string, unknown>;
|
|
1432
|
+
/** A single parameter of an HTTP operation. */
|
|
1433
|
+
interface ParameterInfo {
|
|
1434
|
+
name: string;
|
|
1435
|
+
location: ParameterLocation;
|
|
1436
|
+
required: boolean;
|
|
1437
|
+
schema: JsonSchema;
|
|
1438
|
+
description?: string;
|
|
1439
|
+
/** OpenAPI explode property for array/object serialization. */
|
|
1440
|
+
explode?: boolean;
|
|
1441
|
+
/** OpenAPI style property (form, spaceDelimited, pipeDelimited, deepObject, ...). */
|
|
1442
|
+
style?: string;
|
|
1443
|
+
}
|
|
1444
|
+
/** The request body of an HTTP operation, keyed by media type. */
|
|
1445
|
+
interface RequestBodyInfo {
|
|
1446
|
+
required: boolean;
|
|
1447
|
+
contentSchema: Record<string, JsonSchema>;
|
|
1448
|
+
description?: string;
|
|
1449
|
+
}
|
|
1450
|
+
/** The primary success response of an HTTP operation, keyed by media type. */
|
|
1451
|
+
interface ResponseInfo {
|
|
1452
|
+
description?: string;
|
|
1453
|
+
contentSchema: Record<string, JsonSchema>;
|
|
1454
|
+
}
|
|
1455
|
+
/** Where a flattened tool argument goes when the HTTP request is built. */
|
|
1456
|
+
interface ParameterMapping {
|
|
1457
|
+
location: ParameterLocation | 'body';
|
|
1458
|
+
openapiName: string;
|
|
1459
|
+
}
|
|
1460
|
+
/** Intermediate representation of a single OpenAPI operation. */
|
|
1461
|
+
interface HTTPRoute {
|
|
1462
|
+
path: string;
|
|
1463
|
+
method: HttpMethod;
|
|
1464
|
+
operationId?: string;
|
|
1465
|
+
summary?: string;
|
|
1466
|
+
description?: string;
|
|
1467
|
+
tags: string[];
|
|
1468
|
+
parameters: ParameterInfo[];
|
|
1469
|
+
requestBody?: RequestBodyInfo;
|
|
1470
|
+
/** Only the primary success response, keyed by its status code string. */
|
|
1471
|
+
responses: Record<string, ResponseInfo>;
|
|
1472
|
+
/** Schema definitions needed by the input (parameters + request body). */
|
|
1473
|
+
requestSchemas: Record<string, JsonSchema>;
|
|
1474
|
+
/** Schema definitions needed by the output (responses). */
|
|
1475
|
+
responseSchemas: Record<string, JsonSchema>;
|
|
1476
|
+
/** `x-` extension fields found on the operation. */
|
|
1477
|
+
extensions: Record<string, unknown>;
|
|
1478
|
+
openapiVersion?: string;
|
|
1479
|
+
/** Pre-calculated flat input schema advertised on the MCP tool. */
|
|
1480
|
+
flatParamSchema: JsonSchema;
|
|
1481
|
+
/** Maps flat argument names back to their OpenAPI locations. */
|
|
1482
|
+
parameterMap: Record<string, ParameterMapping>;
|
|
1483
|
+
}
|
|
1484
|
+
/** Type of FastMCP component to create from a route. */
|
|
1485
|
+
type MCPType = 'tool' | 'resource' | 'resourceTemplate' | 'exclude';
|
|
1486
|
+
/** Mapping rule from HTTP routes to FastMCP component types. */
|
|
1487
|
+
interface RouteMap {
|
|
1488
|
+
/** HTTP methods to match. `'*'` (default) matches every method. */
|
|
1489
|
+
methods?: HttpMethod[] | '*';
|
|
1490
|
+
/** Pattern searched (unanchored) against the route path. Default matches all. */
|
|
1491
|
+
pattern?: RegExp | string;
|
|
1492
|
+
/** Tags that must ALL be present on the route for the map to match. */
|
|
1493
|
+
tags?: string[];
|
|
1494
|
+
/** The component type to create for matching routes. */
|
|
1495
|
+
mcpType: MCPType;
|
|
1496
|
+
/** Extra tags applied to components created by this map. */
|
|
1497
|
+
mcpTags?: string[];
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* Advanced route-type hook, run after the route maps on every non-excluded
|
|
1501
|
+
* route. Return a new MCPType to override, or null/undefined to keep the
|
|
1502
|
+
* mapped type. Exceptions are swallowed with a warning.
|
|
1503
|
+
*/
|
|
1504
|
+
type RouteMapFn = (route: HTTPRoute, mcpType: MCPType) => MCPType | null | undefined;
|
|
1505
|
+
/** Mutable pre-registration view of a generated tool. */
|
|
1506
|
+
interface OpenAPIToolComponent {
|
|
1507
|
+
kind: 'tool';
|
|
1508
|
+
name: string;
|
|
1509
|
+
description: string;
|
|
1510
|
+
inputSchema: JsonSchema;
|
|
1511
|
+
outputSchema?: JsonSchema;
|
|
1512
|
+
tags: string[];
|
|
1513
|
+
}
|
|
1514
|
+
/** Mutable pre-registration view of a generated resource. */
|
|
1515
|
+
interface OpenAPIResourceComponent {
|
|
1516
|
+
kind: 'resource';
|
|
1517
|
+
uri: string;
|
|
1518
|
+
name: string;
|
|
1519
|
+
description: string;
|
|
1520
|
+
mimeType: string;
|
|
1521
|
+
tags: string[];
|
|
1522
|
+
}
|
|
1523
|
+
/** Mutable pre-registration view of a generated resource template. */
|
|
1524
|
+
interface OpenAPIResourceTemplateComponent {
|
|
1525
|
+
kind: 'resourceTemplate';
|
|
1526
|
+
uriTemplate: string;
|
|
1527
|
+
name: string;
|
|
1528
|
+
description: string;
|
|
1529
|
+
mimeType: string;
|
|
1530
|
+
parameters: JsonSchema;
|
|
1531
|
+
tags: string[];
|
|
1532
|
+
}
|
|
1533
|
+
type OpenAPIComponent = OpenAPIToolComponent | OpenAPIResourceComponent | OpenAPIResourceTemplateComponent;
|
|
1534
|
+
/**
|
|
1535
|
+
* Component customization hook, called with each generated component before
|
|
1536
|
+
* registration. Mutate the component in place (rename, edit description,
|
|
1537
|
+
* adjust tags or schemas). Exceptions are swallowed with a warning.
|
|
1538
|
+
*/
|
|
1539
|
+
type ComponentFn = (route: HTTPRoute, component: OpenAPIComponent) => void;
|
|
1540
|
+
|
|
1541
|
+
/**
|
|
1542
|
+
* HTTP execution for generated components.
|
|
1543
|
+
*
|
|
1544
|
+
* Port of Python FastMCP's `OpenAPITool.run` / `OpenAPIResource.read`
|
|
1545
|
+
* (`fastmcp.server.providers.openapi.components`): bare fetch with a timeout,
|
|
1546
|
+
* Python-compatible error messages (they surface as tool errors, so clients
|
|
1547
|
+
* may match on them), JSON responses as structuredContent with the
|
|
1548
|
+
* `x-fastmcp-wrap-result` unwrap applied, non-JSON as text.
|
|
1549
|
+
*/
|
|
1550
|
+
|
|
1551
|
+
/** HTTP client configuration for a generated OpenAPI server. */
|
|
1552
|
+
interface OpenAPIClientOptions {
|
|
1553
|
+
/**
|
|
1554
|
+
* Base URL for requests. Defaults to the spec's first `servers` entry
|
|
1555
|
+
* (with server variables filled from their defaults). Required when the
|
|
1556
|
+
* spec has no absolute server URL.
|
|
1557
|
+
*/
|
|
1558
|
+
baseUrl?: string;
|
|
1559
|
+
/** Default headers sent on every request. Request-specific headers win. */
|
|
1560
|
+
headers?: Record<string, string>;
|
|
1561
|
+
/** Async header provider, resolved per request (e.g. a token refresher). */
|
|
1562
|
+
auth?: {
|
|
1563
|
+
getHeaders(): Promise<Record<string, string>>;
|
|
1564
|
+
};
|
|
1565
|
+
/** Custom fetch implementation. Defaults to the global fetch. */
|
|
1566
|
+
fetch?: typeof globalThis.fetch;
|
|
1567
|
+
/** Per-request timeout in milliseconds. Default 30 000. */
|
|
1568
|
+
timeoutMs?: number;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
/**
|
|
1572
|
+
* createOpenAPIServer: build a FastMCP server from an OpenAPI 3.x spec.
|
|
1573
|
+
*
|
|
1574
|
+
* TypeScript port of Python FastMCP's `FastMCP.from_openapi` /
|
|
1575
|
+
* `OpenAPIProvider`. Components are generated eagerly: parse the spec into
|
|
1576
|
+
* routes, map each route to a component type, name it, derive its schemas,
|
|
1577
|
+
* and register it on a plain FastMCP with a forwarding handler that calls the
|
|
1578
|
+
* described HTTP API. Generated names and schemas match the Python
|
|
1579
|
+
* implementation byte for byte; the snapshots under `tests/fixtures/openapi/`
|
|
1580
|
+
* pin that contract.
|
|
1581
|
+
*/
|
|
1582
|
+
|
|
1583
|
+
interface OpenAPIServerOptions {
|
|
1584
|
+
/** The OpenAPI 3.0/3.1 spec: a parsed object, or YAML/JSON text. */
|
|
1585
|
+
spec: Record<string, unknown> | string;
|
|
1586
|
+
/** Server name. Default 'OpenAPI Server'. */
|
|
1587
|
+
name?: string;
|
|
1588
|
+
/** Server version. Defaults to FastMCP's own default. */
|
|
1589
|
+
version?: string;
|
|
1590
|
+
/** HTTP client configuration (base URL, headers, auth, fetch, timeout). */
|
|
1591
|
+
client?: OpenAPIClientOptions;
|
|
1592
|
+
/** Route maps checked in order before the default (everything → tool). */
|
|
1593
|
+
routeMaps?: RouteMap[];
|
|
1594
|
+
/** Route-type hook, run after the route maps on every route. */
|
|
1595
|
+
routeMapFn?: RouteMapFn;
|
|
1596
|
+
/** Component customization hook, called before each registration. */
|
|
1597
|
+
componentFn?: ComponentFn;
|
|
1598
|
+
/** Overrides mapping operationId → component name. */
|
|
1599
|
+
names?: Record<string, string>;
|
|
1600
|
+
/** Tags added to every generated component. */
|
|
1601
|
+
tags?: string[];
|
|
1602
|
+
/**
|
|
1603
|
+
* When true (default), tools advertise the output schema extracted from
|
|
1604
|
+
* the spec. When false, a permissive schema is advertised instead (the
|
|
1605
|
+
* wrap-result marker is preserved).
|
|
1606
|
+
*/
|
|
1607
|
+
validateOutput?: boolean;
|
|
1608
|
+
/** Remaining FastMCP options (auth, middleware, page sizes, ...). */
|
|
1609
|
+
serverOptions?: Omit<FastMCPOptions, 'name' | 'version'>;
|
|
1610
|
+
}
|
|
1611
|
+
/**
|
|
1612
|
+
* Create a FastMCP server from an OpenAPI 3.0/3.1 specification. Every
|
|
1613
|
+
* operation becomes an MCP component (tool by default; see `routeMaps`)
|
|
1614
|
+
* whose handler calls the described HTTP endpoint.
|
|
1615
|
+
*/
|
|
1616
|
+
declare function createOpenAPIServer(options: OpenAPIServerOptions): FastMCP;
|
|
1617
|
+
|
|
1310
1618
|
interface Component {
|
|
1311
1619
|
type: string;
|
|
1312
1620
|
props?: Record<string, unknown>;
|
|
@@ -1445,4 +1753,4 @@ declare class FormInput {
|
|
|
1445
1753
|
constructor(options: FormInputOptions);
|
|
1446
1754
|
}
|
|
1447
1755
|
|
|
1448
|
-
export { type AccessToken, Approval, Area, type AuthCheck, AuthorizationError, type BackendToolConfig, Badge, Bar, type BrowserPermissions, Button, type CacheKeyFn, CachingMiddleware, CancellationMiddleware, type CatalogEntry, Choice, Column, type CompleteCallback, type CompletionContext, type CompletionResult, type Component, type CspPolicy, type ElicitationResult, type ElicitationSchema, type EntrypointConfig, ErrorNormalizationMiddleware, FastMCP, FastMCPApp, type FastMCPAppOptions, type FastMCPOptions, File, type FileHandle, type FileStorageAdapter, FileUpload, type FileUploadOptions, FilterTransform, ForEach, FormInput, type FormInputOptions, GenerativeUI, Grid, If, type IfNode, Image, Input, Line, type LogLevel, LoggingMiddleware, type McpContext, type Middleware, type MiddlewareContext, NamespaceTransform, type Next, type OAuthConfig, type OAuthProviderOptions, type OAuthProxyOptions, Pie, type PromptArgument, type PromptConfig, type PromptContent, type PromptMessage, PromptResult, type PromptView, PromptsAsTools, type ProxyTransport, RateLimitingMiddleware, type ResourceAnnotations, type ResourceConfig, ResourceResult, type ResourceUiMeta, type ResourceView, ResourcesAsTools, type Root, Row, type RunOptions, Rx, type SamplingMessage, type SamplingParams, type SamplingResult, Select, type ServerAddress, SizeLimitingMiddleware, type SynthesizedTool, Table, Text, type TokenVerifier, type ToolConfig, ToolResult, type ToolView, type Transform, type UiToolMeta, VersionFilter, type Visibility, actionRef, createProxy, debugTokenVerifier, introspectionVerifier, jwtVerifier, multiAuth, oauthProvider, oauthProxy, redescribeTool, renameTool, requireScopes, staticTokenVerifier };
|
|
1756
|
+
export { type AccessToken, Approval, Area, type AuthCheck, AuthorizationError, type BackendToolConfig, Badge, Bar, type BrowserPermissions, Button, type CacheKeyFn, CachingMiddleware, CancellationMiddleware, type CatalogEntry, Choice, Column, type CompleteCallback, type CompletionContext, type CompletionResult, type Component, type ComponentFn, type CspPolicy, type ElicitationResult, type ElicitationSchema, type EntrypointConfig, ErrorNormalizationMiddleware, FastMCP, FastMCPApp, type FastMCPAppOptions, type FastMCPOptions, File, type FileHandle, type FileStorageAdapter, FileUpload, type FileUploadOptions, FilterTransform, ForEach, FormInput, type FormInputOptions, GenerativeUI, Grid, type HTTPRoute, type HttpMethod, type HttpRequestContext, If, type IfNode, Image, Input, Line, type LogLevel, LoggingMiddleware, type MCPType, type McpContext, type Middleware, type MiddlewareContext, NamespaceTransform, type Next, type OAuthConfig, type OAuthProviderOptions, type OAuthProxyOptions, type OpenAPIClientOptions, type OpenAPIComponent, type OpenAPIResourceComponent, type OpenAPIResourceTemplateComponent, type OpenAPIServerOptions, type OpenAPIToolComponent, type ParameterInfo, Pie, type PromptArgument, type PromptConfig, type PromptContent, type PromptMessage, PromptResult, type PromptView, PromptsAsTools, type ProxyTransport, RateLimitingMiddleware, type RequestBodyInfo, type RequestVerifier, type ResourceAnnotations, type ResourceConfig, ResourceResult, type ResourceUiMeta, type ResourceView, ResourcesAsTools, type ResponseInfo, type Root, type RouteMap, type RouteMapFn, Row, type RunOptions, Rx, type SamplingMessage, type SamplingParams, type SamplingResult, Select, type ServerAddress, SizeLimitingMiddleware, type SynthesizedTool, Table, Text, type TokenVerifier, type ToolConfig, ToolResult, type ToolView, type Transform, type UiToolMeta, VersionFilter, type Visibility, actionRef, createOpenAPIServer, createProxy, debugTokenVerifier, forwardableHeaders, introspectionVerifier, jwtVerifier, multiAuth, oauthProvider, oauthProxy, redescribeTool, renameTool, requireScopes, staticTokenVerifier };
|