npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@paybyrd/agent-toolkit

v1.0.2

Published

Paybyrd Agent Toolkit is a library that enables AI models to interact with Paybyrd's payment processing API through various interfaces, including OpenAI's function calling and the Model Context Protocol (MCP).

Downloads

8

Readme

Paybyrd Agent Toolkit

Paybyrd Agent Toolkit is a library that enables AI models to interact with Paybyrd's payment processing API through various interfaces, including OpenAI's function calling and the Model Context Protocol (MCP).

Features

  • Integrate Paybyrd payment services with AI models
  • Create payment links
  • Process refunds
  • Retrieve order information
  • Support for multiple AI platforms:
    • OpenAI function calling
    • Anthropic's Claude via Model Context Protocol

Installation

npm install @paybyrd/agent-toolkit

Quick Start

Prerequisites

  • Node.js 18 or higher
  • Paybyrd API key
  • OpenAI API key (for OpenAI integration) or Anthropic API key (for Claude integration)

Using with OpenAI

import { PaybyrdAgentToolkit } from '@paybyrd/agent-toolkit/openai';
import OpenAI from 'openai';

// Initialize the OpenAI client
const openai = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY,
});

// Initialize Paybyrd toolkit for OpenAI
const toolkit = new PaybyrdAgentToolkit({
  apiKey: process.env.PAYBYRD_API_KEY,
  configuration: {
    actions: {
      paymentLinks: { create: true },
      refunds: { create: true },
      order: { read: true }
    },
  },
});

// Get the tool definitions
const tools = toolkit.getTools();

// Create a chat completion with the tools
const response = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [
    { 
      role: "user", 
      content: "Create a payment link for 50 EUR and send it to [email protected]" 
    }
  ],
  tools: tools,
  tool_choice: "auto",
});

console.log(response);

Using with Claude via Model Context Protocol

Server Setup

Create a server script:

// server.ts
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { PaybyrdAgentToolkit } from '@paybyrd/agent-toolkit/modelcontextprotocol';

function initializeToolkit() {
  if (!process.env.PAYBYRD_API_KEY) {
    throw new Error("'PAYBYRD_API_KEY' API key is required!");
  }

  return new PaybyrdAgentToolkit({
    apiKey: process.env.PAYBYRD_API_KEY,
    configuration: {
      actions: {
        paymentLinks: { create: true },
        refunds: { create: true },
        order: { read: true }
      },
    },
  });
}

async function main() {
  try {
    const toolkit = initializeToolkit();
    const transport = new StdioServerTransport();

    await toolkit.connect(transport);
    console.log("Connected!");
  } catch (error) {
    console.error(error);
    throw error;
  }
}

main().catch((error) => {
  process.exit(1);
});

Client Setup

Create a client script:

// client.ts
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { Anthropic } from "@anthropic-ai/sdk";

async function main() {
  // Initialize the Anthropic client
  const anthropic = new Anthropic({
    apiKey: process.env.ANTHROPIC_API_KEY,
  });

  const mcp = new Client({ name: "mcp-client", version: "1.0.0" });

  // Create a transport that will run your server script
  const transport = new StdioClientTransport({
    command: "node",
    args: ["server.js"]
  });

  // Connect to the server
  mcp.connect(transport);

  // List available tools
  const toolsResult = await mcp.listTools();
  const tools = toolsResult.tools.map((tool) => ({
    name: tool.name,
    description: tool.description,
    input_schema: tool.inputSchema,
  }));

  console.log("Connected to server with tools:", tools.map(({ name }) => name));

  // Send a request to Claude with the tools
  const message = await anthropic.messages.create({
    model: "claude-3-5-sonnet-20241022",
    max_tokens: 1000,
    messages: [
      {
        role: "user",
        content: "Please retrieve the order '627f7c5c-b50b-412c-868f-bbae98c16b2e'"
      }
    ],
    tools: tools
  });
  
  console.log("Anthropic response:", message.content);
}

main().catch(error => {
  console.error('Client error:', error);
  process.exit(1);
});

Running with Claude Desktop App

To use the toolkit with the Claude Desktop App:

  1. Install the toolkit:

    npm install -g @paybyrd/agent-toolkit
  2. Set your Paybyrd API key:

    export PAYBYRD_API_KEY="your-api-key-here"
  3. Run the MCP server:

    claude-mcp
  4. Configure Claude Desktop to use the MCP server:

    a. Open Claude Desktop

    b. Go to Settings > Advanced > Model Context Protocol

    c. Check "Enable Model Context Protocol"

    d. Set the Command to: claude-mcp

    e. Click "Save"

  5. Now Claude Desktop will have access to Paybyrd payment tools

API Reference

PaybyrdAgentToolkit Options

{
  apiKey: string;  // Your Paybyrd API key
  configuration: {
    actions: {
      paymentLinks: { create: boolean };
      refunds: { create: boolean };
      order: { read: boolean };
    }
  }
}

Available Tools

  • create_payment_link: Create payment links to send to customers
  • create_refund: Process refunds for orders
  • get_order: Retrieve order information by order ID

Development

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm run test

# Run linter
npm run lint

# Format code
npm run prettier

License

MIT