@orchyn/mcp 1.9.1 → 1.10.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/shared/tools.js +30 -14
- package/package.json +1 -1
package/dist/shared/tools.js
CHANGED
|
@@ -35,7 +35,10 @@ function toToolResult(proxy) {
|
|
|
35
35
|
const structured = proxy.structured;
|
|
36
36
|
const textJson = JSON.stringify(structured ?? {}, null, 2);
|
|
37
37
|
const text = htmlPrefix ? `${htmlPrefix}\n\n${textJson}` : textJson;
|
|
38
|
-
return {
|
|
38
|
+
return {
|
|
39
|
+
content: [...images, { type: "text", text }],
|
|
40
|
+
structuredContent: structured ?? {},
|
|
41
|
+
};
|
|
39
42
|
}
|
|
40
43
|
function toolError(prefix, err) {
|
|
41
44
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -53,22 +56,35 @@ export function createMcpServer(makeClient) {
|
|
|
53
56
|
// Register the single UI resource that all tools share.
|
|
54
57
|
// The host reads this resource, renders it in a sandboxed iframe,
|
|
55
58
|
// and pushes tool results via ui/notifications/tool-result.
|
|
56
|
-
server.registerResource("Orchyn Interactive View", UI_RESOURCE_URI, { mimeType: RESOURCE_MIME_TYPE }, async () =>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
server.registerResource("Orchyn Interactive View", UI_RESOURCE_URI, { mimeType: RESOURCE_MIME_TYPE }, async () => {
|
|
60
|
+
// Build CSP resourceDomains from env so proxied thumbnails work
|
|
61
|
+
const domains = [
|
|
62
|
+
"https://*.tiktokcdn.com",
|
|
63
|
+
"https://*.cdninstagram.com",
|
|
64
|
+
"https://*.ytimg.com",
|
|
65
|
+
"https://*.googlevideo.com",
|
|
66
|
+
];
|
|
67
|
+
const apiUrl = process.env.ORCHYN_API_URL || process.env.ORCHYN_BASE_URL;
|
|
68
|
+
if (apiUrl && apiUrl.trim()) {
|
|
69
|
+
domains.push(apiUrl.trim().replace(/\/+$/, ""));
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
contents: [
|
|
73
|
+
{
|
|
74
|
+
uri: UI_RESOURCE_URI,
|
|
75
|
+
mimeType: RESOURCE_MIME_TYPE,
|
|
76
|
+
text: ORCHYN_UI_TEMPLATE,
|
|
77
|
+
_meta: {
|
|
78
|
+
ui: {
|
|
79
|
+
csp: {
|
|
80
|
+
resourceDomains: domains,
|
|
81
|
+
},
|
|
66
82
|
},
|
|
67
83
|
},
|
|
68
84
|
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
})
|
|
85
|
+
],
|
|
86
|
+
};
|
|
87
|
+
});
|
|
72
88
|
server.registerTool("analyze_post", {
|
|
73
89
|
title: "Analyze Post",
|
|
74
90
|
description: "Analyze a social post (video, image, carousel/slideshow) from its link — " +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orchyn/mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "MCP server for orchyn - fetch, discover and understand TikTok/Instagram/YouTube/X posts with AI (media metadata, niche discovery, hook & viral analysis)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|