/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { RagieCore } 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$authenticatorsCreate } from "./tools/authenticatorsCreate.js"; import { tool$authenticatorsCreateAuthenticatorConnection } from "./tools/authenticatorsCreateAuthenticatorConnection.js"; import { tool$authenticatorsDeleteAuthenticatorConnection } from "./tools/authenticatorsDeleteAuthenticatorConnection.js"; import { tool$authenticatorsList } from "./tools/authenticatorsList.js"; import { tool$connectionsCreateConnection } from "./tools/connectionsCreateConnection.js"; import { tool$connectionsCreateOAuthRedirectUrl } from "./tools/connectionsCreateOAuthRedirectUrl.js"; import { tool$connectionsDelete } from "./tools/connectionsDelete.js"; import { tool$connectionsGet } from "./tools/connectionsGet.js"; import { tool$connectionsGetStats } from "./tools/connectionsGetStats.js"; import { tool$connectionsList } from "./tools/connectionsList.js"; import { tool$connectionsListConnectionSourceTypes } from "./tools/connectionsListConnectionSourceTypes.js"; import { tool$connectionsSetEnabled } from "./tools/connectionsSetEnabled.js"; import { tool$connectionsSetLimits } from "./tools/connectionsSetLimits.js"; import { tool$connectionsSync } from "./tools/connectionsSync.js"; import { tool$connectionsUpdate } from "./tools/connectionsUpdate.js"; import { tool$documentsCreate } from "./tools/documentsCreate.js"; import { tool$documentsCreateDocumentFromUrl } from "./tools/documentsCreateDocumentFromUrl.js"; import { tool$documentsCreateRaw } from "./tools/documentsCreateRaw.js"; import { tool$documentsDelete } from "./tools/documentsDelete.js"; import { tool$documentsGet } from "./tools/documentsGet.js"; import { tool$documentsGetChunk } from "./tools/documentsGetChunk.js"; import { tool$documentsGetChunkContent } from "./tools/documentsGetChunkContent.js"; import { tool$documentsGetChunks } from "./tools/documentsGetChunks.js"; import { tool$documentsGetContent } from "./tools/documentsGetContent.js"; import { tool$documentsGetSource } from "./tools/documentsGetSource.js"; import { tool$documentsGetSummary } from "./tools/documentsGetSummary.js"; import { tool$documentsList } from "./tools/documentsList.js"; import { tool$documentsPatchMetadata } from "./tools/documentsPatchMetadata.js"; import { tool$documentsUpdateDocumentFromUrl } from "./tools/documentsUpdateDocumentFromUrl.js"; import { tool$documentsUpdateFile } from "./tools/documentsUpdateFile.js"; import { tool$documentsUpdateRaw } from "./tools/documentsUpdateRaw.js"; import { tool$entitiesCreateInstruction } from "./tools/entitiesCreateInstruction.js"; import { tool$entitiesDelete } from "./tools/entitiesDelete.js"; import { tool$entitiesListByDocument } from "./tools/entitiesListByDocument.js"; import { tool$entitiesListByInstruction } from "./tools/entitiesListByInstruction.js"; import { tool$entitiesListInstructions } from "./tools/entitiesListInstructions.js"; import { tool$entitiesUpdateInstruction } from "./tools/entitiesUpdateInstruction.js"; import { tool$partitionsCreate } from "./tools/partitionsCreate.js"; import { tool$partitionsDelete } from "./tools/partitionsDelete.js"; import { tool$partitionsGet } from "./tools/partitionsGet.js"; import { tool$partitionsList } from "./tools/partitionsList.js"; import { tool$partitionsSetLimits } from "./tools/partitionsSetLimits.js"; import { tool$partitionsUpdate } from "./tools/partitionsUpdate.js"; import { tool$responsesCreate } from "./tools/responsesCreate.js"; import { tool$responsesGet } from "./tools/responsesGet.js"; import { tool$retrievalsRetrieve } from "./tools/retrievalsRetrieve.js"; import { tool$webhookEndpointsCreate } from "./tools/webhookEndpointsCreate.js"; import { tool$webhookEndpointsDelete } from "./tools/webhookEndpointsDelete.js"; import { tool$webhookEndpointsGet } from "./tools/webhookEndpointsGet.js"; import { tool$webhookEndpointsList } from "./tools/webhookEndpointsList.js"; import { tool$webhookEndpointsUpdate } from "./tools/webhookEndpointsUpdate.js"; export function createMCPServer(deps: { logger: ConsoleLogger; allowedTools?: string[] | undefined; scopes?: MCPScope[] | undefined; serverURL?: string | undefined; auth?: SDKOptions["auth"] | undefined; serverIdx?: SDKOptions["serverIdx"] | undefined; }) { const server = new McpServer({ name: "Ragie", version: "1.15.1", }); const client = new RagieCore({ auth: deps.auth, 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$documentsCreate); tool(tool$documentsList); tool(tool$documentsCreateRaw); tool(tool$documentsCreateDocumentFromUrl); tool(tool$documentsGet); tool(tool$documentsDelete); tool(tool$documentsUpdateFile); tool(tool$documentsUpdateRaw); tool(tool$documentsUpdateDocumentFromUrl); tool(tool$documentsPatchMetadata); tool(tool$documentsGetChunks); tool(tool$documentsGetChunk); tool(tool$documentsGetChunkContent); tool(tool$documentsGetContent); tool(tool$documentsGetSource); tool(tool$documentsGetSummary); tool(tool$retrievalsRetrieve); tool(tool$entitiesListInstructions); tool(tool$entitiesCreateInstruction); tool(tool$entitiesUpdateInstruction); tool(tool$entitiesDelete); tool(tool$entitiesListByInstruction); tool(tool$entitiesListByDocument); tool(tool$connectionsCreateConnection); tool(tool$connectionsList); tool(tool$connectionsCreateOAuthRedirectUrl); tool(tool$connectionsListConnectionSourceTypes); tool(tool$connectionsSetEnabled); tool(tool$connectionsUpdate); tool(tool$connectionsGet); tool(tool$connectionsGetStats); tool(tool$connectionsSetLimits); tool(tool$connectionsDelete); tool(tool$connectionsSync); tool(tool$webhookEndpointsList); tool(tool$webhookEndpointsCreate); tool(tool$webhookEndpointsGet); tool(tool$webhookEndpointsUpdate); tool(tool$webhookEndpointsDelete); tool(tool$partitionsList); tool(tool$partitionsCreate); tool(tool$partitionsGet); tool(tool$partitionsUpdate); tool(tool$partitionsDelete); tool(tool$partitionsSetLimits); tool(tool$authenticatorsCreate); tool(tool$authenticatorsList); tool(tool$authenticatorsCreateAuthenticatorConnection); tool(tool$authenticatorsDeleteAuthenticatorConnection); tool(tool$responsesCreate); tool(tool$responsesGet); return server; }