UNPKG

@firefly-iii-mcp/server

Version:
70 lines 1.96 kB
import { Express } from 'express'; import http from 'http'; import https from 'https'; /** * HTTPS server options */ export interface HttpsOptions { /** SSL key content */ key: string | Buffer; /** SSL certificate content */ cert: string | Buffer; /** Optional CA certificates */ ca?: string | Buffer | Array<string | Buffer>; } /** * CORS configuration options */ export interface CorsOptions { /** Allowed origins (e.g. 'https://example.com' or '*') */ origin?: string | string[] | boolean; /** Whether to allow credentials */ credentials?: boolean; /** Allowed HTTP methods */ methods?: string | string[]; /** Allowed HTTP headers */ allowedHeaders?: string | string[]; /** Headers exposed to the client */ exposedHeaders?: string | string[]; /** Max age of CORS preflight requests in seconds */ maxAge?: number; } /** * Server configuration options */ export interface ServerConfig { /** Port to listen on (default: 3000) */ port?: number; /** Firefly III Personal Access Token */ pat: string; /** Firefly III Base URL */ baseUrl: string; /** HTTPS options for secure server */ https?: HttpsOptions; /** CORS configuration */ corsOptions?: CorsOptions; /** Log level (default: 'info') */ logLevel?: 'debug' | 'info' | 'warn' | 'error'; /** Tool tags to enable */ enableToolTags?: string[]; } /** * MCP Server instance */ export interface McpServer { /** Express application instance */ app: Express; /** HTTP or HTTPS server instance */ server: http.Server | https.Server; /** Start the server */ start(): Promise<void>; /** Stop the server */ stop(): Promise<void>; } /** * Create an Express-based MCP server * @param config Server configuration * @returns MCP server instance */ export declare function createServer(config: ServerConfig): McpServer; //# sourceMappingURL=server.d.ts.map