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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pixelbananas/mcp

v0.2.0

Published

MCP server for PixelBananas AI audio generation (SFX / BGM / kits)

Downloads

20

Readme

@pixelbananas/mcp

MCP server for the PixelBananas AI audio API. Lets Claude Code (and any MCP client) generate SFX, chiptune BGM, and themed audio kits as part of multi-step workflows.

Tools

| Tool | What | Cost | |---|---|---| | generate_sfx | Text prompt → 8-bit SFX. Auto-saves .wav (+ .mp3 if format="both"). | 1 / 2 / 4 credits | | generate_bgm | Text prompt → chiptune BGM. Auto-saves .wav + .mid (8/16/32 bars). | 5–20 credits | | generate_kit | Template → cohesive audio kit ZIP (Studio tier). | 50–200 credits | | download_audio | Re-render an existing generation by ID to disk. | free | | list_generations | List your recent generations. | free | | get_generation | Full details of one generation by ID. | free | | share_patch | Public share URL for a patch. | free |

Setup

1. Create a Personal Access Token

Log in at https://pixelbananas.pages.dev/login → visit /settings/tokens+ CREATE. Copy the pba_live_... token (shown once).

2. Register with your MCP client

Claude Code (~/.claude/mcp.json or per-project .claude/mcp.json):

{
  "mcpServers": {
    "pixelbananas": {
      "command": "npx",
      "args": ["-y", "@pixelbananas/mcp"],
      "env": {
        "PIXELBANANAS_TOKEN": "pba_live_REPLACE_ME"
      }
    }
  }
}

Claude.ai desktop (~/Library/Application Support/Claude/claude_desktop_config.json): same shape as above.

3. Verify

Restart your client and ask Claude:

List my PixelBananas generations

You should see the list_generations tool run and return recent items.

Output files

By default, generate_sfx and generate_bgm write the rendered audio to disk so you don't need a second tool call.

Where files go (in order of precedence):

  1. The outputDir tool argument (per call).
  2. The PIXELBANANAS_OUTPUT_DIR env var.
  3. ./pixelbananas-audio/ under the cwd of the MCP process (auto-created).

Filename: a slug of the prompt (lowercase, non-alphanumeric → -, truncated to 50 chars), with -2, -3, … appended on collision. Override with the filename tool argument.

Formats: format: "wav" | "mp3" | "both" (default "wav"). For generate_bgm, a .mid file is also written unless includeMidi: false.

Skip saving entirely: save: false (still returns the patch JSON).

Note on BGM rendering: the MCP renderer is a chiptune approximation using plain Web Audio nodes. The web app uses Tone.js wrappers (MembraneSynth/MetalSynth) for slightly different drum timbres. Patch / song JSON is identical between the two; only timbre differs slightly.

Example workflows

"Make 4 boss-fight SFX variants"

Use generate_sfx with prompt="boss explosion, heavy impact, low-end rumble, 8-bit"
and effort=2 (best-of-2). Then save each audio URL to /assets/sfx/boss_N.wav.

Claude fires generate_sfx four times, each with a slight prompt variation (e.g. "...faster decay", "...metallic"), and reports back with the URLs + credit balance.

"Generate intro/explore/boss BGM for Thyrsus Act II"

Use generate_bgm three times:
- prompt="calm sunrise intro, pentatonic, slow tempo" bars=16 effort=1
- prompt="wandering exploration, dorian mode, medium tempo" bars=16 effort=1
- prompt="intense boss battle, harmonic minor, driving drums" bars=32 effort=2

Environment variables

| Var | Default | Meaning | |---|---|---| | PIXELBANANAS_TOKEN | (required) | Personal access token (pba_live_...) | | PIXELBANANAS_API_URL | https://pixelbananas-api.nano122090.workers.dev | Worker base URL | | PIXELBANANAS_FRONTEND_URL | https://pixelbananas.pages.dev | Frontend URL (used for share links) | | PIXELBANANAS_OUTPUT_DIR | (unset) | Default directory for saved audio. Per-call outputDir overrides. |

Cost & rate limits

Every generate call deducts credits server-side; free tier gets 20/month. Rate limit: 5 requests/minute for SFX, 3/minute for BGM. Tools return creditsRemaining on every success so Claude can self-throttle.

Insufficient credits → tool throws insufficient_credits error with the upgrade URL. Run list_generations to review what you've spent on.

Development

npm install
npm run build
npm test

# Run locally with stdio:
PIXELBANANAS_TOKEN=pba_live_xxx node dist/index.js

# Test the protocol handshake:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \
  | PIXELBANANAS_TOKEN=dummy node dist/index.js

Third-party

This package depends on @breezystack/lamejs (LGPL-3.0) for MP3 encoding. lamejs is loaded as a runtime dependency, not modified or bundled. To replace it with a different MP3 encoder, fork this package and substitute the implementation in src/encode/mp3.ts.

License

MIT © PixelBananas