MCP SDK Overview
@divinci-ai/mcp is a client for the Model Context
Protocol. It connects MCP-compatible AI
assistants — Claude Desktop, Cursor, or your own agent — to Divinci’s tools and
resources over an SSE transport, with optional Auth0 sign-in and x402
pay-per-call.
Features
Section titled “Features”- Tool discovery and invocation
- Resource and prompt access
- Auto-reconnecting SSE transport
- Auth0 (PKCE) authentication
- x402 payments for premium tools
Installation
Section titled “Installation”npm install @divinci-ai/mcpBasic usage
Section titled “Basic usage”Tool and resource operations hang off the client; tool calls specifically live on
the tools accessor.
import { McpClient } from "@divinci-ai/mcp";
const mcp = new McpClient({ serverUrl: "https://mcp.divinci.app",});
await mcp.connect();
// Discover and call tools via the `tools` accessorconst tools = await mcp.tools.listTools();const result = await mcp.tools.callTool("search_knowledge", { query: "refunds" });Configuration options
Section titled “Configuration options”| Option | Type | Default | Description |
|---|---|---|---|
serverUrl | string | — | Required. MCP server URL. |
clientName | string | divinci-mcp-client | Identifies your client to the server. |
clientVersion | string | 0.1.0 | Your client version. |
timeout | number | 30000 | Request timeout (ms). |
autoReconnect | boolean | true | Reconnect dropped SSE connections. |
maxReconnectAttempts | number | 5 | Reconnect attempts before giving up. |
auth | McpAuthOptions | — | Auth0 config (Authentication). |
payment | McpPaymentOptions | — | x402 wallet + autopay (Payments). |
debug | boolean | false | Verbose logging. |
Next steps
Section titled “Next steps” Connecting Lifecycle, connection state, and reconnection.
Tools Discover, call, and build tools.
Resources & Prompts Read resources and fetch prompts.
Authentication The Auth0 PKCE browser flow.