@weilei_kyle/public-apis-mcp
Version:
MCP server for accessing public APIs
139 lines (138 loc) • 3.2 kB
TypeScript
import { z } from 'zod';
export declare const ApiCategorySchema: z.ZodObject<{
API: z.ZodString;
Description: z.ZodString;
Auth: z.ZodString;
HTTPS: z.ZodBoolean;
Cors: z.ZodString;
Link: z.ZodString;
Category: z.ZodString;
}, "strip", z.ZodTypeAny, {
API: string;
Description: string;
Auth: string;
HTTPS: boolean;
Cors: string;
Link: string;
Category: string;
}, {
API: string;
Description: string;
Auth: string;
HTTPS: boolean;
Cors: string;
Link: string;
Category: string;
}>;
export declare const ApiResponseSchema: z.ZodObject<{
count: z.ZodNumber;
entries: z.ZodArray<z.ZodObject<{
API: z.ZodString;
Description: z.ZodString;
Auth: z.ZodString;
HTTPS: z.ZodBoolean;
Cors: z.ZodString;
Link: z.ZodString;
Category: z.ZodString;
}, "strip", z.ZodTypeAny, {
API: string;
Description: string;
Auth: string;
HTTPS: boolean;
Cors: string;
Link: string;
Category: string;
}, {
API: string;
Description: string;
Auth: string;
HTTPS: boolean;
Cors: string;
Link: string;
Category: string;
}>, "many">;
}, "strip", z.ZodTypeAny, {
entries: {
API: string;
Description: string;
Auth: string;
HTTPS: boolean;
Cors: string;
Link: string;
Category: string;
}[];
count: number;
}, {
entries: {
API: string;
Description: string;
Auth: string;
HTTPS: boolean;
Cors: string;
Link: string;
Category: string;
}[];
count: number;
}>;
export type ApiEntry = z.infer<typeof ApiCategorySchema>;
export type ApiResponse = z.infer<typeof ApiResponseSchema>;
export interface APIEntry {
API: string;
Description: string;
Auth: string;
HTTPS: boolean;
Cors: string;
Link: string;
Category: string;
}
export interface APIData {
count: number;
entries: APIEntry[];
}
export interface APIDatabase {
[category: string]: APIData;
}
export interface ToolResponse {
content: Array<{
type: 'text' | 'image' | 'resource';
text?: string;
data?: string;
mimeType?: string;
resource?: {
uri: string;
text?: string;
mimeType?: string;
};
}>;
isError?: boolean;
_meta?: {
[key: string]: unknown;
};
}
export interface AuthHeader {
setup: string;
header: string;
curl: string;
}
export interface ApiFilter {
category?: string;
title?: string;
description?: string;
auth?: string;
https?: boolean;
cors?: string;
}
export interface RecommendationRequest {
userIntent: string;
useCase?: string;
technicalLevel?: 'beginner' | 'intermediate' | 'advanced';
authPreference?: 'none' | 'simple' | 'oauth' | 'any';
prioritizeReliability?: boolean;
maxResults?: number;
}
export interface ScoredApi extends ApiEntry {
score: number;
reasons: string[];
difficulty: 'easy' | 'medium' | 'hard';
popularity: number;
}