Skip to main content
Glama

Crossmint HR Airdrop MCP

by monostate

connect_crossmint_wallet

Link a Crossmint wallet to the HR Airdrop MCP server using an email and API key to enable Solana token distribution for employees.

Instructions

Connect a Crossmint wallet to the airdrop server

Input Schema

NameRequiredDescriptionDefault
apiKeyYesCrossmint API key
emailYesEmail address associated with the Crossmint wallet

Input Schema (JSON Schema)

{ "properties": { "apiKey": { "description": "Crossmint API key", "type": "string" }, "email": { "description": "Email address associated with the Crossmint wallet", "type": "string" } }, "required": [ "email", "apiKey" ], "type": "object" }

Implementation Reference

  • Main handler function for 'connect_crossmint_wallet' tool. Validates input with Zod, initializes Crossmint client with API key, retrieves custodial Solana wallet for the given email, extracts public key and sets default SOL balance, updates server state with connected wallet info. Includes fallback to simulation mode on connection error and prompts for API key if missing.
    private async handleConnectCrossmintWallet(args: any) { try { // Validate input const schema = z.object({ email: z.string().email(), apiKey: z.string().optional(), }); const { email, apiKey: providedApiKey } = schema.parse(args); // Check if API key is provided, if not, prompt the user if (!providedApiKey) { return { content: [ { type: 'text', text: `To connect a Crossmint wallet, I need your Crossmint API key. You can get this from the Crossmint developer dashboard at https://www.crossmint.com/ Please provide your Crossmint API key to continue.`, }, ], }; } const apiKey = providedApiKey; console.error(`Connecting Crossmint wallet for ${email}`); try { // In production mode, attempt to connect to the real Crossmint wallet console.error('PRODUCTION MODE: Attempting to connect to real Crossmint wallet'); // Initialize Crossmint client const crossmintClient = crossmint(apiKey); // Get the wallet for this email const wallet = await crossmintClient.custodial({ chain: "solana", connection: new Connection('https://api.mainnet-beta.solana.com', 'confirmed'), email }); // Get the wallet address const publicKey = wallet.getAddress(); // Get the SOL balance (in a real implementation, we would query the blockchain) // For now, we'll use a default value const solBalance = 1.0; console.error(`Successfully connected to real Crossmint wallet: ${publicKey}`); // Update state this.state.connectedWallet = { publicKey, solBalance, }; return { content: [ { type: 'text', text: `Crossmint wallet connected successfully for ${email}.\nPublic Key: ${publicKey}\nSOL Balance: ${solBalance} SOL`, }, ], }; } catch (error) { console.error('Error connecting to real Crossmint wallet, falling back to simulation:', error); // Generate a pseudo-random wallet address const publicKey = `crossmint_${Math.random().toString(36).substring(2, 10)}`; const solBalance = 1.0; // Default SOL balance for demo // Update state this.state.connectedWallet = { publicKey, solBalance, }; return { content: [ { type: 'text', text: `Crossmint wallet connected successfully for ${email}.\nPublic Key: ${publicKey}\nSOL Balance: ${solBalance} SOL\n\n(Note: Using simulation mode due to connection error)`, }, ], }; } } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to connect Crossmint wallet: ${error instanceof Error ? error.message : String(error)}` ); } }
  • src/server.ts:134-150 (registration)
    Tool registration in ListToolsRequestSchema handler, including name, description, and input schema requiring 'email' and 'apiKey'.
    name: 'connect_crossmint_wallet', description: 'Connect a Crossmint wallet to the airdrop server', inputSchema: { type: 'object', properties: { email: { type: 'string', description: 'Email address associated with the Crossmint wallet', }, apiKey: { type: 'string', description: 'Crossmint API key', }, }, required: ['email', 'apiKey'], }, },
  • Zod schema for input validation inside the handler, requiring valid email and optional apiKey.
    const schema = z.object({ email: z.string().email(), apiKey: z.string().optional(), });
  • src/server.ts:316-317 (registration)
    Dispatch case in CallToolRequestSchema switch statement that routes to the handler function.
    case 'connect_crossmint_wallet': return await this.handleConnectCrossmintWallet(args);

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/monostate/Employees-Airdrop-Rewards-MCP'

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