import { McpServer } from '@modelcontextprotocol/server'; import type { McpHttpHandler } from '@modelcontextprotocol/server'; import { JupiterOneConfig } from '../types/jupiterone.js'; import type { AccountResolver } from './tools/types.js'; import { type ToolTelemetry } from './tools/telemetry.js'; export interface JupiterOneMcpServerOptions { /** Sink for per-call telemetry. Defaults to a stderr writer (stdio-safe). */ telemetry?: ToolTelemetry; /** * Resolves the caller's accounts for the `list-accounts` tool. Supplied by the host (the remote * proxy) because the list comes from a host-only source. When omitted, `list-accounts` is not * registered. */ resolveAccounts?: AccountResolver; } export declare class JupiterOneMcpServer { server: McpServer; private client; private validator; private isMultiTenant; private telemetry; private envAccountId?; private resolveAccounts?; private stdioHandle?; constructor(config: JupiterOneConfig, options?: JupiterOneMcpServerOptions); /** * Construct a fresh SDK server with every tool registered. The constructor builds one for the * host to attach a transport to (the remote's per-request usage); `start()`'s stdio factory * builds one per connection, as `serveStdio` pins an instance per connection and may discard an * extra one for a `server/discover` probe. */ private buildSdkServer; /** * Build the per-call tool context passed to handlers — currently just the host-supplied account * resolver, consumed by the account-discovery tool. */ private toolContext; /** * Single registration chokepoint: injects the per-request `accountId` parameter when no env * account is configured, then wraps every handler with account-scoped client cloning, sanitized * error formatting (C2), and per-call telemetry (O1). */ private register; /** Build the SDK registration config for a tool. */ private toolConfig; private buildInputSchema; /** * Resolve a call's execution scope: strip the injected `reason`, and in multi-tenant mode * consume `accountId` into an account-scoped client clone. Returns null when a required * accountId is missing. */ private scopeCall; private static readonly MISSING_ACCOUNT_MESSAGE; private invoke; /** * Fetch-shaped MCP handler serving both protocol eras (2026-07-28 envelopes and legacy * `initialize` traffic) from this server's tool registry, for HTTP hosts. Exposed from the core * so the whole protocol object graph comes from ONE compiled copy of the SDK: the ESM and CJS * builds of @modelcontextprotocol/server mangle private protocol fields differently, so a host * must not combine its own `createMcpHandler` with a core-built `McpServer` (the ESM build's * modern path reads `_supportedProtocolVersions`, which a CJS-built instance stores under a * mangled name). Hosts adapt `handler.fetch` with `toNodeHandler(...)` or serve it directly. */ createHttpHandler(options?: { onerror?: (error: Error) => void; }): McpHttpHandler; start(): Promise; stop(): Promise; } //# sourceMappingURL=mcp-server.d.ts.map