/** * Aegis MCP Server — exposes Aegis credential isolation as MCP tools. * * The MCP server sits between an AI agent (MCP client) and external APIs. * The agent uses tools to make authenticated API calls without ever seeing credentials. * * Tools: * - aegis_proxy_request: Make an authenticated API call through Aegis * - aegis_list_services: List available services (names only, never secrets) * - aegis_health: Check Aegis status * * Transports: * - stdio: For local process-spawned integrations (Claude Desktop, Cursor, VS Code) * - streamable-http: For remote server access */ import type { AgentRegistry } from '../agent/index.js'; import type { Ledger } from '../ledger/index.js'; import type { AegisMetrics } from '../metrics/index.js'; import type { PolicyValidationResult } from '../policy/index.js'; import type { Vault } from '../vault/index.js'; import type { WebhookManager } from '../webhook/index.js'; export interface AegisMcpServerOptions { /** Vault instance for credential lookup and injection. */ vault: Vault; /** Ledger instance for audit logging. */ ledger: Ledger; /** Agent registry — required when agentToken is provided. */ agentRegistry?: AgentRegistry; /** Pre-configured agent token for this MCP session. */ agentToken?: string; /** Transport type. */ transport: 'stdio' | 'streamable-http'; /** Port for streamable-http transport (default: 3200). */ port?: number; /** Policy validation results for policy evaluation. */ policies?: PolicyValidationResult[]; /** Policy enforcement mode (default: "enforce"). */ policyMode?: 'enforce' | 'dry-run'; /** Log level (default: "info"). */ logLevel?: 'debug' | 'info' | 'warn' | 'error'; /** Prometheus metrics collector. */ metrics?: AegisMetrics; /** Webhook manager for alert notifications. */ webhooks?: WebhookManager; } /** * Aegis MCP Server — wraps the Aegis credential isolation layer as an MCP server. * * This gives any MCP-compatible AI agent (Claude, ChatGPT, Cursor, VS Code Copilot) * the ability to make authenticated API calls without ever seeing credentials. */ export declare class AegisMcpServer { private server; private vault; private ledger; private agentRegistry?; private authenticatedAgent?; private transportType; private port; private policyMap; private policyMode; private logger; private rateLimiter; private bodyInspector; private httpServer?; private metrics?; private webhooks?; constructor(options: AegisMcpServerOptions); private registerTools; /** * aegis_proxy_request — Make an authenticated API call through Aegis. * * The agent provides service, path, method, headers, and body. * Aegis injects credentials, enforces domain guard, rate limits, body inspection, * and policy evaluation — then returns the response. */ private registerProxyRequestTool; /** * aegis_list_services — List available services the agent can use. * * Returns service names and domains only — never secrets. */ private registerListServicesTool; /** * aegis_health — Check Aegis status. */ private registerHealthTool; /** * Execute an authenticated proxy request through Aegis. * * This replicates the Gate's security pipeline: * 1. Credential lookup * 2. TTL check * 3. Agent credential scoping * 4. Policy evaluation * 5. Agent rate limiting * 6. Credential rate limiting * 7. Domain guard * 8. Body inspection * 9. Credential injection + forward * 10. Audit logging */ private proxyRequest; /** * Make the actual outbound HTTP request with credential injection. */ private makeOutboundRequest; /** * Inject the credential into outbound request headers based on auth type. * For `query` auth, the secret is appended as a URL query parameter instead. */ private injectCredential; /** * Start the MCP server with the configured transport. */ start(): Promise; /** * Start with stdio transport (for local integrations). */ private startStdio; /** * Start with Streamable HTTP transport (for remote access). */ private startStreamableHttp; /** * Stop the MCP server. */ stop(): Promise; } //# sourceMappingURL=mcp-server.d.ts.map