@stabgan/openrouter-mcp-multimodal 4.6.0 → 4.6.2

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.
Files changed (67) hide show
  1. package/README.md +60 -52
  2. package/dist/errors.d.ts +3 -12
  3. package/dist/errors.js +2 -6
  4. package/dist/index.js +11 -11
  5. package/dist/logger.d.ts +1 -18
  6. package/dist/logger.js +0 -7
  7. package/dist/model-cache.d.ts +1 -20
  8. package/dist/model-cache.js +1 -20
  9. package/dist/openrouter-api.d.ts +4 -18
  10. package/dist/openrouter-api.js +4 -20
  11. package/dist/tool-definitions.d.ts +1 -0
  12. package/dist/tool-definitions.js +708 -0
  13. package/dist/tool-descriptions.js +6 -8
  14. package/dist/tool-handlers/analyze-audio.d.ts +0 -5
  15. package/dist/tool-handlers/analyze-image.d.ts +0 -6
  16. package/dist/tool-handlers/analyze-image.js +1 -8
  17. package/dist/tool-handlers/analyze-video.d.ts +0 -5
  18. package/dist/tool-handlers/analyze-video.js +0 -7
  19. package/dist/tool-handlers/async-chat.d.ts +17 -13
  20. package/dist/tool-handlers/async-chat.js +43 -66
  21. package/dist/tool-handlers/audio-utils.d.ts +1 -4
  22. package/dist/tool-handlers/audio-utils.js +4 -14
  23. package/dist/tool-handlers/cache.d.ts +2 -18
  24. package/dist/tool-handlers/cache.js +1 -19
  25. package/dist/tool-handlers/chat-completion.d.ts +2 -30
  26. package/dist/tool-handlers/chat-completion.js +13 -33
  27. package/dist/tool-handlers/chat-request.d.ts +25 -0
  28. package/dist/tool-handlers/chat-request.js +38 -0
  29. package/dist/tool-handlers/completion-utils.d.ts +1 -18
  30. package/dist/tool-handlers/completion-utils.js +0 -2
  31. package/dist/tool-handlers/fetch-utils.d.ts +2 -18
  32. package/dist/tool-handlers/fetch-utils.js +3 -51
  33. package/dist/tool-handlers/generate-audio.js +11 -21
  34. package/dist/tool-handlers/generate-image-dedicated.js +17 -65
  35. package/dist/tool-handlers/generate-image-input.d.ts +0 -1
  36. package/dist/tool-handlers/generate-image-input.js +2 -18
  37. package/dist/tool-handlers/generate-image.js +8 -15
  38. package/dist/tool-handlers/generate-video.d.ts +1 -7
  39. package/dist/tool-handlers/generate-video.js +24 -109
  40. package/dist/tool-handlers/health-check.d.ts +1 -9
  41. package/dist/tool-handlers/health-check.js +1 -12
  42. package/dist/tool-handlers/image-source.d.ts +14 -0
  43. package/dist/tool-handlers/image-source.js +23 -0
  44. package/dist/tool-handlers/image-utils.d.ts +5 -0
  45. package/dist/tool-handlers/image-utils.js +23 -0
  46. package/dist/tool-handlers/openai-withresponse.d.ts +1 -10
  47. package/dist/tool-handlers/openai-withresponse.js +0 -7
  48. package/dist/tool-handlers/openrouter-errors.d.ts +2 -18
  49. package/dist/tool-handlers/openrouter-errors.js +2 -34
  50. package/dist/tool-handlers/path-safety.d.ts +10 -15
  51. package/dist/tool-handlers/path-safety.js +30 -55
  52. package/dist/tool-handlers/provider-routing.d.ts +0 -9
  53. package/dist/tool-handlers/provider-routing.js +1 -14
  54. package/dist/tool-handlers/rerank.js +0 -2
  55. package/dist/tool-handlers/search-models.d.ts +0 -6
  56. package/dist/tool-handlers/speech-to-text.js +19 -29
  57. package/dist/tool-handlers/structured-output.d.ts +1 -4
  58. package/dist/tool-handlers/structured-output.js +2 -16
  59. package/dist/tool-handlers/text-to-speech.js +8 -26
  60. package/dist/tool-handlers/video-utils.d.ts +1 -6
  61. package/dist/tool-handlers/video-utils.js +2 -17
  62. package/dist/tool-handlers.js +9 -730
  63. package/dist/tool-icons.d.ts +9 -0
  64. package/dist/tool-icons.js +52 -0
  65. package/dist/version.d.ts +1 -15
  66. package/dist/version.js +1 -15
  67. package/package.json +3 -2
