Skip to main content
Glama

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
NameRequiredDescriptionDefault
descriptionYesToken description
image_urlYesImage URL to use for token
nameYesToken name
symbolYesToken symbol/ticker
telegramNoTelegram group URL (optional)
twitterNoTwitter handle/URL (optional)
websiteNoWebsite 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"]
    }
  • 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()
        ]
  • 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)
Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bjoernbonk/letsbonk_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server