@mcp-apps/api-tools-mcp-server
Version:
MCP server for interacting with APIs and web services
53 lines (52 loc) • 1.64 kB
TypeScript
interface OpenApiOperation {
operationId?: string;
summary?: string;
description?: string;
parameters?: any[];
requestBody?: any;
responses?: Record<string, any>;
tags?: string[];
method: string;
}
interface OpenApiEndpoint {
path: string;
operations: OpenApiOperation[];
}
interface ParsedSchema {
info: {
title?: string;
version?: string;
description?: string;
};
endpoints: OpenApiEndpoint[];
definitions?: any;
basePath?: string;
host?: string;
}
export declare class OpenApiService {
private static cache;
private static CACHE_TTL_MS;
private static defaultSchemaEndpoints;
/**
* Checks if an object is a valid OpenAPI schema
*/
private static isValidOpenApiSchema;
/**
* Try to find a valid schema by appending common schema paths to the base URL
*/
private static tryDefaultSchemaEndpoints;
static fetchSchema(url: string, authType?: 'bearer' | 'basic' | 'interactive' | 'none', authConfig?: any): Promise<ParsedSchema>;
/**
* Gets all endpoints from an OpenAPI schema
*/
static getEndpoints(url: string, authType?: 'bearer' | 'basic' | 'interactive' | 'none', authConfig?: any): Promise<OpenApiEndpoint[]>;
/**
* Gets detailed information about operations for a specific endpoint
*/
static getOperations(url: string, path: string, authType?: 'bearer' | 'basic' | 'interactive' | 'none', authConfig?: any): Promise<OpenApiOperation[]>;
/**
* Parses an OpenAPI schema into a standardized format
*/
private static parseSchema;
}
export {};