/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { ProwlarrCore } 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$apiInfoGetApi } from "./tools/apiInfoGetApi.js"; import { tool$applicationDeleteApiV1ApplicationsBulk } from "./tools/applicationDeleteApiV1ApplicationsBulk.js"; import { tool$applicationDeleteApiV1ApplicationsId } from "./tools/applicationDeleteApiV1ApplicationsId.js"; import { tool$applicationGetApiV1Applications } from "./tools/applicationGetApiV1Applications.js"; import { tool$applicationGetApiV1ApplicationsId } from "./tools/applicationGetApiV1ApplicationsId.js"; import { tool$applicationGetApiV1ApplicationsSchema } from "./tools/applicationGetApiV1ApplicationsSchema.js"; import { tool$applicationPostApiV1Applications } from "./tools/applicationPostApiV1Applications.js"; import { tool$applicationPostApiV1ApplicationsActionName } from "./tools/applicationPostApiV1ApplicationsActionName.js"; import { tool$applicationPostApiV1ApplicationsTest } from "./tools/applicationPostApiV1ApplicationsTest.js"; import { tool$applicationPostApiV1ApplicationsTestall } from "./tools/applicationPostApiV1ApplicationsTestall.js"; import { tool$applicationPutApiV1ApplicationsBulk } from "./tools/applicationPutApiV1ApplicationsBulk.js"; import { tool$applicationPutApiV1ApplicationsId } from "./tools/applicationPutApiV1ApplicationsId.js"; import { tool$appProfileDeleteApiV1AppprofileId } from "./tools/appProfileDeleteApiV1AppprofileId.js"; import { tool$appProfileGetApiV1Appprofile } from "./tools/appProfileGetApiV1Appprofile.js"; import { tool$appProfileGetApiV1AppprofileId } from "./tools/appProfileGetApiV1AppprofileId.js"; import { tool$appProfileGetApiV1AppprofileSchema } from "./tools/appProfileGetApiV1AppprofileSchema.js"; import { tool$appProfilePostApiV1Appprofile } from "./tools/appProfilePostApiV1Appprofile.js"; import { tool$appProfilePutApiV1AppprofileId } from "./tools/appProfilePutApiV1AppprofileId.js"; import { tool$authenticationGetLogout } from "./tools/authenticationGetLogout.js"; import { tool$backupDeleteApiV1SystemBackupId } from "./tools/backupDeleteApiV1SystemBackupId.js"; import { tool$backupGetApiV1SystemBackup } from "./tools/backupGetApiV1SystemBackup.js"; import { tool$backupPostApiV1SystemBackupRestoreId } from "./tools/backupPostApiV1SystemBackupRestoreId.js"; import { tool$backupPostApiV1SystemBackupRestoreUpload } from "./tools/backupPostApiV1SystemBackupRestoreUpload.js"; import { tool$commandDeleteApiV1CommandId } from "./tools/commandDeleteApiV1CommandId.js"; import { tool$commandGetApiV1Command } from "./tools/commandGetApiV1Command.js"; import { tool$commandGetApiV1CommandId } from "./tools/commandGetApiV1CommandId.js"; import { tool$commandPostApiV1Command } from "./tools/commandPostApiV1Command.js"; import { tool$customFilterDeleteApiV1CustomfilterId } from "./tools/customFilterDeleteApiV1CustomfilterId.js"; import { tool$customFilterGetApiV1Customfilter } from "./tools/customFilterGetApiV1Customfilter.js"; import { tool$customFilterGetApiV1CustomfilterId } from "./tools/customFilterGetApiV1CustomfilterId.js"; import { tool$customFilterPostApiV1Customfilter } from "./tools/customFilterPostApiV1Customfilter.js"; import { tool$customFilterPutApiV1CustomfilterId } from "./tools/customFilterPutApiV1CustomfilterId.js"; import { tool$developmentConfigGetApiV1ConfigDevelopment } from "./tools/developmentConfigGetApiV1ConfigDevelopment.js"; import { tool$developmentConfigGetApiV1ConfigDevelopmentId } from "./tools/developmentConfigGetApiV1ConfigDevelopmentId.js"; import { tool$developmentConfigPutApiV1ConfigDevelopmentId } from "./tools/developmentConfigPutApiV1ConfigDevelopmentId.js"; import { tool$downloadClientConfigGetApiV1ConfigDownloadclient } from "./tools/downloadClientConfigGetApiV1ConfigDownloadclient.js"; import { tool$downloadClientConfigGetApiV1ConfigDownloadclientId } from "./tools/downloadClientConfigGetApiV1ConfigDownloadclientId.js"; import { tool$downloadClientConfigPutApiV1ConfigDownloadclientId } from "./tools/downloadClientConfigPutApiV1ConfigDownloadclientId.js"; import { tool$downloadClientDeleteApiV1DownloadclientBulk } from "./tools/downloadClientDeleteApiV1DownloadclientBulk.js"; import { tool$downloadClientDeleteApiV1DownloadclientId } from "./tools/downloadClientDeleteApiV1DownloadclientId.js"; import { tool$downloadClientGetApiV1Downloadclient } from "./tools/downloadClientGetApiV1Downloadclient.js"; import { tool$downloadClientGetApiV1DownloadclientId } from "./tools/downloadClientGetApiV1DownloadclientId.js"; import { tool$downloadClientGetApiV1DownloadclientSchema } from "./tools/downloadClientGetApiV1DownloadclientSchema.js"; import { tool$downloadClientPostApiV1Downloadclient } from "./tools/downloadClientPostApiV1Downloadclient.js"; import { tool$downloadClientPostApiV1DownloadclientActionName } from "./tools/downloadClientPostApiV1DownloadclientActionName.js"; import { tool$downloadClientPostApiV1DownloadclientTest } from "./tools/downloadClientPostApiV1DownloadclientTest.js"; import { tool$downloadClientPostApiV1DownloadclientTestall } from "./tools/downloadClientPostApiV1DownloadclientTestall.js"; import { tool$downloadClientPutApiV1DownloadclientBulk } from "./tools/downloadClientPutApiV1DownloadclientBulk.js"; import { tool$downloadClientPutApiV1DownloadclientId } from "./tools/downloadClientPutApiV1DownloadclientId.js"; import { tool$fileSystemGetApiV1Filesystem } from "./tools/fileSystemGetApiV1Filesystem.js"; import { tool$fileSystemGetApiV1FilesystemType } from "./tools/fileSystemGetApiV1FilesystemType.js"; import { tool$healthGetApiV1Health } from "./tools/healthGetApiV1Health.js"; import { tool$historyGetApiV1History } from "./tools/historyGetApiV1History.js"; import { tool$historyGetApiV1HistoryIndexer } from "./tools/historyGetApiV1HistoryIndexer.js"; import { tool$historyGetApiV1HistorySince } from "./tools/historyGetApiV1HistorySince.js"; import { tool$hostConfigGetApiV1ConfigHost } from "./tools/hostConfigGetApiV1ConfigHost.js"; import { tool$hostConfigGetApiV1ConfigHostId } from "./tools/hostConfigGetApiV1ConfigHostId.js"; import { tool$hostConfigPutApiV1ConfigHostId } from "./tools/hostConfigPutApiV1ConfigHostId.js"; import { tool$indexerDefaultCategoriesGetApiV1IndexerCategories } from "./tools/indexerDefaultCategoriesGetApiV1IndexerCategories.js"; import { tool$indexerDeleteApiV1IndexerBulk } from "./tools/indexerDeleteApiV1IndexerBulk.js"; import { tool$indexerDeleteApiV1IndexerId } from "./tools/indexerDeleteApiV1IndexerId.js"; import { tool$indexerGetApiV1Indexer } from "./tools/indexerGetApiV1Indexer.js"; import { tool$indexerGetApiV1IndexerId } from "./tools/indexerGetApiV1IndexerId.js"; import { tool$indexerGetApiV1IndexerSchema } from "./tools/indexerGetApiV1IndexerSchema.js"; import { tool$indexerPostApiV1Indexer } from "./tools/indexerPostApiV1Indexer.js"; import { tool$indexerPostApiV1IndexerActionName } from "./tools/indexerPostApiV1IndexerActionName.js"; import { tool$indexerPostApiV1IndexerTest } from "./tools/indexerPostApiV1IndexerTest.js"; import { tool$indexerPostApiV1IndexerTestall } from "./tools/indexerPostApiV1IndexerTestall.js"; import { tool$indexerProxyDeleteApiV1IndexerproxyId } from "./tools/indexerProxyDeleteApiV1IndexerproxyId.js"; import { tool$indexerProxyGetApiV1Indexerproxy } from "./tools/indexerProxyGetApiV1Indexerproxy.js"; import { tool$indexerProxyGetApiV1IndexerproxyId } from "./tools/indexerProxyGetApiV1IndexerproxyId.js"; import { tool$indexerProxyGetApiV1IndexerproxySchema } from "./tools/indexerProxyGetApiV1IndexerproxySchema.js"; import { tool$indexerProxyPostApiV1Indexerproxy } from "./tools/indexerProxyPostApiV1Indexerproxy.js"; import { tool$indexerProxyPostApiV1IndexerproxyActionName } from "./tools/indexerProxyPostApiV1IndexerproxyActionName.js"; import { tool$indexerProxyPostApiV1IndexerproxyTest } from "./tools/indexerProxyPostApiV1IndexerproxyTest.js"; import { tool$indexerProxyPostApiV1IndexerproxyTestall } from "./tools/indexerProxyPostApiV1IndexerproxyTestall.js"; import { tool$indexerProxyPutApiV1IndexerproxyId } from "./tools/indexerProxyPutApiV1IndexerproxyId.js"; import { tool$indexerPutApiV1IndexerBulk } from "./tools/indexerPutApiV1IndexerBulk.js"; import { tool$indexerPutApiV1IndexerId } from "./tools/indexerPutApiV1IndexerId.js"; import { tool$indexerStatsGetApiV1Indexerstats } from "./tools/indexerStatsGetApiV1Indexerstats.js"; import { tool$indexerStatusGetApiV1Indexerstatus } from "./tools/indexerStatusGetApiV1Indexerstatus.js"; import { tool$localizationGetApiV1Localization } from "./tools/localizationGetApiV1Localization.js"; import { tool$localizationGetApiV1LocalizationOptions } from "./tools/localizationGetApiV1LocalizationOptions.js"; import { tool$logFileGetApiV1LogFile } from "./tools/logFileGetApiV1LogFile.js"; import { tool$logFileGetApiV1LogFileFilename } from "./tools/logFileGetApiV1LogFileFilename.js"; import { tool$logGetApiV1Log } from "./tools/logGetApiV1Log.js"; import { tool$newznabGetApiV1IndexerIdDownload } from "./tools/newznabGetApiV1IndexerIdDownload.js"; import { tool$newznabGetApiV1IndexerIdNewznab } from "./tools/newznabGetApiV1IndexerIdNewznab.js"; import { tool$newznabGetIdApi } from "./tools/newznabGetIdApi.js"; import { tool$newznabGetIdDownload } from "./tools/newznabGetIdDownload.js"; import { tool$notificationDeleteApiV1NotificationId } from "./tools/notificationDeleteApiV1NotificationId.js"; import { tool$notificationGetApiV1Notification } from "./tools/notificationGetApiV1Notification.js"; import { tool$notificationGetApiV1NotificationId } from "./tools/notificationGetApiV1NotificationId.js"; import { tool$notificationGetApiV1NotificationSchema } from "./tools/notificationGetApiV1NotificationSchema.js"; import { tool$notificationPostApiV1Notification } from "./tools/notificationPostApiV1Notification.js"; import { tool$notificationPostApiV1NotificationActionName } from "./tools/notificationPostApiV1NotificationActionName.js"; import { tool$notificationPostApiV1NotificationTest } from "./tools/notificationPostApiV1NotificationTest.js"; import { tool$notificationPostApiV1NotificationTestall } from "./tools/notificationPostApiV1NotificationTestall.js"; import { tool$notificationPutApiV1NotificationId } from "./tools/notificationPutApiV1NotificationId.js"; import { tool$pingGetPing } from "./tools/pingGetPing.js"; import { tool$pingHeadPing } from "./tools/pingHeadPing.js"; import { tool$searchGetApiV1Search } from "./tools/searchGetApiV1Search.js"; import { tool$searchPostApiV1Search } from "./tools/searchPostApiV1Search.js"; import { tool$searchPostApiV1SearchBulk } from "./tools/searchPostApiV1SearchBulk.js"; import { tool$staticResourceGet } from "./tools/staticResourceGet.js"; import { tool$staticResourceGetContentPath } from "./tools/staticResourceGetContentPath.js"; import { tool$staticResourceGetLogin } from "./tools/staticResourceGetLogin.js"; import { tool$staticResourceGetPath } from "./tools/staticResourceGetPath.js"; import { tool$systemGetApiV1SystemRoutes } from "./tools/systemGetApiV1SystemRoutes.js"; import { tool$systemGetApiV1SystemRoutesDuplicate } from "./tools/systemGetApiV1SystemRoutesDuplicate.js"; import { tool$systemGetApiV1SystemStatus } from "./tools/systemGetApiV1SystemStatus.js"; import { tool$systemPostApiV1SystemRestart } from "./tools/systemPostApiV1SystemRestart.js"; import { tool$systemPostApiV1SystemShutdown } from "./tools/systemPostApiV1SystemShutdown.js"; import { tool$tagDeleteApiV1TagId } from "./tools/tagDeleteApiV1TagId.js"; import { tool$tagDetailsGetApiV1TagDetail } from "./tools/tagDetailsGetApiV1TagDetail.js"; import { tool$tagDetailsGetApiV1TagDetailId } from "./tools/tagDetailsGetApiV1TagDetailId.js"; import { tool$tagGetApiV1Tag } from "./tools/tagGetApiV1Tag.js"; import { tool$tagGetApiV1TagId } from "./tools/tagGetApiV1TagId.js"; import { tool$tagPostApiV1Tag } from "./tools/tagPostApiV1Tag.js"; import { tool$tagPutApiV1TagId } from "./tools/tagPutApiV1TagId.js"; import { tool$taskGetApiV1SystemTask } from "./tools/taskGetApiV1SystemTask.js"; import { tool$taskGetApiV1SystemTaskId } from "./tools/taskGetApiV1SystemTaskId.js"; import { tool$uiConfigGetApiV1ConfigUi } from "./tools/uiConfigGetApiV1ConfigUi.js"; import { tool$uiConfigGetApiV1ConfigUiId } from "./tools/uiConfigGetApiV1ConfigUiId.js"; import { tool$uiConfigPutApiV1ConfigUiId } from "./tools/uiConfigPutApiV1ConfigUiId.js"; import { tool$updateGetApiV1Update } from "./tools/updateGetApiV1Update.js"; import { tool$updateLogFileGetApiV1LogFileUpdate } from "./tools/updateLogFileGetApiV1LogFileUpdate.js"; import { tool$updateLogFileGetApiV1LogFileUpdateFilename } from "./tools/updateLogFileGetApiV1LogFileUpdateFilename.js"; export function createMCPServer(deps: { logger: ConsoleLogger; allowedTools?: string[] | undefined; scopes?: MCPScope[] | undefined; serverURL?: string | undefined; security?: SDKOptions["security"] | undefined; serverIdx?: SDKOptions["serverIdx"] | undefined; protocol?: SDKOptions["protocol"] | undefined; hostpath?: SDKOptions["hostpath"] | undefined; }) { const server = new McpServer({ name: "Prowlarr", version: "0.1.1", }); const client = new ProwlarrCore({ security: deps.security, serverURL: deps.serverURL, serverIdx: deps.serverIdx, protocol: deps.protocol, hostpath: deps.hostpath, }); 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$apiInfoGetApi); tool(tool$applicationGetApiV1ApplicationsId); tool(tool$applicationPutApiV1ApplicationsId); tool(tool$applicationDeleteApiV1ApplicationsId); tool(tool$applicationGetApiV1Applications); tool(tool$applicationPostApiV1Applications); tool(tool$applicationPutApiV1ApplicationsBulk); tool(tool$applicationDeleteApiV1ApplicationsBulk); tool(tool$applicationGetApiV1ApplicationsSchema); tool(tool$applicationPostApiV1ApplicationsTest); tool(tool$applicationPostApiV1ApplicationsTestall); tool(tool$applicationPostApiV1ApplicationsActionName); tool(tool$appProfilePostApiV1Appprofile); tool(tool$appProfileGetApiV1Appprofile); tool(tool$appProfileDeleteApiV1AppprofileId); tool(tool$appProfilePutApiV1AppprofileId); tool(tool$appProfileGetApiV1AppprofileId); tool(tool$appProfileGetApiV1AppprofileSchema); tool(tool$staticResourceGetLogin); tool(tool$staticResourceGetContentPath); tool(tool$staticResourceGet); tool(tool$staticResourceGetPath); tool(tool$authenticationGetLogout); tool(tool$backupGetApiV1SystemBackup); tool(tool$backupDeleteApiV1SystemBackupId); tool(tool$backupPostApiV1SystemBackupRestoreId); tool(tool$backupPostApiV1SystemBackupRestoreUpload); tool(tool$commandGetApiV1CommandId); tool(tool$commandDeleteApiV1CommandId); tool(tool$commandPostApiV1Command); tool(tool$commandGetApiV1Command); tool(tool$customFilterGetApiV1CustomfilterId); tool(tool$customFilterPutApiV1CustomfilterId); tool(tool$customFilterDeleteApiV1CustomfilterId); tool(tool$customFilterGetApiV1Customfilter); tool(tool$customFilterPostApiV1Customfilter); tool(tool$developmentConfigPutApiV1ConfigDevelopmentId); tool(tool$developmentConfigGetApiV1ConfigDevelopmentId); tool(tool$developmentConfigGetApiV1ConfigDevelopment); tool(tool$downloadClientGetApiV1DownloadclientId); tool(tool$downloadClientPutApiV1DownloadclientId); tool(tool$downloadClientDeleteApiV1DownloadclientId); tool(tool$downloadClientGetApiV1Downloadclient); tool(tool$downloadClientPostApiV1Downloadclient); tool(tool$downloadClientPutApiV1DownloadclientBulk); tool(tool$downloadClientDeleteApiV1DownloadclientBulk); tool(tool$downloadClientGetApiV1DownloadclientSchema); tool(tool$downloadClientPostApiV1DownloadclientTest); tool(tool$downloadClientPostApiV1DownloadclientTestall); tool(tool$downloadClientPostApiV1DownloadclientActionName); tool(tool$downloadClientConfigGetApiV1ConfigDownloadclientId); tool(tool$downloadClientConfigPutApiV1ConfigDownloadclientId); tool(tool$downloadClientConfigGetApiV1ConfigDownloadclient); tool(tool$fileSystemGetApiV1Filesystem); tool(tool$fileSystemGetApiV1FilesystemType); tool(tool$healthGetApiV1Health); tool(tool$historyGetApiV1History); tool(tool$historyGetApiV1HistorySince); tool(tool$historyGetApiV1HistoryIndexer); tool(tool$hostConfigGetApiV1ConfigHostId); tool(tool$hostConfigPutApiV1ConfigHostId); tool(tool$hostConfigGetApiV1ConfigHost); tool(tool$indexerGetApiV1IndexerId); tool(tool$indexerPutApiV1IndexerId); tool(tool$indexerDeleteApiV1IndexerId); tool(tool$indexerGetApiV1Indexer); tool(tool$indexerPostApiV1Indexer); tool(tool$indexerPutApiV1IndexerBulk); tool(tool$indexerDeleteApiV1IndexerBulk); tool(tool$indexerGetApiV1IndexerSchema); tool(tool$indexerPostApiV1IndexerTest); tool(tool$indexerPostApiV1IndexerTestall); tool(tool$indexerPostApiV1IndexerActionName); tool(tool$indexerDefaultCategoriesGetApiV1IndexerCategories); tool(tool$indexerProxyGetApiV1IndexerproxyId); tool(tool$indexerProxyPutApiV1IndexerproxyId); tool(tool$indexerProxyDeleteApiV1IndexerproxyId); tool(tool$indexerProxyGetApiV1Indexerproxy); tool(tool$indexerProxyPostApiV1Indexerproxy); tool(tool$indexerProxyGetApiV1IndexerproxySchema); tool(tool$indexerProxyPostApiV1IndexerproxyTest); tool(tool$indexerProxyPostApiV1IndexerproxyTestall); tool(tool$indexerProxyPostApiV1IndexerproxyActionName); tool(tool$indexerStatsGetApiV1Indexerstats); tool(tool$indexerStatusGetApiV1Indexerstatus); tool(tool$localizationGetApiV1Localization); tool(tool$localizationGetApiV1LocalizationOptions); tool(tool$logGetApiV1Log); tool(tool$logFileGetApiV1LogFile); tool(tool$logFileGetApiV1LogFileFilename); tool(tool$newznabGetApiV1IndexerIdNewznab); tool(tool$newznabGetIdApi); tool(tool$newznabGetApiV1IndexerIdDownload); tool(tool$newznabGetIdDownload); tool(tool$notificationGetApiV1NotificationId); tool(tool$notificationPutApiV1NotificationId); tool(tool$notificationDeleteApiV1NotificationId); tool(tool$notificationGetApiV1Notification); tool(tool$notificationPostApiV1Notification); tool(tool$notificationGetApiV1NotificationSchema); tool(tool$notificationPostApiV1NotificationTest); tool(tool$notificationPostApiV1NotificationTestall); tool(tool$notificationPostApiV1NotificationActionName); tool(tool$pingGetPing); tool(tool$pingHeadPing); tool(tool$searchPostApiV1Search); tool(tool$searchGetApiV1Search); tool(tool$searchPostApiV1SearchBulk); tool(tool$systemGetApiV1SystemStatus); tool(tool$systemGetApiV1SystemRoutes); tool(tool$systemGetApiV1SystemRoutesDuplicate); tool(tool$systemPostApiV1SystemShutdown); tool(tool$systemPostApiV1SystemRestart); tool(tool$tagGetApiV1TagId); tool(tool$tagPutApiV1TagId); tool(tool$tagDeleteApiV1TagId); tool(tool$tagGetApiV1Tag); tool(tool$tagPostApiV1Tag); tool(tool$tagDetailsGetApiV1TagDetailId); tool(tool$tagDetailsGetApiV1TagDetail); tool(tool$taskGetApiV1SystemTask); tool(tool$taskGetApiV1SystemTaskId); tool(tool$uiConfigPutApiV1ConfigUiId); tool(tool$uiConfigGetApiV1ConfigUiId); tool(tool$uiConfigGetApiV1ConfigUi); tool(tool$updateGetApiV1Update); tool(tool$updateLogFileGetApiV1LogFileUpdate); tool(tool$updateLogFileGetApiV1LogFileUpdateFilename); return server; }