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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
// list-tools.mjs: print every tool @three-ws/pumpfun-mcp advertises, with its
// input schema.
//
// Spawns this package's own MCP server over stdio the way the README runs it
// (`node src/index.js`), performs the MCP initialize handshake, calls
// tools/list, and prints each tool's title, annotation hints, and parameters.
//
// node examples/list-tools.mjs
//
// Read-only: no key, no signer, no payment.
//
// Worth knowing: this server asks its backend for the authoritative tool list at
// startup, so the count reflects what the backend can actually serve right now.
// The six indexer-backed discovery tools (search_tokens, get_trending_tokens,
// get_new_tokens, get_graduated_tokens, get_king_of_the_hill,
// get_creator_profile) are filtered out of tools/list when the backend has no
// PUMPFUN_BOT_URL configured, which is the case on the public backend today.
// They reappear with no client change once an indexer is wired up. Run
// pumpfun_bot_status (see token-report.mjs) to see that state directly.
import { fileURLToPath } from 'node:url';
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import {
StdioClientTransport,
getDefaultEnvironment,
} from '@modelcontextprotocol/sdk/client/stdio.js';
// The README's "Run standalone" entry point. Swap for
// { command: 'npx', args: ['-y', '@three-ws/pumpfun-mcp'] } to exercise the
// published package instead of this checkout.
const SERVER_PATH = fileURLToPath(new URL('../src/index.js', import.meta.url));
// Env this server reads (see src/index.js). getDefaultEnvironment() drops
// everything else, so an example never leaks unrelated secrets to the child.
const FORWARDED_ENV = ['PUMPFUN_MCP_URL'];
function childEnv() {
const env = getDefaultEnvironment();
for (const key of FORWARDED_ENV) {
const value = process.env[key];
if (value) env[key] = value;
}
return env;
}
/** One-line summary of a tool's MCP annotation hints. */
function hints(annotations) {
if (!annotations) return 'no hints';
const flags = [];
if (annotations.readOnlyHint) flags.push('read-only');
if (annotations.destructiveHint) flags.push('destructive');
if (annotations.idempotentHint) flags.push('idempotent');
if (annotations.openWorldHint) flags.push('open-world');
return flags.length ? flags.join(', ') : 'no hints';
}
/** Render a JSON Schema property as one readable constraint string. */
function constraints(prop) {
const parts = [prop.type ?? 'any'];
if (Array.isArray(prop.enum)) parts.push(`one of ${prop.enum.join(' | ')}`);
if (prop.default !== undefined) parts.push(`default ${JSON.stringify(prop.default)}`);
if (prop.minimum !== undefined) parts.push(`min ${prop.minimum}`);
if (prop.maximum !== undefined) parts.push(`max ${prop.maximum}`);
if (prop.minLength !== undefined) parts.push(`minLength ${prop.minLength}`);
if (prop.maxLength !== undefined) parts.push(`maxLength ${prop.maxLength}`);
return parts.join(', ');
}
function printTool(tool, index) {
const schema = tool.inputSchema ?? {};
const properties = schema.properties ?? {};
const required = new Set(schema.required ?? []);
const names = Object.keys(properties);
console.log(`\n${index}. ${tool.name}`);
if (tool.title) console.log(` title: ${tool.title}`);
console.log(` hints: ${hints(tool.annotations)}`);
if (tool.description) console.log(` ${tool.description}`);
if (names.length === 0) {
console.log(' params: none');
return;
}
console.log(' params:');
for (const name of names) {
const prop = properties[name];
const flag = required.has(name) ? 'required' : 'optional';
console.log(` - ${name} (${flag}; ${constraints(prop)})`);
if (prop.description) console.log(` ${prop.description}`);
}
}
const transport = new StdioClientTransport({
command: process.execPath,
args: [SERVER_PATH],
env: childEnv(),
stderr: 'inherit',
});
const client = new Client({ name: 'pumpfun-mcp-list-tools-example', version: '1.0.0' });
await client.connect(transport);
const server = client.getServerVersion();
console.log(`server: ${server?.name} v${server?.version} (stdio)`);
console.log(`capabilities: ${Object.keys(client.getServerCapabilities() ?? {}).join(', ') || 'none'}`);
const { tools } = await client.listTools();
console.log(`tools: ${tools.length}`);
tools.forEach((tool, i) => printTool(tool, i + 1));
await client.close();