UNPKG

@launchdarkly/mcp-server

Version:

The local [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for [LaunchDarkly](https://launchdarkly.com/) federal and European Union (EU) environments.

26 lines • 1.62 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js"; import { GetPromptResult, ServerNotification, ServerRequest } from "@modelcontextprotocol/sdk/types.js"; import { objectOutputType, ZodOptional, ZodType, ZodTypeAny, ZodTypeDef } from "zod/v3"; import { LaunchDarklyCore } from "../core.js"; import { ConsoleLogger } from "./console-logger.js"; import { MCPScope } from "./scopes.js"; export type PromptArgsRawShape = { [k: string]: ZodType<string, ZodTypeDef, string> | ZodOptional<ZodType<string, ZodTypeDef, string>>; }; export type PromptDefinition<Args extends undefined | PromptArgsRawShape = undefined> = Args extends PromptArgsRawShape ? { name: string; description?: string; scopes?: MCPScope[]; args: Args; prompt: (client: LaunchDarklyCore, args: objectOutputType<Args, ZodTypeAny>, extra: RequestHandlerExtra<ServerRequest, ServerNotification>) => GetPromptResult | Promise<GetPromptResult>; } : { name: string; description?: string; scopes?: MCPScope[]; args?: undefined; prompt: (client: LaunchDarklyCore, extra: RequestHandlerExtra<ServerRequest, ServerNotification>) => GetPromptResult | Promise<GetPromptResult>; }; export declare function formatResult(value: string): Promise<GetPromptResult>; export declare function createRegisterPrompt(logger: ConsoleLogger, server: McpServer, sdk: LaunchDarklyCore, allowedScopes: Set<MCPScope>): <A extends PromptArgsRawShape | undefined>(prompt: PromptDefinition<A>) => void; //# sourceMappingURL=prompts.d.ts.map