/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { IcpmcpCore } 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$accountAccountBalance } from "./tools/accountAccountBalance.js";
import { tool$accountAccountCoins } from "./tools/accountAccountCoins.js";
import { tool$blockBlock } from "./tools/blockBlock.js";
import { tool$blockBlockTransaction } from "./tools/blockBlockTransaction.js";
import { tool$callCall } from "./tools/callCall.js";
import { tool$constructionConstructionCombine } from "./tools/constructionConstructionCombine.js";
import { tool$constructionConstructionDerive } from "./tools/constructionConstructionDerive.js";
import { tool$constructionConstructionHash } from "./tools/constructionConstructionHash.js";
import { tool$constructionConstructionMetadata } from "./tools/constructionConstructionMetadata.js";
import { tool$constructionConstructionParse } from "./tools/constructionConstructionParse.js";
import { tool$constructionConstructionPayloads } from "./tools/constructionConstructionPayloads.js";
import { tool$constructionConstructionPreprocess } from "./tools/constructionConstructionPreprocess.js";
import { tool$constructionConstructionSubmit } from "./tools/constructionConstructionSubmit.js";
import { tool$eventsEventsBlocks } from "./tools/eventsEventsBlocks.js";
import { tool$mempoolMempool } from "./tools/mempoolMempool.js";
import { tool$mempoolMempoolTransaction } from "./tools/mempoolMempoolTransaction.js";
import { tool$networkNetworkList } from "./tools/networkNetworkList.js";
import { tool$networkNetworkOptions } from "./tools/networkNetworkOptions.js";
import { tool$networkNetworkStatus } from "./tools/networkNetworkStatus.js";
import { tool$searchSearchTransactions } from "./tools/searchSearchTransactions.js";
export function createMCPServer(deps: {
logger: ConsoleLogger;
allowedTools?: string[] | undefined;
scopes?: MCPScope[] | undefined;
serverURL: string;
serverIdx?: SDKOptions["serverIdx"] | undefined;
}) {
const server = new McpServer({
name: "icpmcp-rosetta-api",
version: "0.0.1",
});
const client = new IcpmcpCore({
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$networkNetworkList);
tool(tool$networkNetworkStatus);
tool(tool$networkNetworkOptions);
tool(tool$blockBlock);
tool(tool$blockBlockTransaction);
tool(tool$mempoolMempool);
tool(tool$mempoolMempoolTransaction);
tool(tool$accountAccountBalance);
tool(tool$accountAccountCoins);
tool(tool$constructionConstructionDerive);
tool(tool$constructionConstructionPreprocess);
tool(tool$constructionConstructionMetadata);
tool(tool$constructionConstructionPayloads);
tool(tool$constructionConstructionCombine);
tool(tool$constructionConstructionParse);
tool(tool$constructionConstructionHash);
tool(tool$constructionConstructionSubmit);
tool(tool$callCall);
tool(tool$eventsEventsBlocks);
tool(tool$searchSearchTransactions);
return server;
}