THE MACHINETRANSFER TOOLKIT

Give your agent
a better choice.

Turn a service request into a costed purchase plan. Start with a runnable example, then connect the same tools to your agent through MCP or OpenAI function calling.

NODE.JS 22 · ZERO DEPENDENCIES · OPEN SOURCE

01 / CONFIGURE

Your catalog. Your policy.

Define approved services, exact payment routes, quote freshness and the maximum complete cost.

02 / COMPARE

Make every cost count.

Compare supplied prices, transfer tax, network fees, conversion and risk allowances for the same result.

03 / INTEGRATE

Keep the decision useful.

Return the selected route, costs and reasons to your application’s approval and delivery workflow.

From ZIP
to working code.

Download and extract the toolkit. Open a terminal in the extracted machinetransfer directory and run the example with Node.js 22. No package installation or API key is needed.

The supplied example compares a $95 MTR service price with a $100 USDT price, adding the modeled transfer tax and costs. The lower complete cost wins.

Edit the sample catalog in examples/planner-config.cjs to explore other prices. Each run creates fresh example quotes.

QUICKSTARTTERMINAL
# Prepare a purchase plan
node examples/plan-purchase.cjs

# Try the Responses tool adapter
node examples/responses-tool.cjs

# Run the included checks
node --test test/*.test.cjs

Examples use supplied costs and invented route identifiers. They prepare plans locally.

LOCAL MCP CLIENTS

Discover the tools.

Connect the included stdio server. Your client discovers list_services and plan_purchase through MCP.

Configure MCP

OPENAI RESPONSES

Complete the tool call.

Register flat function definitions and turn a model call into its matching function_call_output.

Use Responses

JAVASCRIPT + CHAT COMPLETIONS

Call the planner directly.

Use handleTool in JavaScript or register openaiTools with Chat Completions. Both use the same policy.

Get the examples

Bring your client.
Keep your rules.

Run node examples/mcp-config.cjs to print server launch options with paths for your extracted toolkit. Add the generated command, arguments and environment to a compatible client’s local stdio server settings.

The server validates its catalog and policy at startup. Your client completes the MCP handshake, discovers the tools and supplies the selected service ID.

Generate sample configuration immediately before connecting. In your application, supply authenticated merchant quotes and refresh them by restarting the server with updated configuration.

GENERATE CLIENT SETTINGSTERMINAL
node examples/mcp-config.cjs

# Output contains:
# command: your Node executable
# args: the planner server path
# env: MTR_PLANNER_CONFIG

# Add these launch options to
# your MCP client's settings.

Client settings wrappers differ. The README explains the common fields and connection lifecycle.

One tool call.
A traceable result.

Pass agentTools.openaiResponsesTools as your Responses request’s tools. For a returned function call, project its name, serialized arguments and call ID into the adapter.

The adapter returns the corresponding function_call_output item. Your application sends that item back through the Responses API while preserving the response context required by your model.

The runnable responses-tool.cjs example exercises this local exchange. Your application owns the model connection and approval flow.

HANDLE A FUNCTION CALLJAVASCRIPT
// agentTools comes from createAgentTools.
// call is a returned function_call item.
const output = agentTools.handleResponsesCall({
  name: call.name,
  arguments: call.arguments,
  call_id: call.call_id
});

// output.type: 'function_call_output'
// output.call_id: the original call ID
// output.output: the JSON purchase plan

A service network.
Built on Ethereum.

Reproduce a complete service payment on a local EVM.

The network kit connects merchant registration, signed service quotes and exact MTR settlement. Each payment records the service, request and quote alongside its token receipt.

Ethereum is the canonical launch chain. The contracts use the EVM, standard Ethereum tooling and ETH for network fees. The architecture keeps one canonical MTR supply as the network grows.

Download network kit
LOCAL EVM QUICKSTARTNODE.JS 22
# Extract the network kit and open
# its machinetransfer-network directory.
npm ci
npm test
npm run demo

# Register a service
# Verify a signed quote
# Settle the exact MTR payment
# Verify and recover the receipt

Runs an in-process EVM with local test accounts. The kit includes Solidity contracts, quote and receipt libraries, and reproducible checks.

SERVICE REGISTRY

Know who sets the terms.

Each merchant controls its service records, payment recipient and quote signer. Changes advance the service revision.

SIGNED QUOTES

Bind the complete request.

Quotes bind the payer, service revision, request, token, recipient, gross amount, minimum net amount and validity window.

EXACT SETTLEMENT

Match both receipts.

Settlement rechecks the registered terms and sends MTR directly to the recipient. Verification matches the service event and token transfer to the same purchase.

LayerResponsibility
ModelSelect a known service from the approved catalog.
Operator configurationSupply trusted quotes, allowed routes, budget and clock.
PlannerValidate inputs, compare eligible routes and return a purchase plan.
Application and walletManage approval, signing, execution and payment reconciliation.
Service providerConnect the verified receipt to delivery of the purchased result.

An eligible stablecoin quote can be selected when it has the lower complete cost. Equal complete costs return a review outcome. Missing or expired costs are excluded from selection. Each plan requires application approval.

EXACT AMOUNTS

Token arithmetic
you can inspect.

The toolkit also includes gross-to-net amounts and cost comparison helpers.

Explore MTR mechanics