Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

chore(scripts): add smoke/test MCP scripts, fix bin names and env stubs

nirholasada04ce7cbfc
diff --git a/package.json b/package.json
index 5000a4361..81a12156a 100644
--- a/package.json
+++ b/package.json
@@ -65,6 +65,8 @@
"changelog:push": "node scripts/changelog-telegram.mjs",
"audit:deploy": "node scripts/audit-deploy-artifacts.mjs",
"audit:mcp": "node scripts/audit-mcp-manifests.mjs",
+ "smoke:mcp": "node scripts/smoke-mcp-remotes.mjs",
+ "test:mcp": "node scripts/test-mcp-all.mjs",
"audit:pages": "node scripts/audit-page-index.mjs",
"audit:handlers": "node scripts/audit-empty-handlers.mjs",
"audit:web": "node scripts/page-audit.mjs",
diff --git a/scripts/smoke-mcp-remotes.mjs b/scripts/smoke-mcp-remotes.mjs
index 5dff6b617..c55a893ed 100644
--- a/scripts/smoke-mcp-remotes.mjs
+++ b/scripts/smoke-mcp-remotes.mjs
@@ -22,7 +22,10 @@ const ENDPOINTS = [
path: '/api/pump-fun-mcp',
type: 'free',
// On-chain tool that needs no external indexer — $THREE is the only mint we touch.
- probe: { name: 'get_token_details', args: { mint: 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump' } },
+ probe: {
+ name: 'get_token_details',
+ args: { mint: 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump' },
+ },
},
{ path: '/api/mcp', type: 'paid' },
{ path: '/api/mcp-3d', type: 'paid' },
@@ -68,7 +71,11 @@ async function post(path, payload) {
body: JSON.stringify(payload),
});
const text = await res.text();
- return { status: res.status, body: parseBody(text, res.headers.get('content-type') || ''), raw: text };
+ return {
+ status: res.status,
+ body: parseBody(text, res.headers.get('content-type') || ''),
+ raw: text,
+ };
}
function validateChallenge(body) {
@@ -91,35 +98,60 @@ const results = [];
async function checkFree(ep) {
const checks = [];
- const init = await post(ep.path, rpc('initialize', {
- protocolVersion: '2025-06-18',
- capabilities: {},
- clientInfo: { name: 'smoke', version: '0' },
- }));
+ const init = await post(
+ ep.path,
+ rpc('initialize', {
+ protocolVersion: '2025-06-18',
+ capabilities: {},
+ clientInfo: { name: 'smoke', version: '0' },
+ }),
+ );
const name = init.body?.result?.serverInfo?.name;
- checks.push(['initialize', init.status === 200 && !!name, name ? `serverInfo=${name}` : `status ${init.status}`]);
+ checks.push([
+ 'initialize',
+ init.status === 200 && !!name,
+ name ? `serverInfo=${name}` : `status ${init.status}`,
+ ]);
const list = await post(ep.path, rpc('tools/list', {}, 2));
const tools = list.body?.result?.tools;
- checks.push(['tools/list', Array.isArray(tools) && tools.length > 0, `${tools?.length ?? 0} tools`]);
+ checks.push([
+ 'tools/list',
+ Array.isArray(tools) && tools.length > 0,
+ `${tools?.length ?? 0} tools`,
+ ]);
- const call = await post(ep.path, rpc('tools/call', { name: ep.probe.name, arguments: ep.probe.args }, 3));
+ const call = await post(
+ ep.path,
+ rpc('tools/call', { name: ep.probe.name, arguments: ep.probe.args }, 3),
+ );
const isErr = !!call.body?.error;
- checks.push([`call ${ep.probe.name}`, !isErr, isErr ? call.body.error.message?.slice(0, 60) : 'ok']);
+ checks.push([
+ `call ${ep.probe.name}`,
+ !isErr,
+ isErr ? call.body.error.message?.slice(0, 60) : 'ok',
+ ]);
return checks;
}
async function checkPaid(ep) {
- const res = await post(ep.path, rpc('initialize', {
- protocolVersion: '2025-06-18',
- capabilities: {},
- clientInfo: { name: 'smoke', version: '0' },
- }));
+ const res = await post(
+ ep.path,
+ rpc('initialize', {
+ protocolVersion: '2025-06-18',
+ capabilities: {},
+ clientInfo: { name: 'smoke', version: '0' },
+ }),
+ );
const gated = res.status === 401 || res.status === 402;
const challengeErr = validateChallenge(res.body);
return [
['payment-gated', gated, `HTTP ${res.status}`],
- ['valid x402 challenge', gated && !challengeErr, challengeErr || `${res.body?.accepts?.length} accept(s)`],
+ [
+ 'valid x402 challenge',
+ gated && !challengeErr,
+ challengeErr || `${res.body?.accepts?.length} accept(s)`,
+ ],
];
}
@@ -141,5 +173,7 @@ for (const ep of ENDPOINTS) {
results.push({ path: ep.path, ok: epOk });
}
-console.log(`\n${failures === 0 ? '✓ all remotes healthy' : `✗ ${failures} endpoint(s) unhealthy`} (${results.length} checked)\n`);
+console.log(
+ `\n${failures === 0 ? '✓ all remotes healthy' : `✗ ${failures} endpoint(s) unhealthy`} (${results.length} checked)\n`,
+);
process.exit(failures === 0 ? 0 : 1);
diff --git a/scripts/test-mcp-all.mjs b/scripts/test-mcp-all.mjs
new file mode 100644
index 000000000..facc9398f
--- /dev/null
+++ b/scripts/test-mcp-all.mjs
@@ -0,0 +1,85 @@
+#!/usr/bin/env node
+// One command to verify every three.ws MCP surface end to end:
+// 1. manifest consistency (audit-mcp-manifests.mjs)
+// 2. each stdio package's own test suite (node --test)
+// 3. live health of all 6 remote endpoints (smoke-mcp-remotes.mjs)
+//
+// node scripts/test-mcp-all.mjs # remote smoke against https://three.ws
+// node scripts/test-mcp-all.mjs http://localhost:3000
+// node scripts/test-mcp-all.mjs --no-remote # skip the live layer (offline)
+
+import { execFileSync } from 'node:child_process';
+import { existsSync } from 'node:fs';
+import { resolve, dirname } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
+const args = process.argv.slice(2);
+const noRemote = args.includes('--no-remote');
+const base = args.find((a) => !a.startsWith('--')) || 'https://three.ws';
+
+const PACKAGES = [
+ 'packages/pumpfun-mcp',
+ 'packages/ibm-watsonx-mcp',
+ 'packages/ibm-x402-mcp',
+ 'packages/avatar-agent-mcp',
+ 'packages/threews-avatar-mcp',
+ 'packages/three-token-mcp',
+ 'mcp-bridge',
+];
+
+const rows = [];
+function record(name, ok, detail) {
+ rows.push({ name, ok, detail });
+ console.log(`${ok ? '✓' : '✗'} ${name.padEnd(34)} ${detail}`);
+}
+
+function run(cmd, cmdArgs, cwd) {
+ try {
+ const out = execFileSync(cmd, cmdArgs, {
+ cwd,
+ encoding: 'utf8',
+ stdio: ['ignore', 'pipe', 'pipe'],
+ });
+ return { ok: true, out };
+ } catch (e) {
+ return { ok: false, out: `${e.stdout || ''}${e.stderr || ''}` };
+ }
+}
+
+console.log('\n── MCP verification ──\n');
+
+console.log('[1] manifest consistency');
+const audit = run('node', ['scripts/audit-mcp-manifests.mjs'], root);
+record('audit:mcp', audit.ok, audit.out.trim().split('\n').pop() || '');
+
+console.log('\n[2] stdio package test suites');
+for (const dir of PACKAGES) {
+ if (!existsSync(resolve(root, dir, 'package.json'))) {
+ record(dir, false, 'no package.json');
+ continue;
+ }
+ const r = run('npm', ['test'], resolve(root, dir));
+ const tests = (r.out.match(/^ℹ tests (\d+)/m) || [])[1] || '?';
+ const fail = (r.out.match(/^ℹ fail (\d+)/m) || [])[1] || '?';
+ const ok = r.ok && fail === '0';
+ record(dir, ok, `${tests} tests, ${fail} failing`);
+}
+
+if (!noRemote) {
+ console.log('\n[3] live remote endpoints');
+ const r = run('node', ['scripts/smoke-mcp-remotes.mjs', base], root);
+ const line =
+ r.out
+ .trim()
+ .split('\n')
+ .filter((l) => l.includes('remotes'))
+ .pop() || r.out.trim().split('\n').pop();
+ record('smoke:mcp remotes', r.ok, line || '');
+}
+
+const failed = rows.filter((r) => !r.ok);
+console.log(
+ `\n${failed.length === 0 ? '✓ ALL MCP CHECKS PASSED' : `✗ ${failed.length} CHECK(S) FAILED: ${failed.map((r) => r.name).join(', ')}`}\n`,
+);
+process.exit(failed.length === 0 ? 0 : 1);
diff --git a/scripts/verify-packages.mjs b/scripts/verify-packages.mjs
index f73932f50..68f6905e6 100644
--- a/scripts/verify-packages.mjs
+++ b/scripts/verify-packages.mjs
@@ -30,10 +30,10 @@ const PACKAGES = [
{ dir: 'agent-ui-sdk', name: '@three-ws/agent-ui', type: 'resolve', subpaths: ['.'] },
{ dir: 'sdk', name: '@three-ws/sdk', type: 'resolve', subpaths: ['.'] },
{ dir: 'packages/avatar-cli', name: '@three-ws/avatar-cli', type: 'cli', bin: 'three-ws-avatar', siblings: ['packages/avatar-schema'] },
- { dir: 'mcp-server', name: '@3d-agent/mcp-server', type: 'mcp', bin: 'mcp-server', minTools: 15 },
+ { dir: 'mcp-server', name: '@3d-agent/mcp-server', type: 'mcp', bin: '3d-agent-mcp', minTools: 15 },
{ dir: 'packages/pumpfun-mcp', name: '@three-ws/pumpfun-mcp', type: 'mcp', bin: 'pumpfun-mcp', minTools: 20 },
{ dir: 'packages/ibm-watsonx-mcp', name: '@three-ws/ibm-watsonx-mcp',type: 'mcp', bin: 'ibm-watsonx-mcp', minTools: 6, env: { WATSONX_API_KEY: 'test', WATSONX_PROJECT_ID: 'test' } },
- { dir: 'packages/ibm-x402-mcp', name: '@three-ws/ibm-x402-mcp', type: 'mcp', bin: 'ibm-x402-mcp', minTools: 6 },
+ { dir: 'packages/ibm-x402-mcp', name: '@three-ws/ibm-x402-mcp', type: 'mcp', bin: 'ibm-x402-mcp', minTools: 6, env: { MCP_SVM_PAYMENT_ADDRESS: 'THREEsynthetic11111111111111111111111111111', WATSONX_API_KEY: 'test', WATSONX_PROJECT_ID: 'test' } },
{ dir: 'packages/three-token-mcp', name: '@three-ws/three-token-mcp',type: 'mcp', bin: 'three-token-mcp', minTools: 3 },
{ dir: 'packages/avatar-agent-mcp', name: '@three-ws/avatar-agent', type: 'mcp', bin: 'three-avatar-agent', minTools: 18 },
{ dir: 'packages/threews-avatar-mcp', name: '@three-ws/avatar-mcp', type: 'mcp', bin: 'avatar-mcp', minTools: 3 },