### Start MCP Server from Source Source: https://context7.com/linxule/lotus-wisdom-mcp/llms.txt Commands to start the MCP server after building from source. Includes options for standard start, development mode, and enabling debug mode. ```bash # Start server (stdio transport) bun run start # Development mode bun run dev # Enable debug mode for console visualization LOTUS_DEBUG=true bun run start ``` -------------------------------- ### Build and Run Lotus Wisdom MCP from Source Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/README.md These commands are used to install dependencies, build, and start the Lotus Wisdom MCP server from its source code. ```bash bun install bun run build bun run start ``` -------------------------------- ### Server Installation - Claude Desktop Source: https://context7.com/linxule/lotus-wisdom-mcp/llms.txt Instructions for configuring the MCP server within Claude Desktop, including platform-specific configurations and command-line installation methods. ```APIDOC ## Server Configuration ### Description This section details how to configure the MCP server for the lotus-wisdom-mcp project within Claude Desktop. It includes configuration examples for macOS, Windows, and Linux, as well as command-line installation instructions. ### Platform-Specific Configuration #### macOS Add the following to `~/Library/Application Support/Claude/claude_desktop_config.json`: ```json { "mcpServers": { "lotus-wisdom": { "command": "npx", "args": ["-y", "lotus-wisdom-mcp"] } } } ``` #### Windows Add the following to `%APPDATA%\Claude\claude_desktop_config.json`: ```json { "mcpServers": { "lotus-wisdom": { "command": "cmd", "args": ["/c", "npx", "-y", "lotus-wisdom-mcp"] } } } ``` #### Linux Add the following to `~/.config/Claude/claude_desktop_config.json`: ```json { "mcpServers": { "lotus-wisdom": { "command": "npx", "args": ["-y", "lotus-wisdom-mcp"] } } } ``` ### Command-Line Installation #### Claude CLI ```bash claude mcp add lotus-wisdom -- npx -y lotus-wisdom-mcp ``` #### Codex CLI (OpenAI) ```bash codex mcp add lotus-wisdom -- npx -y lotus-wisdom-mcp ``` #### Gemini CLI (Google) ```bash gemini mcp add lotus-wisdom npx -y lotus-wisdom-mcp ``` ### Prerequisites - Node.js 18+ installed. ``` -------------------------------- ### Ping and Initialization Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Handles ping requests and the initial setup after connection. ```APIDOC ## Request Handler: ping ### Description Responds to ping requests from the host. ### Method Request Handler ### Endpoint N/A ### Parameters #### Ping Parameters (object) - **message** (string) - Optional - A message included in the ping. ### Response #### Success Response (200) - **pong** (string) - A confirmation response. ### Request Example ```json { "params": { "message": "Are you there?" } } ``` ### Response Example ```json { "pong": "Yes, I am here." } ``` ## Method: connect ### Description Establishes a connection to the host application and initializes the client. ### Method Asynchronous Method ### Endpoint N/A ### Parameters - **transport** (object) - Optional - The transport layer to use for connection. Defaults to `new DefaultTransport(window.parent, window.parent)`. - **options** (object) - Optional - Connection options, such as `autoResize`. ### Details This method initiates the connection process. Upon successful connection, it sends an `ui/initialize` request to the host and processes the host's capabilities, version, and context. It also sets up size change notifications if `autoResize` is enabled. ### Throws - Error if the app is already connected. - Error if the server sends an invalid initialize result. ## Method: close ### Description Closes the connection to the host application. ### Method Method ### Endpoint N/A ### Details This method is used to gracefully close the established connection. ``` -------------------------------- ### Building from Source Source: https://context7.com/linxule/lotus-wisdom-mcp/llms.txt Instructions for cloning the repository, installing dependencies, and building the Lotus Wisdom MCP server using Bun. ```APIDOC ## Building from Source Clone the repository and build the server using Bun. The build process compiles TypeScript, bundles the ext-apps visualization, and produces a distributable bundle. ### Clone and Install Dependencies ```bash git clone https://github.com/linxule/lotus-wisdom-mcp.git cd lotus-wisdom-mcp bun install ``` ### Build the Server This command compiles TypeScript and bundles the ext-apps visualization. ```bash bun run build ``` ### Start the Server (Stdio Transport) ```bash bun run start ``` ### Development Mode Run the server in development mode. ```bash bun run dev ``` ### Enable Debug Mode Enable debug mode for console visualization. ```bash LOTUS_DEBUG=true bun run start ``` ### Build Outputs - `dist/bundle.js`: Main server bundle. - `dist/journey.html`: Ext-apps UI visualization. ``` -------------------------------- ### CLI Installation Commands Source: https://context7.com/linxule/lotus-wisdom-mcp/llms.txt Use these one-liners to add the MCP server via various CLI tools. ```bash // CLI installation (one-liner) // Claude Code claude mcp add lotus-wisdom -- npx -y lotus-wisdom-mcp // Codex CLI (OpenAI) codex mcp add lotus-wisdom -- npx -y lotus-wisdom-mcp // Gemini CLI (Google) gemini mcp add lotus-wisdom npx -y lotus-wisdom-mcp ``` -------------------------------- ### Run Local Development Server Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/worker/README.md Command to start the local development environment using Wrangler. ```bash bunx wrangler dev ``` -------------------------------- ### Windows CLI MCP Server Setup Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/README.md Use these commands for setting up MCP servers on Windows via the CLI. They utilize `cmd /c` to execute `npx`. ```bash claude mcp add lotus-wisdom -- cmd /c npx -y lotus-wisdom-mcp ``` ```bash codex mcp add lotus-wisdom -- cmd /c npx -y lotus-wisdom-mcp ``` -------------------------------- ### Build Lotus Wisdom MCP from Source Source: https://context7.com/linxule/lotus-wisdom-mcp/llms.txt Steps to clone the repository, install dependencies using Bun, and build the server. This process compiles TypeScript and bundles visualization assets. ```bash # Clone and install dependencies git clone https://github.com/linxule/lotus-wisdom-mcp.git cd lotus-wisdom-mcp bun install # Build (compiles TypeScript + ext-apps visualization) bun run build ``` -------------------------------- ### Install Lotus Wisdom via CLI Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/README.md Commands to add the Lotus Wisdom MCP server to various CLI-based AI tools. ```bash # Claude Code claude mcp add lotus-wisdom -- npx -y lotus-wisdom-mcp # Codex CLI (OpenAI) codex mcp add lotus-wisdom -- npx -y lotus-wisdom-mcp # Gemini CLI (Google) gemini mcp add lotus-wisdom npx -y lotus-wisdom-mcp ``` -------------------------------- ### Initialize Contemplative Journey Source: https://context7.com/linxule/lotus-wisdom-mcp/llms.txt Start a new session by calling the lotuswisdom tool with the 'begin' tag to receive the framework and domain definitions. ```json // MCP Tool Call - Begin contemplative journey { "name": "lotuswisdom", "arguments": { "tag": "begin" } } // Response - Framework received { "status": "FRAMEWORK_RECEIVED", "welcome": "Welcome to the Lotus Wisdom framework. Read this before continuing your contemplative journey.", "philosophy": { "core": "The Lotus Sutra teaches that there are many skillful means to reach the same truth...", "essence": "The wisdom channels itself through your choices. Each step contains all others...", "trust": "Trust what each moment calls for. The path reveals itself in the walking." }, "domains": { "process_flow": { "tags": ["open", "engage", "express"], "spirit": "..." }, "skillful_means": { "tags": ["upaya", "expedient", "direct", "gradual", "sudden"], "spirit": "..." }, "non_dual_recognition": { "tags": ["recognize", "transform", "integrate", "transcend", "embody"], "spirit": "..." }, "meta_cognitive": { "tags": ["examine", "reflect", "verify", "refine", "complete"], "spirit": "..." }, "meditation": { "tags": ["meditate"], "spirit": "..." } }, "guidance": { "workflow": "Call lotuswisdom iteratively with different tags. Do NOT output wisdom until status=WISDOM_READY.", "next": "Proceed with stepNumber: 2 using any tag that feels right (often 'open' or 'examine' to start)." } } ``` -------------------------------- ### Get Prompt Parameters Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Defines parameters for retrieving a specific prompt by name, with optional arguments. ```javascript var Gs = z.extend({name:T(),arguments:P(T(),T()).optional()}); ``` -------------------------------- ### Deploy Lotus Wisdom Worker Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/worker/README.md Commands to install dependencies and deploy the worker to Cloudflare. ```bash cd worker bun install bunx wrangler deploy ``` -------------------------------- ### Get Prompt Request Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Defines the request structure for retrieving a specific prompt. ```javascript var Ks = B.extend({method: I(`prompts/get`),params:Gs}); ``` -------------------------------- ### Create String Starts With Check Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Generates a Zod schema to verify if a string begins with a specified prefix. Includes an optional configuration object. ```typescript function Jr(e,t){return new Nt({check:`string_format`,format:`starts_with`,...g(t),prefix:e})} ``` -------------------------------- ### Setup Automatic Resize Notifications Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Observes changes in the document's dimensions and sends size change notifications to the host. It uses `requestAnimationFrame` for efficient updates and `ResizeObserver` to monitor both the document element and body. ```typescript setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.width,a=r.style.height;r.style.width=`fit-content`,r.style.height=`max-content`;let o=r.getBoundingClientRect();r.style.width=i,r.style.height=a;let s=window.innerWidth-r.clientWidth,c=Math.ceil(o.width+s),l=Math.ceil(o.height);(c!==t||l!==n)&&(t=c,n=l,this.sendSizeChanged({width:c,height:l}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}} ``` -------------------------------- ### Calculate Path Points Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Calculates the positions for drawing connection lines between journey steps. Adjusts for the starting offset and total available space. ```javascript function Hl(){let e=q.length-X;if(!e)return[];let t=X>0?El+kl:El,n=Dl-El;if(e===1)return[(t+n)/2];let r=(n-t)/(e-1);return Array.from({length:e},(e,n)=>t+n*r)} ``` -------------------------------- ### Process Tool Results and Update State Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Handles different statuses from tool results, updating the application state accordingly. This includes starting a journey, completing a meditation, or reaching a wisdom-ready state. ```javascript function $l(e){if(!e||!e.status)return;let t=Rl||e.contemplation||``;Rl=``;let n=e.totalSteps||e.stepNumber||8;if(e.status===`FRAMEWORK_RECEIVED`)Gl({tag:`begin`,dom:`entry`,sn:1,st:n,status:e.status,text:t});else if(e.status===`MEDITATION_COMPLETE`)Zl(e.journey,n),Gl({tag:`meditate`,dom:`meditation`,sn:e.stepNumber,st:n,status:e.status,text:t});else if(e.status===`WISDOM_READY`){Zl(e.finalJourney,n);let r=e.finalStep||`complete`;Gl({tag:r,dom:Vl(r),sn:n,st:n,status:e.status,text:t})}else e.status===`processing`&&(Zl(e.journey,n),Gl({tag:e.currentStep,dom:e.wisdomDomain,sn:e.stepNumber,st:n,status:e.status,text:t}))} ``` -------------------------------- ### Zod GUID Schema Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Defines a Zod schema for validating GUID (Globally Unique Identifier) formats. Ensures the string conforms to a standard GUID pattern. ```javascript var zt=e(\`$ZodGUID\`,(e,t)=>{t.pattern??=Ye,b.init(e,t)}) ``` -------------------------------- ### Client Initialization and Connection Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Establishes a connection to the host application and initializes the client, retrieving host capabilities and context. ```APIDOC ## POST /api/users ### Description Creates a new user in the system. ### Method POST ### Endpoint /api/users ### Parameters #### Request Body - **username** (string) - Required - The desired username. - **email** (string) - Required - The user's email address. - **password** (string) - Required - The user's password. ### Request Example ```json { "username": "johndoe", "email": "john.doe@example.com", "password": "securepassword123" } ``` ### Response #### Success Response (201) - **userId** (string) - The unique identifier for the newly created user. - **message** (string) - A confirmation message. #### Response Example ```json { "userId": "usr_12345abc", "message": "User created successfully." } ``` ``` -------------------------------- ### UI Initialize Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Initializes the application with the host, providing app information, capabilities, and protocol version. ```APIDOC ## POST /ui/initialize ### Description Initializes the application with the host. This is typically the first call made by the app. ### Method POST ### Endpoint /ui/initialize ### Parameters #### Request Body - **appInfo** (object) - Required - App identification (name and version). - **appCapabilities** (object) - Required - Features and capabilities this app provides. - **protocolVersion** (string) - Required - Protocol version this app supports. ``` -------------------------------- ### Zod GUID Schema Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Schema for validating GUID (Globally Unique Identifier) formats. ```javascript ua=e(\`ZodGUID\`,(e,t)=>{ zt.init(e,t), E.init(e,t) }) ``` -------------------------------- ### Get Tasks API Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Retrieves a list of tasks based on the provided parameters. ```APIDOC ## POST /tasks/get ### Description Retrieves tasks based on the provided parameters. ### Method POST ### Endpoint /tasks/get ### Parameters #### Request Body - **params** (object) - Required - Parameters for retrieving tasks. - **taskId** (string) - Required - The ID of the task to retrieve. ### Request Example ```json { "jsonrpc": "2.0", "method": "tasks/get", "params": { "taskId": "task-123" }, "id": 3 } ``` ### Response #### Success Response (200) - **result** (object) - Information about the task. - **taskId** (string) - Required - The ID of the task. - **status** (string) - Required - The status of the task (working, input_required, completed, failed, cancelled). - **ttl** (number) - Optional - Time to live for the task. - **createdAt** (string) - Required - Timestamp when the task was created. - **lastUpdatedAt** (string) - Required - Timestamp when the task was last updated. - **pollInterval** (number) - Required - The interval for polling task status. - **statusMessage** (string) - Optional - A message describing the task status. ``` -------------------------------- ### Get Task Result Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Fetches the result of a completed task. Requires the task ID. ```typescript async getTaskResult(e,t,n){return this.request({method:"tasks/result",params:e},t,n)} ``` -------------------------------- ### Initialize API Connection Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Establishes a connection with the server and initializes the API with client capabilities. ```APIDOC ## POST /initialize ### Description Initializes the API connection by sending client capabilities to the server. ### Method POST ### Endpoint /initialize ### Request Body - **protocolVersion** (string) - Required - The protocol version supported by the client. - **capabilities** (object) - Required - The capabilities of the client. - **experimental** (any) - Optional - Experimental features supported. - **logging** (any) - Optional - Logging capabilities. - **completions** (any) - Optional - Completions capabilities. - **prompts** (object) - Optional - Prompt related capabilities. - **listChanged** (boolean) - Optional - Indicates if prompt list changes are supported. - **resources** (object) - Optional - Resource related capabilities. - **subscribe** (boolean) - Optional - Indicates if resource subscription is supported. - **listChanged** (boolean) - Optional - Indicates if resource list changes are supported. - **tools** (object) - Optional - Tool related capabilities. - **listChanged** (boolean) - Optional - Indicates if tool list changes are supported. - **tasks** (object) - Optional - Task related capabilities. - **list** (string) - Optional - Endpoint for listing tasks. - **cancel** (string) - Optional - Endpoint for cancelling tasks. - **requests** (object) - Optional - Task request capabilities. - **sampling** (object) - Optional - Sampling request capabilities. - **createMessage** (string) - Optional - Endpoint for creating sampling messages. - **elicitation** (object) - Optional - Elicitation request capabilities. - **create** (string) - Optional - Endpoint for creating elicitation requests. - **clientInfo** (object) - Required - Information about the client. - **name** (string) - Required - The name of the client. - **title** (string) - Optional - The title of the client. - **version** (string) - Required - The version of the client. - **websiteUrl** (string) - Optional - The website URL of the client. - **description** (string) - Optional - A description of the client. - **icons** (array) - Optional - Icons for the client. - **src** (string) - Required - The source URL of the icon. - **mimeType** (string) - Optional - The MIME type of the icon. - **sizes** (array) - Optional - An array of sizes for the icon. - **theme** (string) - Optional - The theme of the icon (light or dark). ### Response #### Success Response (200) - **protocolVersion** (string) - The protocol version supported by the server. - **capabilities** (object) - The capabilities of the server. - **experimental** (any) - Optional - Experimental features supported. - **logging** (any) - Optional - Logging capabilities. - **completions** (any) - Optional - Completions capabilities. - **prompts** (object) - Optional - Prompt related capabilities. - **listChanged** (boolean) - Optional - Indicates if prompt list changes are supported. - **resources** (object) - Optional - Resource related capabilities. - **subscribe** (boolean) - Optional - Indicates if resource subscription is supported. - **listChanged** (boolean) - Optional - Indicates if resource list changes are supported. - **tools** (object) - Optional - Tool related capabilities. - **listChanged** (boolean) - Optional - Indicates if tool list changes are supported. - **tasks** (object) - Optional - Task related capabilities. - **list** (string) - Optional - Endpoint for listing tasks. - **cancel** (string) - Optional - Endpoint for cancelling tasks. - **requests** (object) - Optional - Task request capabilities. - **tools** (object) - Optional - Tool request capabilities. - **call** (string) - Optional - Endpoint for calling tools. - **serverInfo** (object) - Information about the server. - **name** (string) - Required - The name of the server. - **title** (string) - Optional - The title of the server. - **version** (string) - Required - The version of the server. - **websiteUrl** (string) - Optional - The website URL of the server. - **description** (string) - Optional - A description of the server. - **icons** (array) - Optional - Icons for the server. - **src** (string) - Required - The source URL of the icon. - **mimeType** (string) - Optional - The MIME type of the icon. - **sizes** (array) - Optional - An array of sizes for the icon. - **theme** (string) - Optional - The theme of the icon (light or dark). - **instructions** (string) - Optional - Instructions for the client. ### Request Example ```json { "jsonrpc": "2.0", "method": "initialize", "params": { "protocolVersion": "1.0", "capabilities": { "experimental": {}, "clientInfo": { "name": "MyClient", "version": "1.0" } } }, "id": 1 } ``` ### Response Example ```json { "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "1.0", "capabilities": { "experimental": {}, "serverInfo": { "name": "MyServer", "version": "1.0" }, "tasks": { "list": "/tasks/list", "cancel": "/tasks/cancel", "requests": { "tools": { "call": "/tools/call" } } } } } } ``` ``` -------------------------------- ### Initialize MCP Client and Handle Host Communication Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Establishes a connection to the host environment, initializes the client with app capabilities and info, and sets up handlers for host communication. It also configures automatic resizing notifications. ```typescript async connect(e=new $c(window.parent,window.parent),t){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:Qc}},Sl,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}} ``` -------------------------------- ### Windows MCP Server Configuration Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/README.md On Windows, `npx` requires a shell wrapper. Use this JSON configuration to specify `cmd` as the command and provide the necessary arguments. ```json { "command": "cmd", "args": ["/c", "npx", "-y", "lotus-wisdom-mcp"] } ``` -------------------------------- ### Get Task Details Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Retrieves the details of a specific task using its ID. Requires the task ID as a parameter. ```typescript async getTask(e,t){return this.request({method:"tasks/get",params:e},fs,t)} ``` -------------------------------- ### POST ui/notifications/sandbox-proxy-ready Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Notifies the host that the sandbox proxy is ready for communication. ```APIDOC ## POST ui/notifications/sandbox-proxy-ready ### Description Notifies the host environment that the sandbox proxy is initialized and ready. ### Method POST ### Endpoint ui/notifications/sandbox-proxy-ready ``` -------------------------------- ### Host Capabilities: General Features Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Describes general capabilities of the host, including experimental features, opening links, file downloads, server proxying, logging, sandboxing, and context updates. ```javascript hl=j({experimental:j({}).optional().describe(`Experimental features (structure TBD).`),openLinks:j({}).optional().describe(`Host supports opening external URLs.`),downloadFile:j({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:j({listChanged:O().optional().describe(`Host supports tools/list_changed notifications.`)}) .optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:j({listChanged:O().optional().describe(`Host supports resources/list_changed notifications.`)}) .optional().describe(`Host can proxy resource reads to the MCP server.`),logging:j({}).optional().describe(`Host accepts log messages.`),sandbox:j({permissions:sl.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:ol.optional().describe(`CSP domains approved by the host.`)}) .optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:ml.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:ml.optional().describe(`Host supports receiving content messages (ui/message) from the view.`)}) ``` -------------------------------- ### Initialize MCP Session via HTTP POST Source: https://context7.com/linxule/lotus-wisdom-mcp/llms.txt Initialize a new session with the MCP HTTP server by sending a POST request with the 'initialize' method. The server will respond with a session ID in the headers. ```bash # Initialize new session (POST without session ID) curl -X POST https://lotus-wisdom-mcp.example.dev/mcp \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": { "name": "example-client", "version": "1.0.0" } } }' ``` -------------------------------- ### Schema Registry Implementation Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Manages schema metadata using a WeakMap for instance tracking and a Map for ID-based lookups. ```javascript e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Zn(t,n,r,e));Zn(i,n,r,e)}});function Zn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Se(e))}}var Qn,$n=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)};function er(){return new $n}(Qn=globalThis).__zod_globalRegistry??(Qn.__zod_globalRegistry=er());var tr=globalThis.__zod_globalRegistry; ``` -------------------------------- ### Create ZodExactOptional Schema Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Use the `$a` function to create a ZodExactOptional schema. This is similar to ZodOptional but might have stricter behavior in certain contexts. The `Qa` constructor is used internally. ```typescript function $a(e){return new Qa({type:"optional",innerType:e})} ``` -------------------------------- ### lotuswisdom Tool API Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/README.md The lotuswisdom tool facilitates a structured thinking process inspired by the Lotus Sutra for problem-solving. It guides users through different wisdom domains and thought techniques. ```APIDOC ## POST /lotuswisdom ### Description Initiates or continues a problem-solving process using the Lotus Sutra's wisdom framework. Begin with `tag='begin'` to receive the full framework, then proceed with other contemplation tags. ### Method POST ### Endpoint /lotuswisdom ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **tag** (string) - Required - The current processing technique (e.g., `begin`, `upaya`, `recognize`, `examine`, `open`, `meditate`). - **content** (string) - Required - The content of the current processing step. - **stepNumber** (integer) - Required - Current number in the sequence. - **totalSteps** (integer) - Required - Estimated total steps needed for the process. - **nextStepNeeded** (boolean) - Required - Indicates whether another step is required. - **isMeditation** (boolean) - Optional - Specifies if this step is a meditative pause. - **meditationDuration** (integer) - Optional - Duration for meditation in seconds (1-10). ### Request Example ```json { "tag": "begin", "content": "My problem is about X.", "stepNumber": 1, "totalSteps": 5, "nextStepNeeded": true } ``` ### Response #### Success Response (200) - **status** (string) - Processing status (e.g., `MEDITATION_COMPLETE`, `WISDOM_READY`). - **wisdomDomain** (string) - The current wisdom domain being processed. - **journeyTracking** (object) - Information about the tag and domain movements. - **currentStep** (object) - Details of the current processing step. #### Response Example ```json { "status": "CONTINUE", "wisdomDomain": "Entry", "journeyTracking": { "tagPath": ["begin"], "domainPath": ["Entry"] }, "currentStep": { "stepNumber": 1, "tag": "begin", "content": "Full framework provided.", "isMeditation": false } } ``` ``` -------------------------------- ### POST ui/open-link Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Requests the host environment to open a specific URL in the browser. ```APIDOC ## POST ui/open-link ### Description Requests the host environment to open a provided URL in the host's browser. ### Method POST ### Endpoint ui/open-link ### Parameters #### Request Body - **url** (string) - Required - URL to open in the host's browser ### Response #### Success Response (200) - **isError** (boolean) - Optional - True if the host failed to open the URL (e.g., due to security policy). ``` -------------------------------- ### Configure Lotus Wisdom MCP Server (JSON) Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/README.md Use this JSON configuration for Cherry Studio or other MCP clients that accept JSON input. Ensure the command and arguments are correctly set for npx. ```json { "lotus-wisdom": { "name": "Lotus Wisdom", "command": "npx", "args": ["-y", "lotus-wisdom-mcp"], "isActive": true } } ``` -------------------------------- ### Enable Debug Mode for Lotus Wisdom MCP Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/README.md To enable debug mode for the Lotus Wisdom MCP server, set the `LOTUS_DEBUG` environment variable to `true` before running the start command. ```bash LOTUS_DEBUG=true bun run start ``` -------------------------------- ### Set Request Handler for Listing Tools Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Sets up a handler for requests to list available tools. The handler function receives parameters and a callback to send the list of tools back to the host. ```typescript set onlisttools(e){this.setRequestHandler(oc,(t,n)=>e(t.params,n))} ``` -------------------------------- ### Claude Desktop Configuration Source: https://context7.com/linxule/lotus-wisdom-mcp/llms.txt Configure the MCP server in the Claude Desktop application. Windows users may require a shell wrapper. ```json // macOS: ~/Library/Application Support/Claude/claude_desktop_config.json // Windows: %APPDATA%\Claude\claude_desktop_config.json // Linux: ~/.config/Claude/claude_desktop_config.json { "mcpServers": { "lotus-wisdom": { "command": "npx", "args": ["-y", "lotus-wisdom-mcp"] } } } // Windows requires shell wrapper { "mcpServers": { "lotus-wisdom": { "command": "cmd", "args": ["/c", "npx", "-y", "lotus-wisdom-mcp"] } } } ``` -------------------------------- ### Receive MCP Notifications via Server-Sent Events Source: https://context7.com/linxule/lotus-wisdom-mcp/llms.txt Subscribe to server-sent events for notifications from the MCP server by sending a GET request with the session ID. Use the `-N` flag to disable output buffering. ```bash # Server-Sent Events for notifications (GET) curl -N https://lotus-wisdom-mcp.example.dev/mcp \ -H "mcp-session-id: " ``` -------------------------------- ### Configure Lotus Wisdom MCP Server (TOML) Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/README.md This TOML configuration is for the Codex CLI. Edit the `~/.codex/config.toml` file directly to add or modify the MCP server settings. ```toml [mcp_servers.lotus-wisdom] command = "npx" args = ["-y", "lotus-wisdom-mcp"] ``` -------------------------------- ### Initialized Notification Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Notifies the client that the server has been initialized. ```APIDOC ## POST /notifications/initialized ### Description Notifies the client that the server has been initialized. ### Method POST ### Endpoint /notifications/initialized ### Parameters #### Request Body - **params** (object) - Optional - Initialization parameters. ``` -------------------------------- ### Host Information and Context Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Provides access to host application information, capabilities, and context. ```APIDOC ## GET /host/info ### Description Retrieves information about the host application, including its version. ### Method GET ### Endpoint /host/info ### Response #### Success Response (200) - **version** (string) - The version of the host application. #### Response Example ```json { "version": "1.2.3" } ``` ## GET /host/capabilities ### Description Retrieves the features and capabilities provided by the host application. ### Method GET ### Endpoint /host/capabilities ### Response #### Success Response (200) - **capabilities** (object) - An object detailing the host's capabilities. #### Response Example ```json { "capabilities": { "tool_support": true, "resource_management": false } } ``` ## GET /host/context ### Description Retrieves rich context about the host environment. ### Method GET ### Endpoint /host/context ### Response #### Success Response (200) - **context** (object) - An object containing context information about the host. #### Response Example ```json { "context": { "user_id": "user_abc", "session_id": "sess_xyz" } } ``` ## Event Handler: onHostContextChanged ### Description Callback function that is invoked when the host context changes. ### Method Event Handler ### Endpoint N/A ### Parameters #### Context Update (object) - **key** (string) - The key of the context field that changed. - **value** (any) - The new value of the context field. ### Details This handler allows the client to react to updates in the host's environment context. ``` -------------------------------- ### Initialize Lotus Wisdom Extension Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Initializes the Lotus Wisdom extension, setting up event listeners for tool input, tool results, and errors. It also handles connection to the parent window if not in an iframe. ```javascript var eu=new Cl({name:`Lotus Wisdom Journey`,version:`1.0.0`});if(eu.ontoolinput=e=>{let t=e.arguments;t?.content&&(Rl=t.content)},eu.ontoolresult=e=>{let t=Ql(e);t&&$l(t)},eu.onerror=e=>console.error(`Lotus Wisdom ext-apps error:`,e),window!==window.parent)eu.connect().then(()=>{console.info(`Lotus Wisdom: ext-apps connected`)}).catch(e=>{console.error(`Lotus Wisdom: ext-apps connection failed:`,e)});else{let e=[{status:`FRAMEWORK_RECEIVED`,totalSteps:8,contemplation:`Beginning contemplative journey to design the visual form of lotus wisdom.`,`_d`:1e3},{status:`processing`,currentStep:`open`,wisdomDomain:`process_flow`,stepNumber:2,totalSteps:8,contemplation:`The core tension: lotus wisdom is a contemplative process that unfolds in time — a journey through domains.`,`_d`:1800},{status:`processing`,currentStep:`recognize`,wisdomDomain:`non_dual_recognition`,stepNumber:3,totalSteps:8,contemplation:`I recognize the visual should NOT be busy. The UI should breathe.`,`_d`:2200},{status:`processing`,currentStep:`examine`,wisdomDomain:`meta_cognitive`,stepNumber:4,totalSteps:8,contemplation:`The ext-apps iframe receives tool results via postMessage.`,`_d`:1600},{status:`MEDITATION_COMPLETE`,stepNumber:5,totalSteps:8,journey:`begin → open → recognize → examine → meditate`,contemplation:`Pausing to let the visual form emerge.`,`_d`:3200},{status:`processing`,currentStep:`integrate`,wisdomDomain:`non_dual_recognition`,stepNumber:6,totalSteps:8,journey:`begin → open → recognize → examine → meditate → integrate`,contemplation:`The visual form should mirror the journey’s own structure.`,`_d`:2400},{status:`processing`,currentStep:`refine`,wisdomDomain:`meta_cognitive`,stepNumber:7,totalSteps:8,journey:`begin → open → recognize → examine → meditate → integrate → refine`,contemplation:`Three visual layers: trace, content, completion.`,`_d`:1800},{status:`WISDOM_READY`,totalSteps:8,finalStep:`express`,finalJourney:`begin → open → recognize → examine → meditate → integrate → refine → express`,contemplation:`The visual design emerges as a living journey trace.`,`_d`:2e3}],t=1200;for(let n of e){let e=t;setTimeout(()=>$l(n),e),t+=n._d}} ``` -------------------------------- ### Define Prompt Schema Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Defines the schema for a prompt, including description, arguments, and metadata. ```javascript var Hs = j({...Ho.shape,...Vo.shape,description:T().optional(),arguments:L(A(Vs)),_meta:L(M({}))}); ``` -------------------------------- ### POST /tools/call Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Executes a tool call with specified arguments. ```APIDOC ## POST tools/call ### Description Invokes a tool by name with the provided input arguments. ### Method POST ### Endpoint tools/call ### Parameters #### Request Body - **name** (string) - Required - The name of the tool to call. - **arguments** (object) - Optional - The arguments to pass to the tool. ``` -------------------------------- ### Call Tool Parameters Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Defines parameters for calling a tool, including its name and arguments. ```javascript var lc = Eo.extend({name:T(),arguments:P(T(),k()).optional()}); ``` -------------------------------- ### List Resources Request Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Defines the request structure for listing resources. ```javascript var Es = is.extend({method: I(`resources/list`)}),Ds=as.extend({resources:A(ws)}); ``` -------------------------------- ### List Tools Request Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Defines the request structure for listing available tools. ```javascript var oc = is.extend({method: I(`tools/list`)}),sc=as.extend({tools:A(ac)}); ``` -------------------------------- ### Query summary tool usage Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/worker/ANALYTICS.md Aggregates summary tool calls per client. ```sql SELECT index1 AS client, SUM(_sample_interval) AS summary_calls FROM lotus_wisdom_usage WHERE blob1 = 'summary' GROUP BY client ORDER BY summary_calls DESC ``` -------------------------------- ### App Capabilities: Tools and Display Modes Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Defines capabilities of the app, including support for tool notifications and available display modes. ```javascript gl=j({experimental:j({}).optional().describe(`Experimental features (structure TBD).`),tools:j({listChanged:O().optional().describe(`App supports tools/list_changed notifications.`)}) .optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:A(tl).optional().describe(`Display modes the app supports.`)}) ``` -------------------------------- ### List Server Resources Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Asynchronously retrieves a list of resources available on the server. This is useful for browsing or discovering available resources. ```typescript async listServerResources(e,t){return await this.request({method:`resources/list`,params:e},Ds,t)} ``` -------------------------------- ### List Tasks Request Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Defines the structure for listing existing tasks. ```javascript var ms = is.extend({method: I(`tasks/list`)}),hs=as.extend({tasks:A(ss)}); ``` -------------------------------- ### Configure MCP Client for Stdio Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/worker/README.md Configuration for MCP clients like Claude Desktop that require mcp-remote to bridge the HTTP endpoint. ```json { "mcpServers": { "lotus-wisdom": { "command": "npx", "args": ["-y", "mcp-remote", "https://lotus-wisdom-mcp..workers.dev/mcp"] } } } ``` -------------------------------- ### UI Interaction and Notifications Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Handles various UI interactions such as sending messages, opening links, downloading files, and managing display modes, along with setting up size change notifications. ```APIDOC ## POST /ui/message ### Description Sends a message to the UI. ### Method POST ### Endpoint /ui/message ### Parameters #### Request Body - **text** (string) - Required - The message content. ### Request Example ```json { "text": "Hello, world!" } ``` ## POST /ui/open-link ### Description Opens a specified link in the UI. ### Method POST ### Endpoint /ui/open-link ### Parameters #### Request Body - **url** (string) - Required - The URL to open. ### Request Example ```json { "url": "https://example.com" } ``` ## POST /ui/download-file ### Description Initiates a file download in the UI. ### Method POST ### Endpoint /ui/download-file ### Parameters #### Request Body - **url** (string) - Required - The URL of the file to download. - **filename** (string) - Optional - The desired name for the downloaded file. ### Request Example ```json { "url": "https://example.com/file.pdf", "filename": "document.pdf" } ``` ## POST /ui/request-display-mode ### Description Requests a specific display mode for the UI. ### Method POST ### Endpoint /ui/request-display-mode ### Parameters #### Request Body - **mode** (string) - Required - The desired display mode (e.g., 'compact', 'expanded'). ### Request Example ```json { "mode": "compact" } ``` ## POST /ui/notifications/size-changed ### Description Sends a notification that the UI size has changed. ### Method POST ### Endpoint /ui/notifications/size-changed ### Parameters #### Request Body - **width** (integer) - Required - The new width of the UI. - **height** (integer) - Required - The new height of the UI. ### Request Example ```json { "width": 800, "height": 600 } ``` ## Event Handler: onSizeChanged ### Description Sets up a handler to observe and notify about UI size changes. ### Method Event Handler ### Endpoint N/A ### Details This method sets up a `ResizeObserver` to monitor the dimensions of the document element and body. It sends a `ui/notifications/size-changed` notification whenever the dimensions change. It returns a function to disconnect the observer. ### Return Value - **disconnect** (function) - A function that, when called, disconnects the `ResizeObserver`. ``` -------------------------------- ### Configure lotus-wisdom-mcp in MCP settings Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/llms.txt Add this configuration to your MCP server settings to enable the lotus-wisdom tool via npx. ```json { "mcpServers": { "lotus-wisdom": { "command": "npx", "args": ["-y", "lotus-wisdom-mcp"] } } } ``` -------------------------------- ### UI Resource Configuration Source: https://github.com/linxule/lotus-wisdom-mcp/blob/main/dist/journey.html Configuration for UI resources, including Content Security Policy (CSP), sandbox permissions, and a dedicated domain for the view sandbox. ```javascript j({csp:ol.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:sl.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:T().optional().describe(`Dedicated origin for view sandbox. Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists. **Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include: - Hash-based subdomains (e.g., - URL-derived subdomains (e.g., `) ```