PA

paean-ai/opensuno

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

11 stars 4 forks Качество 74 Тренд 18LGPL-3.0

Open Suno API & MCP for AI Agent

Обзор

Open-source Suno AI API with Chrome Extension bridge — zero-config auth & automatic captcha bypass. Built with Claude Code & Paean AI. Two modes of operation: (Chrome Extension — recommended) and (server-side). : Suno's API relies on Clerk sessions for authentication, but Clerk frequently returns empty sessions (sessions: []), causing 401 Unauthorized errors. : Suno's API requires hCaptcha for music generation when an account has consumed fewer than ~200 credits. Server-side approaches fail with "Token validation failed" (422) because they can't provide a valid captcha token. : OpenSuno offers two approaches: - (Recommended) — A Chrome extension runs on suno.com, making API calls FROM the browser context. Authentication and captcha are handled natively. A local bridge server exposes REST API + MCP interfaces, forwarding requests to the extension via WebSocket.

README

Показан фрагмент оригинального README. Открыть оригинал.

OpenSuno

Open-source Suno AI API with Chrome Extension bridge — zero-config auth & automatic captcha bypass. Built with Claude Code & Paean AI.

Two modes of operation: Bridge Mode (Chrome Extension — recommended) and Cookie Mode (server-side).

Why OpenSuno?

Problem 1: Suno’s API relies on Clerk sessions for authentication, but Clerk frequently returns empty sessions (sessions: []), causing 401 Unauthorized errors.

Problem 2: Suno’s API requires hCaptcha for music generation when an account has consumed fewer than ~200 credits. Server-side approaches fail with “Token validation failed” (422) because they can’t provide a valid captcha token.

Solution: OpenSuno offers two approaches:

  • Bridge Mode (Recommended) — A Chrome extension runs on suno.com, making API calls FROM the browser context. Authentication and captcha are handled natively. A local bridge server exposes REST API + MCP interfaces, forwarding requests to the extension via WebSocket.
  • Cookie Mode — Extract JWT tokens from the browser (works but requires manual token refresh and may hit captcha blocks)

Features

  • Chrome Extension + Bridge Server — zero-config auth, automatic captcha bypass, no token expiry
  • MCP server — use as a tool provider for Claude Desktop, Cursor, or any MCP-compatible AI agent
  • Direct JWT Token authentication (Cookie Mode) — extract from browser Network tab
  • All Suno model versions supported (V4 / V4.5+ / V4.5 Pro / V5)
  • OpenAI-compatible /v1/chat/completions endpoint
  • Web-based cookie management UI at /cookie
  • One-click Vercel deployment (Cookie Mode)

Bridge Mode uses a Chrome extension + local bridge server. The extension runs on your open suno.com tab, handling authentication and captcha natively. External clients (curl, AI agents) talk to the bridge server, which forwards requests to the extension via WebSocket.

Architecture

External Clients (curl, AI agents, etc.)
         │
         ▼
┌─────────────────────────┐
│   Bridge Server (Bun)   │
│   Port 3001             │
│  ┌───────────────────┐  │
│  │ REST API endpoints │  │  ← curl / HTTP clients
│  │ /api/generate etc  │  │
│  ├───────────────────┤  │
│  │ MCP Server         │  │  ← AI agents (Claude, Cursor)
│  │ /mcp (Streamable)  │  │
│  ├───────────────────┤  │
│  │ WebSocket /ws      │──│──┐
│  └───────────────────┘  │  │
└─────────────────────────┘  │  WebSocket
                              │
┌─────────────────────────┐  │
│  Chrome Extension        │  │
│  (on suno.com tab)       │◄─┘
│  ┌───────────────────┐  │
│  │ Content Script     │  │  → Orchestrates messaging
│  ├───────────────────┤  │
│  │ Page Script        │  │  → Accesses Clerk (JWT)
│  │ (MAIN world)       │  │    + hCaptcha tokens
│  ├───────────────────┤  │
│  │ Background Worker  │  │  → Makes API calls to Suno
│  │                    │  │    (bypasses CORS)
│  ├───────────────────┤  │
│  │ Popup (status UI)  │  │
Открыть полный README на GitHub

Установка

docker run -d -p 3000:3000 \
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "suno": { "type": "url", "url": "http://localhost:3001/mcp" } } }