@@ -0,0 +1,9 @@
1
+ export type ToolIcon = Array<{
2
+ src: string;
3
+ mimeType: string;
4
+ sizes: string[];
5
+ }>;
6
+ /** Map of tool name → icons array for use in tool definitions. */
7
+ export declare const TOOL_ICONS: Record<string, ToolIcon>;
8
+ /** Server icon for use in the Server initialization metadata. */
9
+ export declare const SERVER_ICON: ToolIcon;
@@ -0,0 +1,52 @@
1
+ /** MCP tool icons — inline SVG data URIs; ignored by clients that don't support them. */
2
+ function svgDataUri(svg) {
3
+ return `data:image/svg+xml,${encodeURIComponent(svg.trim())}`;
4
+ }
5
+ const ICONS = {
6
+ chat: svgDataUri(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#6366f1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>`),
7
+ chatAsync: svgDataUri(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#8b5cf6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/><circle cx="17" cy="7" r="3" fill="#8b5cf6"/></svg>`),
8
+ image: svgDataUri(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#10b981" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="m21 15-5-5L5 21"/></svg>`),
9
+ audio: svgDataUri(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#f59e0b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>`),
10
+ mic: svgDataUri(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><line x1="12" x2="12" y1="19" y2="22"/></svg>`),
11
+ video: svgDataUri(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ec4899" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m22 8-6 4 6 4V8Z"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>`),
12
+ search: svgDataUri(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#06b6d4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>`),
13
+ info: svgDataUri(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#06b6d4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>`),
14
+ check: svgDataUri(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#22c55e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m9 11 3 3L22 4"/></svg>`),
15
+ rerank: svgDataUri(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#a855f7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" x2="21" y1="6" y2="6"/><line x1="8" x2="21" y1="12" y2="12"/><line x1="8" x2="21" y1="18" y2="18"/><line x1="3" x2="3.01" y1="6" y2="6"/><line x1="3" x2="3.01" y1="12" y2="12"/><line x1="3" x2="3.01" y1="18" y2="18"/></svg>`),
16
+ health: svgDataUri(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#22c55e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 12h-4l-3 9L9 3l-3 9H2"/></svg>`),
17
+ speaker: svgDataUri(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#f97316" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/><path d="M15.54 8.46a5 5 0 0 1 0 7.07"/><path d="M19.07 4.93a10 10 0 0 1 0 14.14"/></svg>`),
18
+ poll: svgDataUri(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#64748b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2v4"/><path d="m16.2 7.8 2.9-2.9"/><path d="M18 12h4"/><path d="m16.2 16.2 2.9 2.9"/><path d="M12 18v4"/><path d="m4.9 19.1 2.9-2.9"/><path d="M2 12h4"/><path d="m4.9 4.9 2.9 2.9"/></svg>`),
19
+ };
20
+ function icon(src) {
21
+ return [{ src, mimeType: 'image/svg+xml', sizes: ['24x24'] }];
22
+ }
23
+ /** Map of tool name → icons array for use in tool definitions. */
24
+ export const TOOL_ICONS = {
25
+ chat_completion: icon(ICONS.chat),
26
+ start_chat_completion: icon(ICONS.chatAsync),
27
+ get_chat_completion_status: icon(ICONS.poll),
28
+ analyze_image: icon(ICONS.image),
29
+ analyze_audio: icon(ICONS.audio),
30
+ analyze_video: icon(ICONS.video),
31
+ search_models: icon(ICONS.search),
32
+ get_model_info: icon(ICONS.info),
33
+ validate_model: icon(ICONS.check),
34
+ generate_image: icon(ICONS.image),
35
+ generate_image_dedicated: icon(ICONS.image),
36
+ generate_audio: icon(ICONS.audio),
37
+ text_to_speech: icon(ICONS.speaker),
38
+ speech_to_text: icon(ICONS.mic),
39
+ generate_video: icon(ICONS.video),
40
+ generate_video_from_image: icon(ICONS.video),
41
+ get_video_status: icon(ICONS.poll),
42
+ rerank_documents: icon(ICONS.rerank),
43
+ health_check: icon(ICONS.health),
44
+ };
45
+ /** Server icon for use in the Server initialization metadata. */
46
+ export const SERVER_ICON = [
47
+ {
48
+ src: svgDataUri(`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none"><rect width="48" height="48" rx="12" fill="#1a1a2e"/><path d="M14 24h20M24 14v20" stroke="#6366f1" stroke-width="3" stroke-linecap="round"/><circle cx="24" cy="24" r="8" stroke="#22c55e" stroke-width="2"/><circle cx="24" cy="24" r="3" fill="#6366f1"/></svg>`),
49
+ mimeType: 'image/svg+xml',
50
+ sizes: ['48x48'],
51
+ },
52
+ ];
package/dist/version.d.ts CHANGED
@@ -1,16 +1,2 @@
1
- /**
2
- * Single source of truth for our server version. Exposed via
3
- * `_meta.server_version` on every successful tool response and returned
4
- * by the `health_check` tool.
5
- *
6
- * Bumped in lockstep with package.json / server.json / smithery.yaml /
7
- * scripts/build-manifest.mjs during release prep.
8
- */
9
- export declare const SERVER_VERSION = "4.6.0";
10
- /**
11
- * MCP protocol version our SDK speaks. Hardcoded to match the version
12
- * bundled with `@modelcontextprotocol/sdk`; update when upgrading the
13
- * SDK major. Surfaced by `health_check` so ops can confirm spec level
14
- * at runtime.
15
- */
1
+ export declare const SERVER_VERSION = "4.6.2";
16
2
  export declare const MCP_PROTOCOL_VERSION = "2025-06-18";
package/dist/version.js CHANGED
@@ -1,16 +1,2 @@
1
- /**
2
- * Single source of truth for our server version. Exposed via
3
- * `_meta.server_version` on every successful tool response and returned
4
- * by the `health_check` tool.
5
- *
6
- * Bumped in lockstep with package.json / server.json / smithery.yaml /
7
- * scripts/build-manifest.mjs during release prep.
8
- */
9
- export const SERVER_VERSION = '4.6.0';
10
- /**
11
- * MCP protocol version our SDK speaks. Hardcoded to match the version
12
- * bundled with `@modelcontextprotocol/sdk`; update when upgrading the
13
- * SDK major. Surfaced by `health_check` so ops can confirm spec level
14
- * at runtime.
15
- */
1
+ export const SERVER_VERSION = '4.6.2';
16
2
  export const MCP_PROTOCOL_VERSION = '2025-06-18';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stabgan/openrouter-mcp-multimodal",
3
- "version": "4.6.0",
3
+ "version": "4.6.2",
4
4
  "mcpName": "io.github.stabgan/openrouter-multimodal",
5
5
  "description": "MCP server for OpenRouter — chat with 300+ LLMs, analyze images/audio/video, generate images (dedicated API), TTS/STT, video generation (Veo 3.1 / Seedance / Wan), async completions, response caching",
6
6
  "type": "module",
@@ -30,7 +30,8 @@
30
30
  "test:smoke:uvx:git": "MCP_UVX_FROM_GIT=1 node scripts/smoke-uvx-mcp.mjs",
31
31
  "test:smoke": "npm run test:smoke:npm && npm run test:smoke:docker && npm run test:smoke:uvx:local",
32
32
  "test:all": "npm test && npm run test:regression && npm run test:integration",
33
- "ci": "npm run lint && npm run format:check && npm run build && npm run test:all"
33
+ "version:check": "node scripts/check-version-sync.mjs",
34
+ "ci": "npm run lint && npm run format:check && npm run version:check && npm run build && npm run test:all"
34
35
  },
35
36
  "keywords": [
36
37
  "mcp",