n8n
Version:
n8n Workflow Automation Tool
17 lines (16 loc) • 882 B
TypeScript
import type { CredentialProvider, McpClient, McpServerConfig } from '@n8n/agents';
import type { AgentJsonMcpServerConfig } from '@n8n/api-types';
import type { OauthService } from '../../../oauth/oauth.service';
export declare function mapApprovalToSdk(approval: AgentJsonMcpServerConfig['approval']): McpServerConfig['requireApproval'];
interface CreateAuthFetchOptions {
initialHeaders: Record<string, string>;
onUnauthorized?: () => Promise<Record<string, string> | null>;
}
export declare function createAuthFetch({ initialHeaders, onUnauthorized, }: CreateAuthFetchOptions): typeof fetch;
export interface BuildMcpClientDeps {
credentialProvider: CredentialProvider;
oauthService: OauthService;
projectId: string;
}
export declare function buildMcpClientForServer(server: AgentJsonMcpServerConfig, deps: BuildMcpClientDeps): Promise<McpClient>;
export {};