{
  "name": "@forge-sdk/mcp",
  "language": "typescript",
  "version": "0.1.0",
  "description": "Model Context Protocol client, server, and transport for the Forge SDK",
  "manifest": "forge-ts/packages/forge-mcp/package.json",
  "manifestSha256": "bbda0884142a50c5718b82ac78791022a8f390b5c05928401f12d3bb0cc15c7d",
  "status": "source-reference",
  "registryPublicationVerified": false,
  "route": "/libraries/typescript/mcp",
  "features": {},
  "files": [
    {
      "path": "forge-ts/packages/forge-mcp/src/auth.ts",
      "sha256": "6d726f2751a75a5acff52c25ea4cfca42141df96191608537d21ab7f521f6526",
      "artifactSha256": "c9ee7b58e8c00b91bfdb932e6a841ab2a8ab955d5b4fcd5c651679369dbf6c69",
      "url": "/reference/source/forge-ts/packages/forge-mcp/src/auth.ts.txt",
      "declarations": [
        {
          "name": "OAuthConfig",
          "line": 27,
          "signature": "export interface OAuthConfig {\n  /** The OAuth client ID. */\n  readonly clientId: string;\n  /** The OAuth client secret (optional for public clients). */\n  readonly clientSecret?: string;\n  /** The redirect URI for the authorization callback. */\n  readonly redirectUri: string;\n  /** The authorization endpoint URL. */\n  readonly authUrl: string;\n  /** The token endpoint URL. */\n  readonly tokenUrl: string;\n}",
          "documentation": "OAuth 2.0 configuration for MCP authentication."
        },
        {
          "name": "PkceChallenge",
          "line": 46,
          "signature": "export interface PkceChallenge {\n  /** The code verifier (random string). */\n  readonly verifier: string;\n  /** The code challenge (derived from verifier). */\n  readonly challenge: string;\n  /** The challenge method ('S256'). */\n  readonly method: 'S256';\n}",
          "documentation": "A PKCE (Proof Key for Code Exchange) challenge pair.\n\nUsed in OAuth 2.0 authorization code flow with PKCE to prevent\nauthorization code interception attacks."
        },
        {
          "name": "generatePkceChallenge",
          "line": 72,
          "signature": "export async function generatePkceChallenge(): Promise<PkceChallenge>;",
          "documentation": "Generates a PKCE challenge pair for OAuth 2.0 authorization.\n\nCreates a random 32-byte code verifier, computes its SHA-256 hash,\nand base64url-encodes it as the code challenge."
        }
      ]
    },
    {
      "path": "forge-ts/packages/forge-mcp/src/client.ts",
      "sha256": "f32fd39732dd7f756230ceddd191b5de072ba572cda710369659a4858eecabac",
      "artifactSha256": "8247d0dd5328921b503f9df1a712b102b431c34cda9aa8881a38d01d87c7c077",
      "url": "/reference/source/forge-ts/packages/forge-mcp/src/client.ts.txt",
      "declarations": [
        {
          "name": "McpClientConfig",
          "line": 36,
          "signature": "export interface McpClientConfig {\n  /** The transport configuration. */\n  readonly transport: TransportConfig;\n  /** Optional OAuth configuration for authenticated connections. */\n  readonly auth?: OAuthConfig;\n}",
          "documentation": "Configuration for an MCP client."
        },
        {
          "name": "McpClient",
          "line": 60,
          "signature": "export class McpClient {\n  constructor(config: McpClientConfig);\n  async connect(): Promise<void>;\n  capabilities(): McpCapabilities | undefined;\n  async listTools(): Promise<McpToolDescriptor[]>;\n  async callTool(toolName: string, args: Record<string, unknown>): Promise<unknown>;\n  async listResources(): Promise<McpResource[]>;\n  async getResource(uri: string): Promise<unknown>;\n  async listPrompts(): Promise<McpPrompt[]>;\n  async getPrompt(name: string, args?: Record<string, string>): Promise<unknown>;\n  async disconnect(): Promise<void>;\n  get connected(): boolean;\n}",
          "documentation": "An MCP client that connects to an MCP server and provides access to\ntools, resources, and prompts.\n\nANVIL Spec section 12.2 -- MCP Client."
        }
      ]
    },
    {
      "path": "forge-ts/packages/forge-mcp/src/error.ts",
      "sha256": "4b323915c9e1b11ef3d19635ac122dfe1bf36bb396ea3f91bcbd05f4f53ff559",
      "artifactSha256": "d6d0ba7d0782459606eab6df3edc9bb66b45ee1ebfd1d6c2e685a91dfe9eebaa",
      "url": "/reference/source/forge-ts/packages/forge-mcp/src/error.ts.txt",
      "declarations": [
        {
          "name": "export const ForgeMcpErrorCode = {",
          "line": 13,
          "signature": "export const ForgeMcpErrorCode /* type inferred in source */;",
          "documentation": "Error types for the `@forge-sdk/mcp` package.\n\nAll errors are typed and actionable with context about the MCP operation\nthat failed, the transport type, and specific reasons.\nError code enumeration for `@forge-sdk/mcp`."
        },
        {
          "name": "ForgeMcpErrorCodeType",
          "line": 24,
          "signature": "export type ForgeMcpErrorCodeType = (typeof ForgeMcpErrorCode)[keyof typeof ForgeMcpErrorCode];",
          "documentation": "Error code type."
        },
        {
          "name": "ForgeMcpError",
          "line": 43,
          "signature": "export class ForgeMcpError extends Error {\n  public readonly code: ForgeMcpErrorCodeType;\n  static connectionFailed(url: string, reason: string): ForgeMcpError;\n  static transportError(transport: string, reason: string): ForgeMcpError;\n  static protocolError(reason: string): ForgeMcpError;\n  static toolNotFound(toolName: string): ForgeMcpError;\n  static serializationError(reason: string): ForgeMcpError;\n  static authError(reason: string): ForgeMcpError;\n  static core(reason: string): ForgeMcpError;\n}",
          "documentation": "Error class for MCP operations.\n\nCovers connection failures, transport errors, protocol violations,\ntool lookup failures, serialization issues, and auth errors."
        }
      ]
    },
    {
      "path": "forge-ts/packages/forge-mcp/src/index.ts",
      "sha256": "6b12b2145be4fbf44f311a71047b5f7c7dbe3b04d21286de1b49a5181c66f841",
      "artifactSha256": "33fe0f47980d296106557701b70c4da166e34278363f2e35b1409f8902271ac2",
      "url": "/reference/source/forge-ts/packages/forge-mcp/src/index.ts.txt",
      "declarations": [
        {
          "name": "export { ForgeMcpError, ForgeMcpErrorCode, type ForgeMcpErrorCodeType } from './error.js';",
          "line": 25,
          "signature": "export { ForgeMcpError, ForgeMcpErrorCode, type ForgeMcpErrorCodeType } from './error.js';",
          "documentation": ""
        },
        {
          "name": "export {",
          "line": 28,
          "signature": "export {\n  type McpToolDescriptor,\n  type McpResource,\n  type McpPrompt,\n  type McpPromptArgument,\n  type McpRequest,\n  type McpResponse,\n  type McpErrorObject,\n  type McpRequestId,\n  type McpCapabilities,\n} from './types.js';",
          "documentation": ""
        },
        {
          "name": "export {",
          "line": 41,
          "signature": "export {\n  type McpTransport,\n  type TransportConfig,\n  StdioTransport,\n  SseTransport,\n  HttpTransport,\n  createTransport,\n} from './transport.js';",
          "documentation": ""
        },
        {
          "name": "export { McpClient, type McpClientConfig } from './client.js';",
          "line": 51,
          "signature": "export { McpClient, type McpClientConfig } from './client.js';",
          "documentation": ""
        },
        {
          "name": "export {",
          "line": 54,
          "signature": "export {\n  McpServer,\n  type McpServerConfig,\n  type ToolHandler,\n  type ResourceHandler,\n  type PromptHandler,\n} from './server.js';",
          "documentation": ""
        },
        {
          "name": "export {",
          "line": 63,
          "signature": "export {\n  type OAuthConfig,\n  type PkceChallenge,\n  generatePkceChallenge,\n} from './auth.js';",
          "documentation": ""
        }
      ]
    },
    {
      "path": "forge-ts/packages/forge-mcp/src/server.ts",
      "sha256": "5259f3a5a20be260c35d61a09b659b5c23acd58d234a104c05629a15a2a918bd",
      "artifactSha256": "aafa924504719cf79590c07fcac52fe25d7f895a9f99b92d72cf370391b4704a",
      "url": "/reference/source/forge-ts/packages/forge-mcp/src/server.ts.txt",
      "declarations": [
        {
          "name": "ToolHandler",
          "line": 25,
          "signature": "export type ToolHandler = (args: Record<string, unknown>) => Promise<unknown>;",
          "documentation": "Handler function for tool calls."
        },
        {
          "name": "ResourceHandler",
          "line": 30,
          "signature": "export type ResourceHandler = (uri: string) => Promise<unknown>;",
          "documentation": "Handler function for resource reads."
        },
        {
          "name": "PromptHandler",
          "line": 35,
          "signature": "export type PromptHandler = (args: Record<string, string>) => Promise<unknown>;",
          "documentation": "Handler function for prompt gets."
        },
        {
          "name": "McpServerConfig",
          "line": 40,
          "signature": "export interface McpServerConfig {\n  /** The server name. */\n  readonly name: string;\n  /** The server version. */\n  readonly version: string;\n}",
          "documentation": "Configuration for an MCP server."
        },
        {
          "name": "McpServer",
          "line": 70,
          "signature": "export class McpServer {\n  constructor(config: McpServerConfig);\n  registerTool(descriptor: McpToolDescriptor, handler: ToolHandler): void;\n  registerResource(resource: McpResource, handler: ResourceHandler): void;\n  registerPrompt(prompt: McpPrompt, handler: PromptHandler): void;\n  capabilities(): McpCapabilities;\n  async handleRequest(request: McpRequest): Promise<McpResponse>;\n}",
          "documentation": "An MCP server that handles incoming JSON-RPC 2.0 requests and dispatches\nto registered tool, resource, and prompt handlers.\n\nANVIL Spec section 12.2 -- MCP Server."
        }
      ]
    },
    {
      "path": "forge-ts/packages/forge-mcp/src/transport.ts",
      "sha256": "dd3f582cd3ac5f9b13270efde557b0088264174bef27051dd22b9a22ebdc90b7",
      "artifactSha256": "dceab7d7d0a890d2acf91b8ec14d396f400c7532ed2ab5419b814b510ee70a34",
      "url": "/reference/source/forge-ts/packages/forge-mcp/src/transport.ts.txt",
      "declarations": [
        {
          "name": "TransportConfig",
          "line": 23,
          "signature": "export type TransportConfig =\n  | { readonly type: 'stdio' }\n  | { readonly type: 'sse'; readonly url: string }\n  | { readonly type: 'http'; readonly url: string };",
          "documentation": "Transport configuration variants."
        },
        {
          "name": "McpTransport",
          "line": 43,
          "signature": "export interface McpTransport {\n  /**\n   * Sends a JSON-RPC 2.0 request.\n   *\n   * @param request - The request to send.\n   * @throws {ForgeMcpError} If the send fails.\n   */\n  send(request: McpRequest): Promise<void>;\n\n  /**\n   * Receives the next JSON-RPC 2.0 response.\n   *\n   * @returns The response message.\n   * @throws {ForgeMcpError} If the receive fails or the transport is closed.\n   */\n  receive(): Promise<McpResponse>;\n\n  /**\n   * Closes the transport connection.\n   *\n   * After closing, no further sends or receives are allowed.\n   */\n  close(): Promise<void>;\n}",
          "documentation": "Interface for MCP message transport.\n\nImplementations handle the low-level sending and receiving of\nJSON-RPC 2.0 messages over a specific transport mechanism."
        },
        {
          "name": "StdioLineReader",
          "line": 71,
          "signature": "export interface StdioLineReader {\n  /**\n   * Reads the next newline-delimited JSON line.\n   *\n   * Returns `null` on clean EOF.\n   */\n  readLine(): Promise<string | null>;\n}",
          "documentation": "Line-based reader for stdio transports."
        },
        {
          "name": "StdioLineWriter",
          "line": 83,
          "signature": "export interface StdioLineWriter {\n  /**\n   * Writes a single JSON line without a trailing newline.\n   */\n  writeLine(line: string): Promise<void>;\n}",
          "documentation": "Line-based writer for stdio transports."
        },
        {
          "name": "StdioTransportOptions",
          "line": 93,
          "signature": "export interface StdioTransportOptions {\n  readonly reader?: StdioLineReader;\n  readonly writer?: StdioLineWriter;\n}",
          "documentation": "Optional injected stdio adapters for tests and embedded runtimes."
        },
        {
          "name": "StdioTransport",
          "line": 228,
          "signature": "export class StdioTransport implements McpTransport {\n  constructor(options?: StdioTransportOptions);\n  async send(request: McpRequest): Promise<void>;\n  async receive(): Promise<McpResponse>;\n  async close(): Promise<void>;\n}",
          "documentation": "Stdio transport implementation.\n\nCommunicates via stdin/stdout using newline-delimited JSON. This is the\nprimary transport for local MCP servers."
        },
        {
          "name": "SseTransport",
          "line": 300,
          "signature": "export class SseTransport implements McpTransport {\n  constructor(url: string);\n  async send(request: McpRequest): Promise<void>;\n  async receive(): Promise<McpResponse>;\n  async close(): Promise<void>;\n}",
          "documentation": "Server-Sent Events (SSE) transport implementation.\n\nSends requests via HTTP POST and receives responses via an SSE stream.\nThis is the recommended transport for remote MCP servers."
        },
        {
          "name": "HttpTransport",
          "line": 496,
          "signature": "export class HttpTransport implements McpTransport {\n  constructor(url: string);\n  async send(request: McpRequest): Promise<void>;\n  async receive(): Promise<McpResponse>;\n  async close(): Promise<void>;\n}",
          "documentation": "HTTP transport implementation.\n\nSends requests and receives responses as individual HTTP POST requests."
        },
        {
          "name": "createTransport",
          "line": 563,
          "signature": "export function createTransport(config: TransportConfig): McpTransport;",
          "documentation": "Creates a transport from configuration."
        }
      ]
    },
    {
      "path": "forge-ts/packages/forge-mcp/src/types.ts",
      "sha256": "05b0701a1be7518bb0bf715720563ae0999b5c3457ce6db619fbae7517796c42",
      "artifactSha256": "2c9ab41c9f92c3e5c28a61382926a3e39a337e5c5d1ec09f94c16b804735e50f",
      "url": "/reference/source/forge-ts/packages/forge-mcp/src/types.ts.txt",
      "declarations": [
        {
          "name": "McpToolDescriptor",
          "line": 22,
          "signature": "export interface McpToolDescriptor {\n  /** The unique name of the tool. */\n  readonly name: string;\n  /** A human-readable description of the tool's purpose. */\n  readonly description: string;\n  /** The JSON Schema for the tool's input parameters. */\n  readonly inputSchema: Record<string, unknown>;\n}",
          "documentation": "MCP (Model Context Protocol) type definitions.\n\nDefines the JSON-RPC 2.0 message types and MCP-specific descriptors\nfor tools, resources, and prompts.\nAn MCP tool descriptor exposed by a server."
        },
        {
          "name": "McpResource",
          "line": 34,
          "signature": "export interface McpResource {\n  /** The URI identifying this resource. */\n  readonly uri: string;\n  /** A human-readable name for the resource. */\n  readonly name: string;\n  /** An optional description. */\n  readonly description?: string;\n  /** The MIME type of the resource content. */\n  readonly mimeType?: string;\n}",
          "documentation": "An MCP resource exposed by a server."
        },
        {
          "name": "McpPromptArgument",
          "line": 48,
          "signature": "export interface McpPromptArgument {\n  /** The argument name. */\n  readonly name: string;\n  /** An optional description. */\n  readonly description?: string;\n  /** Whether this argument is required. */\n  readonly required: boolean;\n}",
          "documentation": "An MCP prompt argument."
        },
        {
          "name": "McpPrompt",
          "line": 60,
          "signature": "export interface McpPrompt {\n  /** The unique name of the prompt. */\n  readonly name: string;\n  /** An optional description. */\n  readonly description?: string;\n  /** The prompt's arguments. */\n  readonly arguments: readonly McpPromptArgument[];\n}",
          "documentation": "An MCP prompt template exposed by a server."
        },
        {
          "name": "McpRequestId",
          "line": 72,
          "signature": "export type McpRequestId = number | string | null;",
          "documentation": "JSON-RPC 2.0 request ID type."
        },
        {
          "name": "McpRequest",
          "line": 77,
          "signature": "export interface McpRequest {\n  /** JSON-RPC version. Always '2.0'. */\n  readonly jsonrpc: '2.0';\n  /** The request ID for matching responses. */\n  readonly id: McpRequestId;\n  /** The method name. */\n  readonly method: string;\n  /** Optional parameters. */\n  readonly params?: Record<string, unknown>;\n}",
          "documentation": "A JSON-RPC 2.0 request message."
        },
        {
          "name": "McpErrorObject",
          "line": 91,
          "signature": "export interface McpErrorObject {\n  /** The error code. */\n  readonly code: number;\n  /** A human-readable error message. */\n  readonly message: string;\n  /** Optional additional error data. */\n  readonly data?: unknown;\n}",
          "documentation": "A JSON-RPC 2.0 error object."
        },
        {
          "name": "McpResponse",
          "line": 103,
          "signature": "export interface McpResponse {\n  /** JSON-RPC version. Always '2.0'. */\n  readonly jsonrpc: '2.0';\n  /** The request ID this response corresponds to. */\n  readonly id: McpRequestId;\n  /** The result on success. */\n  readonly result?: unknown;\n  /** The error on failure. */\n  readonly error?: McpErrorObject;\n}",
          "documentation": "A JSON-RPC 2.0 response message."
        },
        {
          "name": "McpCapabilities",
          "line": 117,
          "signature": "export interface McpCapabilities {\n  /** Whether the server provides tools. */\n  readonly tools: boolean;\n  /** Whether the server provides resources. */\n  readonly resources: boolean;\n  /** Whether the server provides prompts. */\n  readonly prompts: boolean;\n}",
          "documentation": "Server capabilities reported during initialization."
        }
      ]
    }
  ]
}
