# Mini-Program AI Development Mode (beta) Integration Guide
Mini-Program AI Development Mode (hereinafter referred to as "this mode") is an intelligent runtime environment and development framework provided by FinClip. Based on this framework, developers can break down the business functions of a Mini-Program into atomic interfaces and atomic components, and encapsulate them into SKILLs for the Mini-Program AI to invoke.
When a user initiates a conversation through the Mini-Program AI, the Mini-Program AI analyzes the user's intent based on the Mini-Program MCP protocol, selects appropriate atomic interfaces and atomic components, completes data processing and task execution, and integrates the results to reply to the user.
In this mode, the user's login identity remains consistent with the original Mini-Program. Developers can share the login credentials within the Mini-Program through storage-related interfaces, or complete the login process through interfaces such as ft.login and ft.getPhoneNumber.
# Basic Concepts
# 1. Mini-Program MCP
Mini-Program MCP is a protocol that exposes invocable capabilities to the Mini-Program AI. Unlike standard MCP, Mini-Program MCP is adapted to the characteristics of Mini-Program development: developers only need to provide complete SKILL implementations according to the framework design, and the Mini-Program AI can correctly reason and execute the corresponding atomic interfaces to ultimately fulfill user requirements.
# 2. Atomic Interface
The smallest execution unit in this mode. It encapsulates a single business function, has standardized input parameters and output structures, runs in an independent JS environment created by the Host-App client, and is isolated from the Mini-Program's own runtime environment.
# 3. Atomic Component
The visual display unit of an atomic interface, responsible for rendering the structured data returned by the atomic interface into GUI cards displayed in the conversation flow.
# 4. Page Relay
Page Relay is an implementation approach for atomic interfaces to perform visual display within a Mini-Program: the structured data returned by the atomic interface is passed to the Mini-Program page for display, seamlessly connecting the conversation flow to the Mini-Program page.
After the user sends a message, the Mini-Program AI outputs a text reply or a Mini-Program "Account Card" reply based on the atomic interface. The user can tap the "Account Card" to enter the corresponding relay page.
# 5. SKILL
SKILL is a complete capability encapsulation for accomplishing tasks in a specific scenario. A Mini-Program can encapsulate multiple SKILLs, and each SKILL contains:
- Business description (
SKILL.md) - Declaration of model-invocable capabilities (
mcp.json) - Implementation of atomic interfaces and atomic components
# Development Guide
# Integration Method
Developers can refer to Integration Method to abstract the business functions of a Mini-Program into atomic interfaces and atomic components, and encapsulate them into SKILLs for the Mini-Program AI to invoke.
# Operating Mechanism
The operating mechanism of this mode involves the interaction among the Host-App client runtime, the Mini-Program AI backend, and third-party services. The execution environment of atomic interfaces and atomic components on the client is independent and different from the Mini-Program's runtime environment. For details, please refer to Operating Mechanism.
# Debugging Guide
Development and integration require a version of FinClip Studio that supports this mode.
# Best Practices
For information on how to properly encapsulate SKILLs so that the Mini-Program AI can accurately identify user intent and provide a better user experience, please refer to Best Practices.
# Component and API Support
The interface capabilities provided in this mode are basically consistent in usage with the Mini-Program environment. Compared to the Mini-Program environment, this mode adds several unique APIs and supports the vast majority of the original built-in components and APIs. For details, please refer to Component and API Support.