@l4t/mcp-ai
Version:
A set of tools for making integration and aggregation of MCP servers extremely easy.
39 lines (38 loc) • 1.62 kB
TypeScript
import { CallToolResult } from '@modelcontextprotocol/sdk/types';
import { ServerHttpConfig, ServerWsConfig, ServerCliConfig, ServerSseConfig, McpTool, ServerStatelessHttpConfig } from '../common/types';
/**
* The value or an array of the types of value
*/
type Arrayable<T> = T | readonly T[];
/**
* A JSON compliant object.
*/
type JsonObj = Readonly<{
[s: string]: JsonAble | null | undefined;
}>;
/**
* A description of valid json values.
*/
export type JsonAble = Arrayable<JsonObj> | readonly (number | string | boolean)[] | number | string | boolean | null | undefined;
export type ServerTool = McpTool & Readonly<{
/**
* An execute function that returns your native type. This is automatically converted to
* the correct format for MCP as a stringified JSON.
*/
execute: (input: any) => Promise<CallToolResult>;
}>;
/**
* The basic configuration for the MCP server
*/
type SimpleServerBasicConfig = Readonly<{
name: string;
version: string;
tools: readonly ServerTool[];
}>;
export type SimpleServerHttpConfig = ServerHttpConfig & SimpleServerBasicConfig;
export type SimpleServerWsConfig = ServerWsConfig & SimpleServerBasicConfig;
export type SimpleServerCliConfig = ServerCliConfig & SimpleServerBasicConfig;
export type SimpleServerSseConfig = ServerSseConfig & SimpleServerBasicConfig;
export type SimpleServerStatelessHttpConfig = ServerStatelessHttpConfig & SimpleServerBasicConfig;
export type SimpleServerConfig = SimpleServerHttpConfig | SimpleServerWsConfig | SimpleServerCliConfig | SimpleServerSseConfig | SimpleServerStatelessHttpConfig;
export {};