Skip to main content
Glama

Bitcoin SV MCP Server

by b-open-io
getPublicKey.ts1.28 kB
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import type { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js"; import type { ServerNotification, ServerRequest, } from "@modelcontextprotocol/sdk/types.js"; import type { z } from "zod"; import { getPublicKeyArgsSchema } from "./schemas"; import type { Wallet } from "./wallet"; // Use the schema imported from schemas.ts export type GetPublicKeyArgs = z.infer<typeof getPublicKeyArgsSchema>; /** * Register the getPublicKey tool */ export function registerGetPublicKeyTool(server: McpServer, wallet: Wallet) { server.tool( "wallet_getPublicKey", "Retrieves the current wallet's public key. This public key can be used for cryptographic operations like signature verification or encryption.", { args: getPublicKeyArgsSchema }, async ( { args }: { args: GetPublicKeyArgs }, extra: RequestHandlerExtra<ServerRequest, ServerNotification>, ) => { try { const result = await wallet.getPublicKey(args); return { content: [{ type: "text", text: JSON.stringify(result) }] }; } catch (err: unknown) { const msg = err instanceof Error ? err.message : String(err); return { content: [{ type: "text", text: msg }], isError: true }; } }, ); }

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/b-open-io/bsv-mcp'

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