/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { HedgewiseCore } 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$assetsGetCategories } from "./tools/assetsGetCategories.js"; import { tool$dataGetMetadata } from "./tools/dataGetMetadata.js"; import { tool$datasetsGetDatasets } from "./tools/datasetsGetDatasets.js"; import { tool$featuresGetHistoricalValues } from "./tools/featuresGetHistoricalValues.js"; import { tool$featuresGetTransformedValues } from "./tools/featuresGetTransformedValues.js"; import { tool$featuresGetTree } from "./tools/featuresGetTree.js"; import { tool$featuresGetWeightedIndex } from "./tools/featuresGetWeightedIndex.js"; import { tool$featuresList } from "./tools/featuresList.js"; import { tool$forexGetPrices } from "./tools/forexGetPrices.js"; import { tool$forexListPrices } from "./tools/forexListPrices.js"; import { tool$futuresGetCalendar } from "./tools/futuresGetCalendar.js"; import { tool$futuresGetForecasts } from "./tools/futuresGetForecasts.js"; import { tool$futuresGetHedgeIndicator } from "./tools/futuresGetHedgeIndicator.js"; import { tool$futuresGetLongTermForecast } from "./tools/futuresGetLongTermForecast.js"; import { tool$futuresGetPrices } from "./tools/futuresGetPrices.js"; import { tool$futuresList } from "./tools/futuresList.js"; import { tool$getFuturesForecastsModels } from "./tools/getFuturesForecastsModels.js"; import { tool$getModelOutput } from "./tools/getModelOutput.js"; import { tool$getSupplyPhenology } from "./tools/getSupplyPhenology.js"; import { tool$indicatorsList } from "./tools/indicatorsList.js"; import { tool$performanceMetricsGet } from "./tools/performanceMetricsGet.js"; import { tool$performanceMetricsList } from "./tools/performanceMetricsList.js"; import { tool$postFuturesForecasts } from "./tools/postFuturesForecasts.js"; import { tool$sectorIndicesGet } from "./tools/sectorIndicesGet.js"; import { tool$strategiesGetStrategies } from "./tools/strategiesGetStrategies.js"; import { tool$strategiesGetStrategy } from "./tools/strategiesGetStrategy.js"; import { tool$strategiesGetStrategyForecast } from "./tools/strategiesGetStrategyForecast.js"; import { tool$supplyGet } from "./tools/supplyGet.js"; import { tool$supplyListCommodities } from "./tools/supplyListCommodities.js"; import { tool$systemPing } from "./tools/systemPing.js"; import { tool$userRegistration } from "./tools/userRegistration.js"; export function createMCPServer(deps: { logger: ConsoleLogger; allowedTools?: string[] | undefined; scopes?: MCPScope[] | undefined; serverURL: string; bearerAuth?: SDKOptions["bearerAuth"] | undefined; serverIdx?: SDKOptions["serverIdx"] | undefined; }) { const server = new McpServer({ name: "Hedgewise", version: "0.7.0", }); const client = new HedgewiseCore({ bearerAuth: deps.bearerAuth, 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$postFuturesForecasts); tool(tool$getFuturesForecastsModels); tool(tool$getModelOutput); tool(tool$getSupplyPhenology); tool(tool$userRegistration); tool(tool$systemPing); tool(tool$dataGetMetadata); tool(tool$assetsGetCategories); tool(tool$futuresList); tool(tool$futuresGetCalendar); tool(tool$futuresGetForecasts); tool(tool$futuresGetLongTermForecast); tool(tool$futuresGetHedgeIndicator); tool(tool$futuresGetPrices); tool(tool$indicatorsList); tool(tool$forexListPrices); tool(tool$forexGetPrices); tool(tool$featuresGetTree); tool(tool$featuresList); tool(tool$featuresGetHistoricalValues); tool(tool$featuresGetTransformedValues); tool(tool$featuresGetWeightedIndex); tool(tool$sectorIndicesGet); tool(tool$performanceMetricsList); tool(tool$performanceMetricsGet); tool(tool$supplyListCommodities); tool(tool$supplyGet); tool(tool$datasetsGetDatasets); tool(tool$strategiesGetStrategies); tool(tool$strategiesGetStrategy); tool(tool$strategiesGetStrategyForecast); return server; }