@wavespeed/mcp 1.0.16 → 1.0.17
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/README.md +2 -2
- package/dist/lib/api.js +3 -6
- package/dist/server.js +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,9 +32,9 @@ Built on the same design as the open-source [`@wavespeed/cli`](https://github.co
|
|
|
32
32
|
| Tool | What it does |
|
|
33
33
|
|---|---|
|
|
34
34
|
| `list_models` | Search the live catalog by text or modality type |
|
|
35
|
-
| `get_model_schema` | A model's real input schema (required, properties, defaults), with a link to the model's
|
|
35
|
+
| `get_model_schema` | A model's real input schema (required, properties, defaults), with a link to the model's playground page |
|
|
36
36
|
| `run_model` | Submit + wait; rejects input keys the model doesn't accept; `@path` inputs upload automatically; returns output URLs |
|
|
37
|
-
| `get_price` | Cost estimate for the inputs you pass (no charge), with a link to the model's
|
|
37
|
+
| `get_price` | Cost estimate for the inputs you pass (no charge), with a link to the model's playground page |
|
|
38
38
|
| `get_balance` | Account credit balance, with the top-up link |
|
|
39
39
|
| `list_predictions` | Run history (default last 24h); filter by model, status, time range |
|
|
40
40
|
| `list_billings` | Itemized charges and refunds (needs a Billing-access key) |
|
package/dist/lib/api.js
CHANGED
|
@@ -200,12 +200,9 @@ export async function fetchUsageStats(startTime, endTime, model) {
|
|
|
200
200
|
body.model_uuid = model;
|
|
201
201
|
return apiPost('/api/v3/user/usage_stats', body, { timeoutMs: GET_TIMEOUT_MS });
|
|
202
202
|
}
|
|
203
|
-
// The model's page on the
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
export function modelDocsUrl(modelId) {
|
|
207
|
-
const provider = modelId.split('/')[0];
|
|
208
|
-
return `https://wavespeed.ai/docs/docs-api/${provider}/${modelId.replace('wavespeed-ai/', '').split('/').join('-')}`;
|
|
203
|
+
// The model's page on the site, where it can be tried in the playground.
|
|
204
|
+
export function modelPlaygroundUrl(modelId) {
|
|
205
|
+
return `https://wavespeed.ai/models/${modelId}`;
|
|
209
206
|
}
|
|
210
207
|
export async function fetchPricing(modelId, inputs) {
|
|
211
208
|
// /model/price is the documented pricing endpoint.
|
package/dist/server.js
CHANGED
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
// * Inputs are never mutated. The one explicit transform is the `@path`
|
|
10
10
|
// marker, which uploads the referenced local file and substitutes its
|
|
11
11
|
// hosted URL. Bare paths pass through untouched.
|
|
12
|
-
// * Price quotes are estimates for the inputs given; the model's
|
|
13
|
-
// is linked next to them for what each input means.
|
|
12
|
+
// * Price quotes are estimates for the inputs given; the model's playground
|
|
13
|
+
// page is linked next to them for what each input means.
|
|
14
14
|
import { createRequire } from 'node:module';
|
|
15
15
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
16
16
|
import { z } from 'zod';
|
|
17
17
|
import { Client } from 'wavespeed';
|
|
18
|
-
import { fetchModels, fetchBalance, fetchHistory, fetchBillings, fetchUsageStats, deletePredictions, PREDICTION_STATUSES, fetchPricing,
|
|
18
|
+
import { fetchModels, fetchBalance, fetchHistory, fetchBillings, fetchUsageStats, deletePredictions, PREDICTION_STATUSES, fetchPricing, modelPlaygroundUrl, submitPrediction, waitForPrediction, MCP_CLIENT_NAME, TERMINAL_FAILURES, } from './lib/api.js';
|
|
19
19
|
import { getApiKey, getBaseUrl } from './lib/config.js';
|
|
20
20
|
import { MAX_DELETE_IDS, prepareDelete, summarizeDelete } from './lib/delete-predictions.js';
|
|
21
21
|
// Where to add credit; handed to the assistant next to the balance.
|
|
@@ -163,7 +163,7 @@ export function createServer() {
|
|
|
163
163
|
required: schema?.required ?? [],
|
|
164
164
|
properties: schema?.properties ?? {},
|
|
165
165
|
property_order: schema?.['x-order-properties'] ?? [],
|
|
166
|
-
|
|
166
|
+
playground_url: modelPlaygroundUrl(meta.model_id),
|
|
167
167
|
});
|
|
168
168
|
});
|
|
169
169
|
server.tool('run_model', 'Run any WaveSpeed model. input keys come from get_model_schema; unknown keys are rejected before submission. Local files: pass "@./path" string values — they are uploaded and replaced with hosted URLs (bare paths are NOT uploaded). Returns the prediction id right away (done=false); call get_prediction with that id and wait_seconds until done=true to get the output URLs. The task keeps running on the server. Pass wait_seconds here to wait for a quick model in the same call.', {
|
|
@@ -221,7 +221,7 @@ export function createServer() {
|
|
|
221
221
|
});
|
|
222
222
|
const priceInput = resolved.input;
|
|
223
223
|
const data = await fetchPricing(model, priceInput);
|
|
224
|
-
return ok({ ...data, estimate: true, disclaimer: PRICE_DISCLAIMER,
|
|
224
|
+
return ok({ ...data, estimate: true, disclaimer: PRICE_DISCLAIMER, playground_url: modelPlaygroundUrl(model) });
|
|
225
225
|
});
|
|
226
226
|
server.tool('get_balance', 'Show the WaveSpeed account credit balance, with the link to top up.', {}, { readOnlyHint: true, openWorldHint: true }, async () => {
|
|
227
227
|
return ok({ ...(await fetchBalance()), top_up_url: TOP_UP_URL });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavespeed/mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
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": {
|