mcp-use 2.8.2 → 2.9.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/bin.js +1 -1
- package/dist/index-node.js +6 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -13
- package/dist/internal/usage.js +1 -1
- package/dist/mentions.d.ts +64 -0
- package/dist/server.d.ts +15 -1
- package/package.json +3 -3
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type MetaObject, type ResourceLink } from "@modelcontextprotocol/server";
|
|
2
|
+
import type { ToolDefinition } from "./tools.js";
|
|
3
|
+
/** Search text supplied by the composer; empty and whitespace queries are valid. */
|
|
4
|
+
export interface MentionSearchParams {
|
|
5
|
+
/** Application-owned search text, passed through without normalization. */
|
|
6
|
+
query: string;
|
|
7
|
+
}
|
|
8
|
+
/** App-owned resource identities suggested by a mention search. */
|
|
9
|
+
export interface MentionSearchResult {
|
|
10
|
+
/** Authorized links in application-defined order; an empty list means no matches. */
|
|
11
|
+
items: ResourceLink[];
|
|
12
|
+
}
|
|
13
|
+
/** Register an ordinary tool for native composer mention search. */
|
|
14
|
+
export interface MentionsRegistration<Ctx, Name extends string = string> {
|
|
15
|
+
/** Non-blank tool name, unique among existing registrations. */
|
|
16
|
+
name: Name;
|
|
17
|
+
/** Optional human-readable tool title. */
|
|
18
|
+
title?: string;
|
|
19
|
+
/** Optional explanation of the searchable items. */
|
|
20
|
+
description?: string;
|
|
21
|
+
/** Tool icons, resolved by the ordinary tool pipeline. */
|
|
22
|
+
icons?: NonNullable<ToolDefinition["icons"]>;
|
|
23
|
+
/** Tool annotations; search is read-only by default. */
|
|
24
|
+
annotations?: NonNullable<ToolDefinition["annotations"]>;
|
|
25
|
+
/** Descriptor metadata; unrelated UI and extension fields are preserved. */
|
|
26
|
+
_meta?: NonNullable<ToolDefinition["_meta"]>;
|
|
27
|
+
/** Explicit visibility; app visibility is always included. */
|
|
28
|
+
visibility?: NonNullable<ToolDefinition["visibility"]>;
|
|
29
|
+
/** Authorize, rank, and limit results using the ordinary request context and signal. */
|
|
30
|
+
search: (params: MentionSearchParams, ctx: Ctx) => MentionSearchResult | Promise<MentionSearchResult>;
|
|
31
|
+
}
|
|
32
|
+
/** Generate schemas and the owned mention marker without invoking search. @internal */
|
|
33
|
+
export declare function prepareMentions<Ctx, Name extends string>(options: MentionsRegistration<Ctx, Name>): {
|
|
34
|
+
/** Non-blank tool name, unique among existing registrations. */
|
|
35
|
+
name: Name;
|
|
36
|
+
/** Optional human-readable tool title. */
|
|
37
|
+
title?: string;
|
|
38
|
+
/** Optional explanation of the searchable items. */
|
|
39
|
+
description?: string;
|
|
40
|
+
/** Tool icons, resolved by the ordinary tool pipeline. */
|
|
41
|
+
icons?: NonNullable<ToolDefinition["icons"]>;
|
|
42
|
+
/** Explicit visibility; app visibility is always included. */
|
|
43
|
+
visibility?: NonNullable<ToolDefinition["visibility"]>;
|
|
44
|
+
inputSchema: import("@modelcontextprotocol/server").StandardSchemaWithJSON<{
|
|
45
|
+
query: string;
|
|
46
|
+
}, {
|
|
47
|
+
query: string;
|
|
48
|
+
}>;
|
|
49
|
+
outputSchema: import("@modelcontextprotocol/server").StandardSchemaWithJSON<MentionSearchResult, MentionSearchResult>;
|
|
50
|
+
annotations: {
|
|
51
|
+
title?: string | undefined;
|
|
52
|
+
destructiveHint?: boolean | undefined;
|
|
53
|
+
idempotentHint?: boolean | undefined;
|
|
54
|
+
openWorldHint?: boolean | undefined;
|
|
55
|
+
readOnlyHint: boolean | undefined;
|
|
56
|
+
};
|
|
57
|
+
_meta: {
|
|
58
|
+
"openai/extensions": {
|
|
59
|
+
"mentions/search": {};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
/** Restore mention visibility after ordinary view URI ownership is resolved. @internal */
|
|
64
|
+
export declare function finalizeMentionsMeta(definition: ToolDefinition, metadata: MetaObject | undefined): MetaObject;
|
package/dist/server.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ import { type ServerEventBus } from "@modelcontextprotocol/server";
|
|
|
2
2
|
import { Hono, type Env, type MiddlewareHandler } from "hono";
|
|
3
3
|
import { type ServerBranding } from "./branding.js";
|
|
4
4
|
import { type ServerConfig } from "./config.js";
|
|
5
|
-
import { type DefinitionSecuritySchemes, type ToolOAuthMode } from "./context.js";
|
|
5
|
+
import { type DefinitionSecuritySchemes, type RequestContext, type ToolOAuthMode } from "./context.js";
|
|
6
6
|
import { type McpEventListenerFnFor, type McpEventPattern, type McpMiddlewareFnFor, type McpMiddlewarePattern } from "./middleware/mcp-middleware.js";
|
|
7
7
|
import { type SettingsFields, type SettingsRegistration } from "./settings.js";
|
|
8
|
+
import { type MentionsRegistration, type MentionSearchParams, type MentionSearchResult } from "./mentions.js";
|
|
8
9
|
import type { FromOpenAPIOptions } from "./openapi/types.js";
|
|
9
10
|
import type { InferPromptInput, PromptCallback, PromptDefinition } from "./prompts.js";
|
|
10
11
|
import type { InferTemplateParams, ResourceCallback, ResourceDefinition, ResourceTemplateCallback, ResourceTemplateDefinition } from "./resources.js";
|
|
@@ -156,6 +157,19 @@ export declare class MCPServer<TUser = never, TEnv extends Env = Env> {
|
|
|
156
157
|
* or either tool name collides with an existing registration.
|
|
157
158
|
*/
|
|
158
159
|
settings<const Fields extends SettingsFields>(options: SettingsRegistration<Fields, TUser, HasOAuth<TUser>, TEnv>): void;
|
|
160
|
+
/**
|
|
161
|
+
* Register a composer mention search tool before startup.
|
|
162
|
+
*
|
|
163
|
+
* Search receives the ordinary request context, authentication defaults, and
|
|
164
|
+
* cancellation signal. Authorization, ranking, limits, and resource identity
|
|
165
|
+
* remain application-owned. Hosts may ignore the marker; explicit tool calls
|
|
166
|
+
* still work. App visibility is always included, without requiring a View.
|
|
167
|
+
*
|
|
168
|
+
* @param options - Tool descriptor and search callback returning resource links.
|
|
169
|
+
* @returns A normal tool reference with typed query input and link output.
|
|
170
|
+
* @throws When started, the name or callback is invalid, or the name collides.
|
|
171
|
+
*/
|
|
172
|
+
mentions<const Name extends string>(options: MentionsRegistration<RequestContext<TUser, HasOAuth<TUser>, TEnv>, Name>): ToolRef<Name, MentionSearchParams, MentionSearchResult>;
|
|
159
173
|
/**
|
|
160
174
|
* Prime the views registry from build/dev registry data.
|
|
161
175
|
*
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-use",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.9.0",
|
|
5
5
|
"description": "MCP framework and CLI built on the official v2 SDK",
|
|
6
6
|
"author": "mcp-use, Inc.",
|
|
7
7
|
"license": "MIT",
|
|
@@ -132,8 +132,8 @@
|
|
|
132
132
|
"@modelcontextprotocol/server": "2.3.1",
|
|
133
133
|
"hono": "^4.13.7",
|
|
134
134
|
"jose": "^6.1.3",
|
|
135
|
-
"@mcp-use/
|
|
136
|
-
"@mcp-use/
|
|
135
|
+
"@mcp-use/inspector": "20.3.19",
|
|
136
|
+
"@mcp-use/cli": "4.3.3"
|
|
137
137
|
},
|
|
138
138
|
"peerDependencies": {
|
|
139
139
|
"@mcp-use/client": "^2.0.1 || ^2.1.0 || ^2.1.1 || ^2.1.2 || ^2.1.3 || ^2.1.4 || ^2.1.5 || ^2.2.0 || ^2.2.1 || ^2.2.2 || ^2.2.3 || ^2.2.4 || ^2.2.5 || ^2.3.0 || ^2.3.1 || ^2.3.2 || ^2.3.3 || ^2.3.4 || ^2.3.5 || ^2.4.0 || ^2.4.1 || ^2.4.2",
|