@wavespeed/mcp 1.0.3 → 1.0.5
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/lib/api.js +16 -1
- package/dist/server.js +1 -1
- package/package.json +2 -2
package/dist/lib/api.js
CHANGED
|
@@ -6,7 +6,22 @@
|
|
|
6
6
|
import fs from 'node:fs';
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
import os from 'node:os';
|
|
9
|
+
import { createRequire } from 'node:module';
|
|
9
10
|
import { getApiKey, getBaseUrl } from './config.js';
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
const { version: PKG_VERSION } = require('../../package.json');
|
|
13
|
+
// Channel-attribution headers (X-Client-Name / X-Client-Version / X-Client-OS),
|
|
14
|
+
// following the wavespeed-desktop convention. The WAVESPEED_CLIENT_NAME
|
|
15
|
+
// environment variable overrides the name so wrapper channels can brand
|
|
16
|
+
// themselves without code changes.
|
|
17
|
+
export function clientAttributionHeaders() {
|
|
18
|
+
const platform = os.platform();
|
|
19
|
+
return {
|
|
20
|
+
'X-Client-Name': process.env.WAVESPEED_CLIENT_NAME || 'wavespeed-mcp',
|
|
21
|
+
'X-Client-Version': PKG_VERSION,
|
|
22
|
+
'X-Client-OS': platform === 'win32' ? 'windows' : platform,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
10
25
|
const CACHE_TTL_MS = 60 * 60 * 1000; // 1 hour
|
|
11
26
|
function cachePath() {
|
|
12
27
|
return path.join(os.homedir(), '.cache', 'wavespeed', 'models.json');
|
|
@@ -57,7 +72,7 @@ function authHeaders() {
|
|
|
57
72
|
if (!apiKey) {
|
|
58
73
|
throw new Error('No WaveSpeed API key configured. Set WAVESPEED_API_KEY, or run `wavespeed login`.');
|
|
59
74
|
}
|
|
60
|
-
return { Authorization: `Bearer ${apiKey}
|
|
75
|
+
return { Authorization: `Bearer ${apiKey}`, ...clientAttributionHeaders() };
|
|
61
76
|
}
|
|
62
77
|
async function apiGet(apiPath) {
|
|
63
78
|
const res = await fetch(`${getBaseUrl()}${apiPath}`, { headers: authHeaders() });
|
package/dist/server.js
CHANGED
|
@@ -81,7 +81,7 @@ export function createServer() {
|
|
|
81
81
|
models: filtered.slice(0, limit).map(compactModel),
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
|
-
server.tool('get_model_schema', "Get a model's real input schema (required fields, properties, defaults). Call this before run_model so inputs match what the model actually accepts.", { model: z.string().describe('Model ID from list_models, e.g.
|
|
84
|
+
server.tool('get_model_schema', "Get a model's real input schema (required fields, properties, defaults). Call this before run_model so inputs match what the model actually accepts.", { model: z.string().describe('Model ID from list_models, e.g. bytedance/seedream-v5.0-pro') }, { readOnlyHint: true, openWorldHint: true }, async ({ model }) => {
|
|
85
85
|
const models = await fetchModels();
|
|
86
86
|
const meta = models.find((m) => m.model_id === model);
|
|
87
87
|
if (!meta) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavespeed/mcp",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "WaveSpeed MCP server
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "WaveSpeed MCP server — run any model on the live WaveSpeed catalog (image, video, audio, 3D) with schema introspection, local-file upload, and price quotes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"wavespeed-mcp": "dist/index.js"
|