A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/blustAI/node-paymcp-server-demo below:

blustAI/node-paymcp-server-demo: Minimal MCP server demo with paymcp (Stripe/Walleot) that generates images via OpenAI and exposes a paid generate tool over Streamable HTTP.

Image Generator MCP Server (paymcp demo)

A minimal Model Context Protocol (MCP) server that exposes a single tool, generate, which creates an image from a text prompt and returns it as a base64-encoded PNG MCP resource. The server demonstrates how to make a paid MCP tool using paymcp with Stripe or Walleot.

# clone the repo
pnpm install

This project is TypeScript. Use your preferred runner (e.g., tsx, ts-node) when bootstrapping the server process if you create a custom entry point.

Set environment variables (for example via a .env that your runner loads, or via your shell):

export OPENAI_API_KEY="sk-..."
# Optional, if using Stripe
export STRIPE_SECRET_KEY="sk_test_..."
# Optional, if using Walleot (then uncomment provider in the server code)
export WALLEOT_API_KEY="..."

Payment providers are configured in installPayMCP within the server code:

installPayMCP(server, {
  providers: {
    // "walleot": { apiKey: process.env.WALLEOT_API_KEY ?? "" }, // Uncomment to enable Walleot
    "stripe": { apiKey: process.env.STRIPE_SECRET_KEY ?? "" },
  },
  paymentFlow: PaymentFlow.ELICITATION,
});

Payment notes: Stripe has a minimum charge per transaction. If your tool price is below $2.00, prefer Walleot; small Stripe payments may fail or be uneconomical.

The tool returns a response like:

Running the server (HTTP / Streamable HTTP)

This server is already wired to run over HTTP using Express and the StreamableHTTPServerTransport.

# dev with tsx watch
pnpm dev

# build TypeScript -> build/
pnpm build

# start compiled server from build/
pnpm start

By default it listens on PORT (defaults to 5004):

http://localhost:5004/mcp

MIT

Notes on package manager: this repo declares packageManager: pnpm. Examples above use pnpm. If you prefer others, use: npm run dev|build|start or yarn dev|build|start.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4