@llmindset/hf-mcp 0.2.50 → 0.2.52
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/space/commands/discover.d.ts +6 -1
- package/dist/space/commands/discover.d.ts.map +1 -1
- package/dist/space/commands/discover.js +60 -87
- package/dist/space/commands/discover.js.map +1 -1
- package/dist/space/commands/dynamic-find.d.ts +3 -0
- package/dist/space/commands/dynamic-find.d.ts.map +1 -0
- package/dist/space/commands/dynamic-find.js +109 -0
- package/dist/space/commands/dynamic-find.js.map +1 -0
- package/dist/space/space-tool.d.ts +22 -10
- package/dist/space/space-tool.d.ts.map +1 -1
- package/dist/space/space-tool.js +93 -17
- package/dist/space/space-tool.js.map +1 -1
- package/dist/space/types.d.ts +22 -4
- package/dist/space/types.d.ts.map +1 -1
- package/dist/space/types.js +22 -4
- package/dist/space/types.js.map +1 -1
- package/package.json +1 -1
- package/src/space/commands/discover.ts +87 -123
- package/src/space/commands/dynamic-find.ts +156 -0
- package/src/space/space-tool.ts +126 -22
- package/src/space/types.ts +44 -5
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import type { ToolResult } from '../../types/tool-result.js';
|
|
2
|
-
export declare
|
|
2
|
+
export declare const DISCOVER_PROMPTS: {
|
|
3
|
+
RESULTS_HEADER: string;
|
|
4
|
+
NO_RESULTS: string;
|
|
5
|
+
FETCH_ERROR: (url: string, error: string) => string;
|
|
6
|
+
};
|
|
7
|
+
export declare function discoverSpaces(): Promise<ToolResult>;
|
|
3
8
|
//# sourceMappingURL=discover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../../src/space/commands/discover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../../src/space/commands/discover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAO7D,eAAO,MAAM,gBAAgB;;;uBAaT,MAAM,SAAS,MAAM,KAAG,MAAM;CACjD,CAAC;AAyDF,wBAAsB,cAAc,IAAI,OAAO,CAAC,UAAU,CAAC,CAyC1D"}
|
|
@@ -1,109 +1,82 @@
|
|
|
1
|
-
import { SpaceSearchTool } from '../../space-search.js';
|
|
2
1
|
import { escapeMarkdown } from '../../utilities.js';
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
TASK_HINTS: `Here are some examples of tasks that dynamic spaces can perform:
|
|
2
|
+
export const DISCOVER_PROMPTS = {
|
|
3
|
+
RESULTS_HEADER: `**Available Spaces:**
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
- Video Generation
|
|
9
|
-
- Text Generation
|
|
10
|
-
- Visual QA
|
|
11
|
-
- Language Translation
|
|
12
|
-
- Speech Synthesis
|
|
13
|
-
- 3D Modeling
|
|
14
|
-
- Object Detection
|
|
15
|
-
- Text Analysis
|
|
16
|
-
- Image Editing
|
|
17
|
-
- Code Generation
|
|
18
|
-
- Question Answering
|
|
19
|
-
- Data Visualization
|
|
20
|
-
- Voice Cloning
|
|
21
|
-
- Background Removal
|
|
22
|
-
- OCR
|
|
23
|
-
- Image Captioning
|
|
24
|
-
- Sentiment Analysis
|
|
25
|
-
- Music Generation
|
|
26
|
-
- Style Transfer
|
|
27
|
-
|
|
28
|
-
To discover MCP-enabled Spaces for a specific task, call this operation with a search query:
|
|
29
|
-
|
|
30
|
-
**Example:**
|
|
31
|
-
\`\`\`json
|
|
32
|
-
{
|
|
33
|
-
"operation": "discover",
|
|
34
|
-
"search_query": "image generation",
|
|
35
|
-
"limit": 10
|
|
36
|
-
}
|
|
37
|
-
\`\`\``,
|
|
38
|
-
RESULTS_HEADER: (query, showing, total) => {
|
|
39
|
-
const showingText = showing < total ? `Showing ${showing} of ${total} results` : `All ${showing} results`;
|
|
40
|
-
return `# MCP Space Discovery Results for "${query}" (${showingText})
|
|
41
|
-
|
|
42
|
-
These MCP-enabled Spaces can be invoked using the \`dynamic_space\` tool.
|
|
5
|
+
These spaces can be invoked using the \`dynamic_space\` tool.
|
|
43
6
|
Use \`"operation": "view_parameters"\` to inspect a space's parameters before invoking.
|
|
44
7
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Try:
|
|
50
|
-
- Broader search terms (e.g., "image generation" instead of specific model names)
|
|
51
|
-
- Task-focused queries (e.g., "text generation", "object detection")
|
|
52
|
-
- Different task categories (e.g., "video generation", "image classification")`,
|
|
8
|
+
`,
|
|
9
|
+
NO_RESULTS: `No spaces available in the configured list.`,
|
|
10
|
+
FETCH_ERROR: (url, error) => `Error fetching space list from ${url}: ${error}`,
|
|
53
11
|
};
|
|
54
|
-
|
|
55
|
-
|
|
12
|
+
function parseCsvContent(content) {
|
|
13
|
+
const lines = content.trim().split('\n');
|
|
14
|
+
const results = [];
|
|
15
|
+
for (const line of lines) {
|
|
16
|
+
if (!line.trim())
|
|
17
|
+
continue;
|
|
18
|
+
const match = line.match(/^([^,]+),([^,]+),"([^"]*)"$/) || line.match(/^([^,]+),([^,]+),(.*)$/);
|
|
19
|
+
if (match && match[1] && match[2] && match[3]) {
|
|
20
|
+
results.push({
|
|
21
|
+
id: match[1].trim(),
|
|
22
|
+
category: match[2].trim(),
|
|
23
|
+
description: match[3].trim(),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return results;
|
|
28
|
+
}
|
|
29
|
+
function formatDiscoverResults(results) {
|
|
30
|
+
if (results.length === 0) {
|
|
31
|
+
return DISCOVER_PROMPTS.NO_RESULTS;
|
|
32
|
+
}
|
|
33
|
+
let markdown = DISCOVER_PROMPTS.RESULTS_HEADER;
|
|
34
|
+
markdown += '| Space ID | Category | Description |\n';
|
|
35
|
+
markdown += '|----------|----------|-------------|\n';
|
|
36
|
+
for (const result of results) {
|
|
37
|
+
markdown +=
|
|
38
|
+
`| \`${escapeMarkdown(result.id)}\` ` +
|
|
39
|
+
`| ${escapeMarkdown(result.category)} ` +
|
|
40
|
+
`| ${escapeMarkdown(result.description)} |\n`;
|
|
41
|
+
}
|
|
42
|
+
return markdown;
|
|
43
|
+
}
|
|
44
|
+
export async function discoverSpaces() {
|
|
45
|
+
const url = process.env.DYNAMIC_SPACE_DATA;
|
|
46
|
+
if (!url) {
|
|
56
47
|
return {
|
|
57
|
-
formatted:
|
|
48
|
+
formatted: 'Error: DYNAMIC_SPACE_DATA environment variable is not set.',
|
|
58
49
|
totalResults: 0,
|
|
59
50
|
resultsShared: 0,
|
|
51
|
+
isError: true,
|
|
60
52
|
};
|
|
61
53
|
}
|
|
62
54
|
try {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
const response = await fetch(url);
|
|
56
|
+
if (!response.ok) {
|
|
57
|
+
return {
|
|
58
|
+
formatted: DISCOVER_PROMPTS.FETCH_ERROR(url, `HTTP ${response.status}`),
|
|
59
|
+
totalResults: 0,
|
|
60
|
+
resultsShared: 0,
|
|
61
|
+
isError: true,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const content = await response.text();
|
|
65
|
+
const results = parseCsvContent(content);
|
|
66
|
+
return {
|
|
67
|
+
formatted: formatDiscoverResults(results),
|
|
68
|
+
totalResults: results.length,
|
|
69
|
+
resultsShared: results.length,
|
|
70
|
+
};
|
|
66
71
|
}
|
|
67
72
|
catch (error) {
|
|
68
73
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
69
74
|
return {
|
|
70
|
-
formatted:
|
|
75
|
+
formatted: DISCOVER_PROMPTS.FETCH_ERROR(url, errorMessage),
|
|
71
76
|
totalResults: 0,
|
|
72
77
|
resultsShared: 0,
|
|
73
78
|
isError: true,
|
|
74
79
|
};
|
|
75
80
|
}
|
|
76
81
|
}
|
|
77
|
-
function formatDiscoverResults(query, results, totalCount) {
|
|
78
|
-
if (results.length === 0) {
|
|
79
|
-
return {
|
|
80
|
-
formatted: DISCOVER_PROMPTS.NO_RESULTS(query),
|
|
81
|
-
totalResults: 0,
|
|
82
|
-
resultsShared: 0,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
let markdown = DISCOVER_PROMPTS.RESULTS_HEADER(query, results.length, totalCount);
|
|
86
|
-
markdown += '| Space | Description | Space ID | Category | Likes | Trending | Relevance |\n';
|
|
87
|
-
markdown += '|-------|-------------|----------|----------|-------|----------|----------|\n';
|
|
88
|
-
for (const result of results) {
|
|
89
|
-
const title = result.title || 'Untitled';
|
|
90
|
-
const description = result.shortDescription || result.ai_short_description || 'No description';
|
|
91
|
-
const id = result.id || '';
|
|
92
|
-
const emoji = result.emoji ? escapeMarkdown(result.emoji) + ' ' : '';
|
|
93
|
-
const relevance = result.semanticRelevancyScore ? (result.semanticRelevancyScore * 100).toFixed(1) + '%' : 'N/A';
|
|
94
|
-
markdown +=
|
|
95
|
-
`| ${emoji}[${escapeMarkdown(title)}](https://hf.co/spaces/${id}) ` +
|
|
96
|
-
`| ${escapeMarkdown(description)} ` +
|
|
97
|
-
`| \`${escapeMarkdown(id)}\` ` +
|
|
98
|
-
`| \`${escapeMarkdown(result.ai_category ?? '-')}\` ` +
|
|
99
|
-
`| ${escapeMarkdown(result.likes?.toString() ?? '-')} ` +
|
|
100
|
-
`| ${escapeMarkdown(result.trendingScore?.toString() ?? '-')} ` +
|
|
101
|
-
`| ${relevance} |\n`;
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
formatted: markdown,
|
|
105
|
-
totalResults: totalCount,
|
|
106
|
-
resultsShared: results.length,
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
82
|
//# sourceMappingURL=discover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../../src/space/commands/discover.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"discover.js","sourceRoot":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7B,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,OAAO;YACN,SAAS,EAAE,gBAAgB,CAAC,WAAW,CAAC,GAAG,EAAE,YAAY,CAAC;YAC1D,YAAY,EAAE,CAAC;YACf,aAAa,EAAE,CAAC;YAChB,OAAO,EAAE,IAAI;SACb,CAAC;IACH,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-find.d.ts","sourceRoot":"","sources":["../../../src/space/commands/dynamic-find.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AA4E7D,wBAAsB,UAAU,CAC/B,WAAW,CAAC,EAAE,MAAM,EACpB,KAAK,GAAE,MAA8B,EACrC,OAAO,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,UAAU,CAAC,CA8BrB"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { SpaceSearchTool } from '../../space-search.js';
|
|
2
|
+
import { escapeMarkdown } from '../../utilities.js';
|
|
3
|
+
const DEFAULT_RESULTS_LIMIT = 10;
|
|
4
|
+
const FIND_PROMPTS = {
|
|
5
|
+
TASK_HINTS: `Here are some examples of tasks that dynamic spaces can perform:
|
|
6
|
+
|
|
7
|
+
- Image Generation
|
|
8
|
+
- Video Generation
|
|
9
|
+
- Text Generation
|
|
10
|
+
- Visual QA
|
|
11
|
+
- Language Translation
|
|
12
|
+
- Speech Synthesis
|
|
13
|
+
- 3D Modeling
|
|
14
|
+
- Object Detection
|
|
15
|
+
- Text Analysis
|
|
16
|
+
- Image Editing
|
|
17
|
+
- Code Generation
|
|
18
|
+
- Question Answering
|
|
19
|
+
- Data Visualization
|
|
20
|
+
- Voice Cloning
|
|
21
|
+
- Background Removal
|
|
22
|
+
- OCR
|
|
23
|
+
- Image Captioning
|
|
24
|
+
- Sentiment Analysis
|
|
25
|
+
- Music Generation
|
|
26
|
+
- Style Transfer
|
|
27
|
+
|
|
28
|
+
To find MCP-enabled Spaces for a specific task, call this operation with a search query:
|
|
29
|
+
|
|
30
|
+
**Example:**
|
|
31
|
+
\`\`\`json
|
|
32
|
+
{
|
|
33
|
+
"operation": "find",
|
|
34
|
+
"search_query": "image generation",
|
|
35
|
+
"limit": 10
|
|
36
|
+
}
|
|
37
|
+
\`\`\``,
|
|
38
|
+
RESULTS_HEADER: (query, showing, total) => {
|
|
39
|
+
const showingText = showing < total ? `Showing ${showing} of ${total} results` : `All ${showing} results`;
|
|
40
|
+
return `# MCP Space Find Results for "${query}" (${showingText})
|
|
41
|
+
|
|
42
|
+
These MCP-enabled Spaces can be invoked using the \`dynamic_space\` tool.
|
|
43
|
+
Use \`"operation": "view_parameters"\` to inspect a space's parameters before invoking.
|
|
44
|
+
|
|
45
|
+
`;
|
|
46
|
+
},
|
|
47
|
+
NO_RESULTS: (query) => `No MCP-enabled Spaces found for "${query}".
|
|
48
|
+
|
|
49
|
+
Try:
|
|
50
|
+
- Broader search terms (e.g., "image generation" instead of specific model names)
|
|
51
|
+
- Task-focused queries (e.g., "text generation", "object detection")
|
|
52
|
+
- Different task categories (e.g., "video generation", "image classification")`,
|
|
53
|
+
};
|
|
54
|
+
export async function findSpaces(searchQuery, limit = DEFAULT_RESULTS_LIMIT, hfToken) {
|
|
55
|
+
if (!searchQuery || searchQuery.trim() === '') {
|
|
56
|
+
return {
|
|
57
|
+
formatted: FIND_PROMPTS.TASK_HINTS,
|
|
58
|
+
totalResults: 0,
|
|
59
|
+
resultsShared: 0,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
const searchTool = new SpaceSearchTool(hfToken);
|
|
64
|
+
const { results, totalCount } = await searchTool.search(searchQuery, limit, true);
|
|
65
|
+
return formatFindResults(searchQuery, results, totalCount);
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
69
|
+
return {
|
|
70
|
+
formatted: `Error discovering spaces: ${errorMessage}`,
|
|
71
|
+
totalResults: 0,
|
|
72
|
+
resultsShared: 0,
|
|
73
|
+
isError: true,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function formatFindResults(query, results, totalCount) {
|
|
78
|
+
if (results.length === 0) {
|
|
79
|
+
return {
|
|
80
|
+
formatted: FIND_PROMPTS.NO_RESULTS(query),
|
|
81
|
+
totalResults: 0,
|
|
82
|
+
resultsShared: 0,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
let markdown = FIND_PROMPTS.RESULTS_HEADER(query, results.length, totalCount);
|
|
86
|
+
markdown += '| Space | Description | Space ID | Category | Likes | Trending | Relevance |\n';
|
|
87
|
+
markdown += '|-------|-------------|----------|----------|-------|----------|----------|\n';
|
|
88
|
+
for (const result of results) {
|
|
89
|
+
const title = result.title || 'Untitled';
|
|
90
|
+
const description = result.shortDescription || result.ai_short_description || 'No description';
|
|
91
|
+
const id = result.id || '';
|
|
92
|
+
const emoji = result.emoji ? escapeMarkdown(result.emoji) + ' ' : '';
|
|
93
|
+
const relevance = result.semanticRelevancyScore ? (result.semanticRelevancyScore * 100).toFixed(1) + '%' : 'N/A';
|
|
94
|
+
markdown +=
|
|
95
|
+
`| ${emoji}[${escapeMarkdown(title)}](https://hf.co/spaces/${id}) ` +
|
|
96
|
+
`| ${escapeMarkdown(description)} ` +
|
|
97
|
+
`| \`${escapeMarkdown(id)}\` ` +
|
|
98
|
+
`| \`${escapeMarkdown(result.ai_category ?? '-')}\` ` +
|
|
99
|
+
`| ${escapeMarkdown(result.likes?.toString() ?? '-')} ` +
|
|
100
|
+
`| ${escapeMarkdown(result.trendingScore?.toString() ?? '-')} ` +
|
|
101
|
+
`| ${relevance} |\n`;
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
formatted: markdown,
|
|
105
|
+
totalResults: totalCount,
|
|
106
|
+
resultsShared: results.length,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=dynamic-find.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-find.js","sourceRoot":"","sources":["../../../src/space/commands/dynamic-find.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAA0B,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAMjC,MAAM,YAAY,GAAG;IAEpB,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCN;IAGN,cAAc,EAAE,CAAC,KAAa,EAAE,OAAe,EAAE,KAAa,EAAE,EAAE;QACjE,MAAM,WAAW,GAAG,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,WAAW,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,OAAO,UAAU,CAAC;QAC1G,OAAO,iCAAiC,KAAK,MAAM,WAAW;;;;;CAK/D,CAAC;IACD,CAAC;IAGD,UAAU,EAAE,CAAC,KAAa,EAAE,EAAE,CAC7B,oCAAoC,KAAK;;;;;+EAKoC;CAC9E,CAAC;AAUF,MAAM,CAAC,KAAK,UAAU,UAAU,CAC/B,WAAoB,EACpB,QAAgB,qBAAqB,EACrC,OAAgB;IAGhB,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC/C,OAAO;YACN,SAAS,EAAE,YAAY,CAAC,UAAU;YAClC,YAAY,EAAE,CAAC;YACf,aAAa,EAAE,CAAC;SAChB,CAAC;IACH,CAAC;IAED,IAAI,CAAC;QAEJ,MAAM,UAAU,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;QAChD,MAAM,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CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACrE,MAAM,SAAS,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,sBAAsB,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;QAEjH,QAAQ;YACP,KAAK,KAAK,IAAI,cAAc,CAAC,KAAK,CAAC,0BAA0B,EAAE,IAAI;gBACnE,KAAK,cAAc,CAAC,WAAW,CAAC,GAAG;gBACnC,OAAO,cAAc,CAAC,EAAE,CAAC,KAAK;gBAC9B,OAAO,cAAc,CAAC,MAAM,CAAC,WAAW,IAAI,GAAG,CAAC,KAAK;gBACrD,KAAK,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,GAAG,CAAC,GAAG;gBACvD,KAAK,cAAc,CAAC,MAAM,CAAC,aAAa,EAAE,QAAQ,EAAE,IAAI,GAAG,CAAC,GAAG;gBAC/D,KAAK,SAAS,MAAM,CAAC;IACvB,CAAC;IAED,OAAO;QACN,SAAS,EAAE,QAAQ;QACnB,YAAY,EAAE,UAAU;QACxB,aAAa,EAAE,OAAO,CAAC,MAAM;KAC7B,CAAC;AACH,CAAC"}
|
|
@@ -1,32 +1,43 @@
|
|
|
1
1
|
import type { ToolResult } from '../types/tool-result.js';
|
|
2
2
|
import type { ServerNotification, ServerRequest } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
4
|
+
import type { z } from 'zod';
|
|
4
5
|
import { type SpaceArgs, type InvokeResult } from './types.js';
|
|
5
6
|
export * from './types.js';
|
|
7
|
+
export declare function getDynamicSpaceToolConfig(): {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
schema: z.ZodObject<z.ZodRawShape>;
|
|
11
|
+
annotations: {
|
|
12
|
+
title: string;
|
|
13
|
+
readOnlyHint: boolean;
|
|
14
|
+
openWorldHint: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
6
17
|
export declare const DYNAMIC_SPACE_TOOL_CONFIG: {
|
|
7
18
|
readonly name: "dynamic_space";
|
|
8
19
|
readonly description: string;
|
|
9
|
-
readonly schema:
|
|
10
|
-
operation:
|
|
11
|
-
space_name:
|
|
12
|
-
parameters:
|
|
13
|
-
search_query:
|
|
14
|
-
limit:
|
|
15
|
-
}, "strip",
|
|
20
|
+
readonly schema: z.ZodObject<{
|
|
21
|
+
operation: z.ZodOptional<z.ZodEnum<["find", "view_parameters", "invoke"]>>;
|
|
22
|
+
space_name: z.ZodOptional<z.ZodString>;
|
|
23
|
+
parameters: z.ZodOptional<z.ZodString>;
|
|
24
|
+
search_query: z.ZodOptional<z.ZodString>;
|
|
25
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
27
|
limit?: number | undefined;
|
|
17
28
|
parameters?: string | undefined;
|
|
18
|
-
operation?: "
|
|
29
|
+
operation?: "find" | "view_parameters" | "invoke" | undefined;
|
|
19
30
|
space_name?: string | undefined;
|
|
20
31
|
search_query?: string | undefined;
|
|
21
32
|
}, {
|
|
22
33
|
limit?: number | undefined;
|
|
23
34
|
parameters?: string | undefined;
|
|
24
|
-
operation?: "
|
|
35
|
+
operation?: "find" | "view_parameters" | "invoke" | undefined;
|
|
25
36
|
space_name?: string | undefined;
|
|
26
37
|
search_query?: string | undefined;
|
|
27
38
|
}>;
|
|
28
39
|
readonly annotations: {
|
|
29
|
-
readonly title: "Gradio
|
|
40
|
+
readonly title: "Dynamically use Gradio Applications";
|
|
30
41
|
readonly readOnlyHint: false;
|
|
31
42
|
readonly openWorldHint: true;
|
|
32
43
|
};
|
|
@@ -35,6 +46,7 @@ export declare class SpaceTool {
|
|
|
35
46
|
private hfToken?;
|
|
36
47
|
constructor(hfToken?: string);
|
|
37
48
|
execute(params: SpaceArgs, extra?: RequestHandlerExtra<ServerRequest, ServerNotification>): Promise<InvokeResult | ToolResult>;
|
|
49
|
+
private handleFind;
|
|
38
50
|
private handleDiscover;
|
|
39
51
|
private handleViewParameters;
|
|
40
52
|
private handleInvoke;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space-tool.d.ts","sourceRoot":"","sources":["../../src/space/space-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,
|
|
1
|
+
{"version":3,"file":"space-tool.d.ts","sourceRoot":"","sources":["../../src/space/space-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAEN,KAAK,SAAS,EACd,KAAK,YAAY,EAIjB,MAAM,YAAY,CAAC;AAOpB,cAAc,YAAY,CAAC;AAmJ3B,wBAAgB,yBAAyB,IAAI;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IACnC,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,OAAO,CAAC;QAAC,aAAa,EAAE,OAAO,CAAA;KAAE,CAAC;CAC9E,CAgBA;AAKD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAW5B,CAAC;AAKX,qBAAa,SAAS;IACrB,OAAO,CAAC,OAAO,CAAC,CAAS;gBAEb,OAAO,CAAC,EAAE,MAAM;IAStB,OAAO,CACZ,MAAM,EAAE,SAAS,EACjB,KAAK,CAAC,EAAE,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,GAC5D,OAAO,CAAC,YAAY,GAAG,UAAU,CAAC;YAgEvB,UAAU;YAOV,cAAc;YAOd,oBAAoB;YAyBpB,YAAY;CA+C1B"}
|
package/dist/space/space-tool.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { spaceArgsSchema,
|
|
1
|
+
import { spaceArgsSchema, isDynamicSpaceMode, getOperationNames, getSpaceArgsSchema, } from './types.js';
|
|
2
|
+
import { findSpaces } from './commands/dynamic-find.js';
|
|
2
3
|
import { discoverSpaces } from './commands/discover.js';
|
|
3
4
|
import { viewParameters } from './commands/view-parameters.js';
|
|
4
5
|
import { invokeSpace } from './commands/invoke.js';
|
|
5
6
|
export * from './types.js';
|
|
6
7
|
const USAGE_INSTRUCTIONS = `# Gradio Space Interaction
|
|
7
8
|
|
|
8
|
-
Dynamically interact with any Gradio MCP Space.
|
|
9
|
+
Dynamically interact with any Gradio MCP Space. Find spaces, view space parameter schemas, and invoke spaces.
|
|
9
10
|
|
|
10
11
|
## Supported Schema Types
|
|
11
12
|
|
|
@@ -16,17 +17,17 @@ Dynamically interact with any Gradio MCP Space. Discover dynamic spaces, view sp
|
|
|
16
17
|
- Shallow objects (one level deep)
|
|
17
18
|
- FileData (as URL strings)
|
|
18
19
|
|
|
19
|
-
To use spaces with complex schemas, add them from
|
|
20
|
+
To use spaces with complex schemas, add them from huggingface.co/settings/mcp.
|
|
20
21
|
|
|
21
22
|
## Available Operations
|
|
22
23
|
|
|
23
|
-
###
|
|
24
|
+
### Find
|
|
24
25
|
Find MCP-enabled Spaces for available for invocation based on task-focused or semantic searches.
|
|
25
26
|
|
|
26
27
|
**Example:**
|
|
27
28
|
\`\`\`json
|
|
28
29
|
{
|
|
29
|
-
"operation": "
|
|
30
|
+
"operation": "find",
|
|
30
31
|
"search_query": "image generation",
|
|
31
32
|
"limit": 10
|
|
32
33
|
}
|
|
@@ -57,7 +58,7 @@ Execute a space's first tool with provided parameters.
|
|
|
57
58
|
|
|
58
59
|
## Workflow
|
|
59
60
|
|
|
60
|
-
1. **
|
|
61
|
+
1. **Find Spaces** - Use \`find\` to find MCP-enabled spaces for your task
|
|
61
62
|
2. **Inspect Parameters** - Use \`view_parameters\` to see what a space accepts
|
|
62
63
|
3. **Invoke the Space** - Use \`invoke\` with the required parameters
|
|
63
64
|
|
|
@@ -76,13 +77,85 @@ For parameters that accept files (FileData types):
|
|
|
76
77
|
- Enum parameters show all allowed values in view_parameters
|
|
77
78
|
- Required parameters are clearly marked and validated
|
|
78
79
|
`;
|
|
80
|
+
const DYNAMIC_USAGE_INSTRUCTIONS = `# Gradio Space Interaction
|
|
81
|
+
|
|
82
|
+
Dynamically use Gradio MCP Spaces. Discover available spaces, view their parameter schemas, and invoke them. Use "discover" to find recommended spaces for tasks.
|
|
83
|
+
|
|
84
|
+
## Available Operations
|
|
85
|
+
|
|
86
|
+
### discover
|
|
87
|
+
List recommended spaces and their categories.
|
|
88
|
+
|
|
89
|
+
**Example:**
|
|
90
|
+
\`\`\`json
|
|
91
|
+
{
|
|
92
|
+
"operation": "discover"
|
|
93
|
+
}
|
|
94
|
+
\`\`\`
|
|
95
|
+
|
|
96
|
+
### view_parameters
|
|
97
|
+
Display the parameter schema for a space's first tool.
|
|
98
|
+
|
|
99
|
+
**Example:**
|
|
100
|
+
\`\`\`json
|
|
101
|
+
{
|
|
102
|
+
"operation": "view_parameters",
|
|
103
|
+
"space_name": "evalstate/FLUX1_schnell"
|
|
104
|
+
}
|
|
105
|
+
\`\`\`
|
|
106
|
+
|
|
107
|
+
### invoke
|
|
108
|
+
Execute a space's first tool with provided parameters.
|
|
109
|
+
|
|
110
|
+
**Example:**
|
|
111
|
+
\`\`\`json
|
|
112
|
+
{
|
|
113
|
+
"operation": "invoke",
|
|
114
|
+
"space_name": "evalstate/FLUX1_schnell",
|
|
115
|
+
"parameters": "{\\"prompt\\": \\"a cute cat\\", \\"num_steps\\": 4}"
|
|
116
|
+
}
|
|
117
|
+
\`\`\`
|
|
118
|
+
|
|
119
|
+
## Workflow
|
|
120
|
+
|
|
121
|
+
1. **Discover Spaces** - Use \`discover\` to see available spaces
|
|
122
|
+
2. **Inspect Parameters** - Use \`view_parameters\` to see what a space accepts
|
|
123
|
+
3. **Invoke the Space** - Use \`invoke\` with the required parameters
|
|
124
|
+
|
|
125
|
+
## File Handling
|
|
126
|
+
|
|
127
|
+
For parameters that accept files (FileData types):
|
|
128
|
+
- Provide a publicly accessible URL (http:// or https://)
|
|
129
|
+
- Example: \`{"image": "https://example.com/photo.jpg"}\`
|
|
130
|
+
- Output url's from one tool may be used as inputs to another.
|
|
131
|
+
`;
|
|
132
|
+
function getUsageInstructions() {
|
|
133
|
+
return isDynamicSpaceMode() ? DYNAMIC_USAGE_INSTRUCTIONS : USAGE_INSTRUCTIONS;
|
|
134
|
+
}
|
|
135
|
+
export function getDynamicSpaceToolConfig() {
|
|
136
|
+
const dynamicMode = isDynamicSpaceMode();
|
|
137
|
+
return {
|
|
138
|
+
name: 'dynamic_space',
|
|
139
|
+
description: dynamicMode
|
|
140
|
+
? 'Discover, inspect (view parameter schema) and dynamically invoke Gradio MCP Spaces to conduct ML Tasks including Image Generation, Background Removal, Text to Speech and more ' +
|
|
141
|
+
'Call with no operation for full usage instructions.'
|
|
142
|
+
: 'Find (semantic/task search), inspect (view parameter schema) and dynamically invoke Gradio MCP Spaces. ' +
|
|
143
|
+
'Call with no operation for full usage instructions.',
|
|
144
|
+
schema: getSpaceArgsSchema(),
|
|
145
|
+
annotations: {
|
|
146
|
+
title: 'Dynamically use Gradio Applications',
|
|
147
|
+
readOnlyHint: false,
|
|
148
|
+
openWorldHint: true,
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
}
|
|
79
152
|
export const DYNAMIC_SPACE_TOOL_CONFIG = {
|
|
80
153
|
name: 'dynamic_space',
|
|
81
|
-
description: '
|
|
154
|
+
description: 'Find (semantic/task search), inspect (view parameter schema) and dynamically invoke Gradio MCP Spaces. ' +
|
|
82
155
|
'Call with no operation for full usage instructions.',
|
|
83
156
|
schema: spaceArgsSchema,
|
|
84
157
|
annotations: {
|
|
85
|
-
title: 'Gradio
|
|
158
|
+
title: 'Dynamically use Gradio Applications',
|
|
86
159
|
readOnlyHint: false,
|
|
87
160
|
openWorldHint: true,
|
|
88
161
|
},
|
|
@@ -96,16 +169,17 @@ export class SpaceTool {
|
|
|
96
169
|
const requestedOperation = params.operation;
|
|
97
170
|
if (!requestedOperation) {
|
|
98
171
|
return {
|
|
99
|
-
formatted:
|
|
172
|
+
formatted: getUsageInstructions(),
|
|
100
173
|
totalResults: 1,
|
|
101
174
|
resultsShared: 1,
|
|
102
175
|
};
|
|
103
176
|
}
|
|
104
177
|
const normalizedOperation = requestedOperation.toLowerCase();
|
|
105
|
-
|
|
178
|
+
const validOperations = getOperationNames();
|
|
179
|
+
if (!validOperations.includes(normalizedOperation)) {
|
|
106
180
|
return {
|
|
107
181
|
formatted: `Unknown operation: "${requestedOperation}"
|
|
108
|
-
Available operations: ${
|
|
182
|
+
Available operations: ${validOperations.join(', ')}
|
|
109
183
|
|
|
110
184
|
Call this tool with no operation for full usage instructions.`,
|
|
111
185
|
totalResults: 0,
|
|
@@ -115,8 +189,10 @@ Call this tool with no operation for full usage instructions.`,
|
|
|
115
189
|
}
|
|
116
190
|
try {
|
|
117
191
|
switch (normalizedOperation) {
|
|
192
|
+
case 'find':
|
|
193
|
+
return await this.handleFind(params);
|
|
118
194
|
case 'discover':
|
|
119
|
-
return await this.handleDiscover(
|
|
195
|
+
return await this.handleDiscover();
|
|
120
196
|
case 'view_parameters':
|
|
121
197
|
return await this.handleViewParameters(params);
|
|
122
198
|
case 'invoke':
|
|
@@ -140,8 +216,11 @@ Call this tool with no operation for full usage instructions.`,
|
|
|
140
216
|
};
|
|
141
217
|
}
|
|
142
218
|
}
|
|
143
|
-
async
|
|
144
|
-
return await
|
|
219
|
+
async handleFind(params) {
|
|
220
|
+
return await findSpaces(params.search_query, params.limit, this.hfToken);
|
|
221
|
+
}
|
|
222
|
+
async handleDiscover() {
|
|
223
|
+
return await discoverSpaces();
|
|
145
224
|
}
|
|
146
225
|
async handleViewParameters(params) {
|
|
147
226
|
if (!params.space_name) {
|
|
@@ -204,7 +283,4 @@ Use "view_parameters" to see what parameters this space accepts.`,
|
|
|
204
283
|
return await invokeSpace(params.space_name, params.parameters, this.hfToken, extra);
|
|
205
284
|
}
|
|
206
285
|
}
|
|
207
|
-
function isOperationName(value) {
|
|
208
|
-
return OPERATION_NAMES.includes(value);
|
|
209
|
-
}
|
|
210
286
|
//# sourceMappingURL=space-tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space-tool.js","sourceRoot":"","sources":["../../src/space/space-tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"space-tool.js","sourceRoot":"","sources":["../../src/space/space-tool.ts"],"names":[],"mappings":"AAIA,OAAO,EACN,eAAe,EAGf,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,cAAc,YAAY,CAAC;AAK3B,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwE1B,CAA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