/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { IcrcmcpCore } from "../core.js"; import { SDKOptions } from "../lib/config.js"; import type { ConsoleLogger } from "./console-logger.js"; import { createRegisterPrompt } from "./prompts.js"; import { createRegisterResource, createRegisterResourceTemplate, } from "./resources.js"; import { MCPScope } from "./scopes.js"; import { createRegisterTool } from "./tools.js"; import { tool$accountBalancesListAccountBalancesApiV1LedgersLedgerCanisterIdAccountsAccountIdBalanceHistoryGet, } from "./tools/accountBalancesListAccountBalancesApiV1LedgersLedgerCanisterIdAccountsAccountIdBalanceHistoryGet.js"; import { tool$accountsCountAccountsApiV2LedgersLedgerCanisterIdAccountsCountGet } from "./tools/accountsCountAccountsApiV2LedgersLedgerCanisterIdAccountsCountGet.js"; import { tool$accountsCountTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsCountGet, } from "./tools/accountsCountTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsCountGet.js"; import { tool$accountsGetAccountApiV1LedgersLedgerCanisterIdAccountsIdGet } from "./tools/accountsGetAccountApiV1LedgersLedgerCanisterIdAccountsIdGet.js"; import { tool$accountsListAccountsApiV1LedgersLedgerCanisterIdAccountsGet } from "./tools/accountsListAccountsApiV1LedgersLedgerCanisterIdAccountsGet.js"; import { tool$accountsListAccountsApiV2LedgersLedgerCanisterIdAccountsGet } from "./tools/accountsListAccountsApiV2LedgersLedgerCanisterIdAccountsGet.js"; import { tool$accountsListAccountTransactionsApiV1LedgersLedgerCanisterIdAccountsIdTransactionsGet, } from "./tools/accountsListAccountTransactionsApiV1LedgersLedgerCanisterIdAccountsIdTransactionsGet.js"; import { tool$accountsListAccountTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsGet, } from "./tools/accountsListAccountTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsGet.js"; import { tool$blocksGetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGet } from "./tools/blocksGetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGet.js"; import { tool$blocksListBlocksApiV1LedgersLedgerCanisterIdBlocksGet } from "./tools/blocksListBlocksApiV1LedgersLedgerCanisterIdBlocksGet.js"; import { tool$canistersListCanistersApiV1LedgersLedgerCanisterIdCanistersGet } from "./tools/canistersListCanistersApiV1LedgersLedgerCanisterIdCanistersGet.js"; import { tool$circulatingSupplyGetCirculatingSupplyApiV1LedgersLedgerCanisterIdCirculatingSupplyGet, } from "./tools/circulatingSupplyGetCirculatingSupplyApiV1LedgersLedgerCanisterIdCirculatingSupplyGet.js"; import { tool$circulatingSupplyGetCirculatingSupplyTxtApiV1LedgersLedgerCanisterIdCirculatingSupplyTxtGet, } from "./tools/circulatingSupplyGetCirculatingSupplyTxtApiV1LedgersLedgerCanisterIdCirculatingSupplyTxtGet.js"; import { tool$imagesGetLedgerImageApiV1ImagesLedgersLedgerCanisterIdPngGet } from "./tools/imagesGetLedgerImageApiV1ImagesLedgersLedgerCanisterIdPngGet.js"; import { tool$imagesGetLedgerTransactionsImageApiV1ImagesLedgersLedgerCanisterIdTransactionsPngGet, } from "./tools/imagesGetLedgerTransactionsImageApiV1ImagesLedgersLedgerCanisterIdTransactionsPngGet.js"; import { tool$imagesGetSnsAccountImageApiV1ImagesLedgersLedgerCanisterIdAccountsIdPngGet } from "./tools/imagesGetSnsAccountImageApiV1ImagesLedgersLedgerCanisterIdAccountsIdPngGet.js"; import { tool$imagesGetSnsTransactionImageApiV1ImagesLedgersLedgerCanisterIdTransactionsIndexPngGet, } from "./tools/imagesGetSnsTransactionImageApiV1ImagesLedgersLedgerCanisterIdTransactionsIndexPngGet.js"; import { tool$ledgersCountLedgersApiV2LedgersCountGet } from "./tools/ledgersCountLedgersApiV2LedgersCountGet.js"; import { tool$ledgersListApiV1LedgersGet } from "./tools/ledgersListApiV1LedgersGet.js"; import { tool$ledgersListApiV2LedgersGet } from "./tools/ledgersListApiV2LedgersGet.js"; import { tool$ledgersRetrieveApiV1LedgersLedgerCanisterIdGet } from "./tools/ledgersRetrieveApiV1LedgersLedgerCanisterIdGet.js"; import { tool$ledgersRetrieveApiV2LedgersLedgerCanisterIdGet } from "./tools/ledgersRetrieveApiV2LedgersLedgerCanisterIdGet.js"; import { tool$totalBurnedPerDayListTotalBurnedPerDayApiV1LedgersLedgerCanisterIdTotalBurnedPerDayGet, } from "./tools/totalBurnedPerDayListTotalBurnedPerDayApiV1LedgersLedgerCanisterIdTotalBurnedPerDayGet.js"; import { tool$totalNewAccountsPerDayListTotalNewAccountsPerDayApiV1LedgersLedgerCanisterIdTotalNewAccountsPerDayGet, } from "./tools/totalNewAccountsPerDayListTotalNewAccountsPerDayApiV1LedgersLedgerCanisterIdTotalNewAccountsPerDayGet.js"; import { tool$totalNewAccountsPerDayListTotalNewAccountsTillDateApiV1LedgersLedgerCanisterIdTotalNewAccountsTillDateGet, } from "./tools/totalNewAccountsPerDayListTotalNewAccountsTillDateApiV1LedgersLedgerCanisterIdTotalNewAccountsTillDateGet.js"; import { tool$totalSupplyGetTotalSupplyApiV2LedgersLedgerCanisterIdTotalSupplyGet } from "./tools/totalSupplyGetTotalSupplyApiV2LedgersLedgerCanisterIdTotalSupplyGet.js"; import { tool$totalSupplyGetTotalSupplyTxtApiV2LedgersLedgerCanisterIdTotalSupplyTxtGet } from "./tools/totalSupplyGetTotalSupplyTxtApiV2LedgersLedgerCanisterIdTotalSupplyTxtGet.js"; import { tool$totalSupplySeriesApiV1LedgersLedgerCanisterIdTotalSupplyGet } from "./tools/totalSupplySeriesApiV1LedgersLedgerCanisterIdTotalSupplyGet.js"; import { tool$transactionCountListChainKeyTransactionCountApiV1ChainKeyLedgersTransactionCountGet, } from "./tools/transactionCountListChainKeyTransactionCountApiV1ChainKeyLedgersTransactionCountGet.js"; import { tool$transactionCountListChainKeyTransactionCountApiV2TransactionCountGet } from "./tools/transactionCountListChainKeyTransactionCountApiV2TransactionCountGet.js"; import { tool$transactionsCountTransactionsApiV2LedgersLedgerCanisterIdTransactionsCountGet, } from "./tools/transactionsCountTransactionsApiV2LedgersLedgerCanisterIdTransactionsCountGet.js"; import { tool$transactionsGetTansactionApiV1LedgersLedgerCanisterIdTransactionsIndexGet } from "./tools/transactionsGetTansactionApiV1LedgersLedgerCanisterIdTransactionsIndexGet.js"; import { tool$transactionsListTransactionsApiV1LedgersLedgerCanisterIdTransactionsGet } from "./tools/transactionsListTransactionsApiV1LedgersLedgerCanisterIdTransactionsGet.js"; import { tool$transactionsListTransactionsApiV2LedgersLedgerCanisterIdTransactionsGet } from "./tools/transactionsListTransactionsApiV2LedgersLedgerCanisterIdTransactionsGet.js"; import { tool$transactionVolumeListTransactionVolumeApiV1LedgersLedgerCanisterIdTransactionVolumeGet, } from "./tools/transactionVolumeListTransactionVolumeApiV1LedgersLedgerCanisterIdTransactionVolumeGet.js"; export function createMCPServer(deps: { logger: ConsoleLogger; allowedTools?: string[] | undefined; scopes?: MCPScope[] | undefined; serverURL: string; serverIdx?: SDKOptions["serverIdx"] | undefined; }) { const server = new McpServer({ name: "Icrcmcp", version: "0.0.1", }); const client = new IcrcmcpCore({ serverURL: deps.serverURL, serverIdx: deps.serverIdx, }); const scopes = new Set(deps.scopes); const allowedTools = deps.allowedTools && new Set(deps.allowedTools); const tool = createRegisterTool( deps.logger, server, client, scopes, allowedTools, ); const resource = createRegisterResource(deps.logger, server, client, scopes); const resourceTemplate = createRegisterResourceTemplate( deps.logger, server, client, scopes, ); const prompt = createRegisterPrompt(deps.logger, server, client, scopes); const register = { tool, resource, resourceTemplate, prompt }; void register; // suppress unused warnings tool( tool$accountBalancesListAccountBalancesApiV1LedgersLedgerCanisterIdAccountsAccountIdBalanceHistoryGet, ); tool(tool$accountsListAccountsApiV1LedgersLedgerCanisterIdAccountsGet); tool( tool$accountsListAccountTransactionsApiV1LedgersLedgerCanisterIdAccountsIdTransactionsGet, ); tool(tool$accountsGetAccountApiV1LedgersLedgerCanisterIdAccountsIdGet); tool(tool$accountsCountAccountsApiV2LedgersLedgerCanisterIdAccountsCountGet); tool(tool$accountsListAccountsApiV2LedgersLedgerCanisterIdAccountsGet); tool( tool$accountsListAccountTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsGet, ); tool( tool$accountsCountTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsCountGet, ); tool(tool$blocksListBlocksApiV1LedgersLedgerCanisterIdBlocksGet); tool(tool$blocksGetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGet); tool(tool$canistersListCanistersApiV1LedgersLedgerCanisterIdCanistersGet); tool( tool$circulatingSupplyGetCirculatingSupplyApiV1LedgersLedgerCanisterIdCirculatingSupplyGet, ); tool( tool$circulatingSupplyGetCirculatingSupplyTxtApiV1LedgersLedgerCanisterIdCirculatingSupplyTxtGet, ); tool( tool$imagesGetLedgerTransactionsImageApiV1ImagesLedgersLedgerCanisterIdTransactionsPngGet, ); tool( tool$imagesGetSnsTransactionImageApiV1ImagesLedgersLedgerCanisterIdTransactionsIndexPngGet, ); tool( tool$imagesGetSnsAccountImageApiV1ImagesLedgersLedgerCanisterIdAccountsIdPngGet, ); tool(tool$imagesGetLedgerImageApiV1ImagesLedgersLedgerCanisterIdPngGet); tool(tool$ledgersListApiV1LedgersGet); tool(tool$ledgersRetrieveApiV1LedgersLedgerCanisterIdGet); tool(tool$ledgersListApiV2LedgersGet); tool(tool$ledgersCountLedgersApiV2LedgersCountGet); tool(tool$ledgersRetrieveApiV2LedgersLedgerCanisterIdGet); tool( tool$totalBurnedPerDayListTotalBurnedPerDayApiV1LedgersLedgerCanisterIdTotalBurnedPerDayGet, ); tool( tool$totalNewAccountsPerDayListTotalNewAccountsPerDayApiV1LedgersLedgerCanisterIdTotalNewAccountsPerDayGet, ); tool( tool$totalNewAccountsPerDayListTotalNewAccountsTillDateApiV1LedgersLedgerCanisterIdTotalNewAccountsTillDateGet, ); tool( tool$transactionsListTransactionsApiV1LedgersLedgerCanisterIdTransactionsGet, ); tool( tool$transactionsGetTansactionApiV1LedgersLedgerCanisterIdTransactionsIndexGet, ); tool( tool$transactionsListTransactionsApiV2LedgersLedgerCanisterIdTransactionsGet, ); tool( tool$transactionsCountTransactionsApiV2LedgersLedgerCanisterIdTransactionsCountGet, ); tool( tool$transactionCountListChainKeyTransactionCountApiV1ChainKeyLedgersTransactionCountGet, ); tool( tool$transactionCountListChainKeyTransactionCountApiV2TransactionCountGet, ); tool( tool$transactionVolumeListTransactionVolumeApiV1LedgersLedgerCanisterIdTransactionVolumeGet, ); tool(tool$totalSupplySeriesApiV1LedgersLedgerCanisterIdTotalSupplyGet); tool( tool$totalSupplyGetTotalSupplyApiV2LedgersLedgerCanisterIdTotalSupplyGet, ); tool( tool$totalSupplyGetTotalSupplyTxtApiV2LedgersLedgerCanisterIdTotalSupplyTxtGet, ); return server; }