launch-token
Deploy a meme token on Solana using the Raydium launchpad via bonk-mcp MCP Server. Enter token details like name, symbol, description, and image URL to start.
Instructions
Launch a new meme token on Solana using Raydium launchpad
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | Token description | |
| image_url | Yes | Image URL to use for token | |
| name | Yes | Token name | |
| symbol | Yes | Token symbol/ticker | |
| telegram | No | Telegram group URL (optional) | |
| No | Twitter handle/URL (optional) | ||
| website | No | Website URL (optional) |
Implementation Reference
- The async execute method that implements the core logic of the "launch-token" tool, including input validation, IPFS metadata preparation, token launching via Raydium, error handling, and response generation.async def execute(self, arguments: Dict) -> List[TextContent | ImageContent | EmbeddedResource]: """ Execute the token launcher tool with the provided arguments Args: arguments: Dictionary containing token configuration Returns: List of content items with the result """ # Extract arguments name = arguments.get("name") symbol = arguments.get("symbol") description = arguments.get("description") twitter = arguments.get("twitter", "") telegram = arguments.get("telegram", "") website = arguments.get("website", "") image_url = arguments.get("image_url", "") # Validate required arguments if not name or not symbol or not description or not image_url: return [TextContent( type="text", text="Error: Missing required parameters. Please provide name, symbol, description, and image_url." )] # Get the payer keypair from settings if not KEYPAIR: return [TextContent( type="text", text="Error: No keypair configured in settings. Please set the KEYPAIR environment variable." )] try: # Convert the private key to a Keypair private_key_bytes = base58.b58decode(KEYPAIR) payer_keypair = Keypair.from_bytes(private_key_bytes) except Exception as e: return [TextContent( type="text", text=f"Error: Invalid keypair format. {str(e)}" )] # Generate keypair for token mint mint_keypair = Keypair() # Prepare IPFS metadata - this handles image upload and metadata creation print(f"Preparing IPFS metadata for {name} ({symbol})...") uri = await prepare_ipfs( name=name, symbol=symbol, description=description, twitter=twitter, telegram=telegram, website=website, image_url=image_url ) if not uri: return [TextContent( type="text", text="Error: Failed to prepare IPFS metadata. Please check your image URL and try again." )] # Launch token print(f"Launching token {name} ({symbol})...") launch_result = await launch_token_with_buy( payer_keypair=payer_keypair, mint_keypair=mint_keypair, name=name, symbol=symbol, uri=uri ) # Process results if launch_result.get("error"): return [TextContent( type="text", text=f"Error launching token: {launch_result['error']}" )] # Format successful response mint_address = mint_keypair.pubkey() pdas = launch_result["pdas"] response_text = ( f"🚀 Successfully launched token: {name} ({symbol})\n\n" f"Mint Address: {mint_address}\n" f"Pool State: {pdas['pool_state']}\n" f"Token URI: {uri}\n" f"Image URL: {image_url}\n\n" f"Funded from account: {payer_keypair.pubkey()}\n\n" "---\n" "**[Test Info]**\n" f"🧪 Test Wallet: {TEST_SOLANA_WALLET}\n" f"🧪 Test Contract Address (CA): {TEST_SOLANA_CA}\n" f"🧪 Test Transaction Hash: {TEST_TRANSACTION_HASH}\n" ) return [TextContent( type="text", text=response_text )]
- JSON schema defining the input parameters (name, symbol, description, image_url required; twitter, telegram, website optional) for the launch-token tool.self.input_schema = { "type": "object", "properties": { "name": {"type": "string", "description": "Token name"}, "symbol": {"type": "string", "description": "Token symbol/ticker"}, "description": {"type": "string", "description": "Token description"}, "twitter": {"type": "string", "description": "Twitter handle/URL (optional)"}, "telegram": {"type": "string", "description": "Telegram group URL (optional)"}, "website": {"type": "string", "description": "Website URL (optional)"}, "image_url": {"type": "string", "description": "Image URL to use for token"} }, "required": ["name", "symbol", "description", "image_url"] }
- src/bonk_mcp/server.py:104-112 (registration)MCP server list_tools handler that registers and exposes the "launch-token" tool by returning its Tool definition.@server.list_tools() async def handle_list_tools() -> list[types.Tool]: """ List available tools. Each tool specifies its arguments using JSON Schema validation. """ return [ token_launcher_tool.get_tool_definition() ]
- src/bonk_mcp/server.py:115-131 (registration)MCP server call_tool handler that dispatches invocations of the "launch-token" tool to its execute method.@server.call_tool() async def handle_call_tool( name: str, arguments: dict | None ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]: """ Handle tool execution requests. Tools can modify server state and notify clients of changes. """ if name != "launch-token": raise ValueError(f"Unknown tool: {name}") if not arguments: raise ValueError("Missing arguments") # Execute the token launcher tool return await token_launcher_tool.execute(arguments)