Instant messaging driving type automatic service processing method and system based on large language model and model context protocol (MCP)
By adopting an instant messaging-driven automated business processing method based on a large language model and MCP, the problems of low efficiency and poor scalability in enterprise internal business operations are solved. It achieves efficient and secure conversion of natural language commands into structured requests and multi-form interaction, supporting flexible expansion and accurate business processing.
Patent Information
- Application Number
- CN202511498167.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2026-01-13
AI Technical Summary
Internal business operations within enterprises are inefficient, error-prone, and difficult to scale. The lack of standardized intermediate protocols between existing large language models and heterogeneous enterprise systems leads to high integration costs, high coupling, and poor scalability.
An instant messaging-driven automated business processing method based on large language models and model context protocols (MCP) is adopted. Through the interaction between the instant messaging platform and the MCP client and server, the conversion of natural language commands into structured requests is realized. The multi-layer architecture of the MCP client and server is used for permission judgment, tool invocation and result feedback.
It achieves a stable conversion from unstructured chat commands to standardized MCP requests, reducing manual steps and repetitive operations, improving business processing efficiency and accuracy, supporting multi-turn session contexts and flexible expansion, and providing secure and compliant multi-form interaction.
Smart Images

Figure CN121334094A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to an instant messaging driven automatic business processing method and system based on large language model and model context protocol (MCP). BACKGROUND
[0002] The common business operations (such as subscription query and cancellation, payment failure record troubleshooting, account state change, etc.) in an enterprise usually need: logging into multiple background systems, finding and filling information in complex interfaces, cross-tool communication and backfilling results; this mode has the following problems: Low efficiency and prone to error: a large number of manual steps, repeated operations and context switching, prone to errors and delays; Integration fragmentation: different system interface styles and authentication methods, point-to-point integration is costly, fragile and not reusable; Difficult to expand: each new operation or access to new business systems often requires changes to the front-end interaction and intermediate logic, with high coupling; With the popularity of large language models, the industry has emerged to use the conversion of "natural language to structured action" for automation, but without standardized intermediate protocols and robust systematic methods, there is still a "last mile" gap between large language models and enterprise heterogeneous systems. Model context protocol (MCP) as an open standard connecting AI and external data sources / tools provides a foundation for unified modeling of "callable tool / service contracts, parameters and context", but how to effectively implement MCP specifications into an enterprise-level closed loop of "chat entry → permission judgment → intent recognition → MCP tool invocation → result return" still lacks general, low-coupling, and scalable engineering practices. Therefore, we improve it and propose an instant messaging driven automatic business processing method and system based on large language model and model context protocol (MCP). SUMMARY
[0003] The present application provides an instant messaging driven automatic business processing method based on large language model and model context protocol (MCP), comprising the following steps: The user sends a message in a group of an instant messaging platform and forms a Webhook event with a group robot; The MCP client exposes an HTTP interface to receive the Webhook event, completes authentication and parses the message; The MCP client sends the message to the large language model, performs ACL permission judgment and identifies the MCPServer method and parameters to be called; if the permission judgment is "not authorized", it is terminated and the permission error is returned to the large language model for organization and explanation and direct execution of "insufficient permissions"; if the permission judgment is "authorized", the next step is performed; The MCP client calls the MCP server (via HTTP+SSE or stdio) to obtain structured results; The MCP client sends the results of the MCPServer to the large language model to obtain the final natural language results; The MCP client sends the final results to the robot Webhook address of the instant messaging platform and initiates the user in the group.
[0004] An instant messaging driven automatic business processing system based on a large language model and a model context protocol (MCP) is used to implement an MCP-based group robot intelligent interaction method, comprising a user interaction layer, an intelligent processing layer, and a core routing and adaptation layer. The user interaction layer is deployed on an instant messaging platform and is used to receive natural language messages sent by a user through an instruction and return a reply message to the user. The intelligent processing layer is deployed on the MCP client side and comprises: A Webhook event receiving and authentication module is used to receive Webhook events from an instant messaging platform and perform signature verification, token authentication, and replay attack protection. A session context manager is used to maintain multi-round dialogue state, remember user parameters, and perform default parameter completion according to session ID. A permission determination composer is used to call a large language model to determine the permission of a current user based on an enterprise policy template, and if the user is determined to have no permission, the process is terminated and a permission insufficient prompt is returned. An intent compiler and parameter extractor are used to parse natural language messages into structured "intent + parameter" forms after the permission determination is passed. An MCP client is used to compile "intent + parameters" into requests that meet MCP specifications and select target MCP servers or tools. A synchronous / asynchronous / streamed reply coordinator is used to select direct HTTP reply, server-sent event (SSE) streaming push, or asynchronous receipt according to task processing time consumption. The core routing and adaptation layer is deployed on the MCP server side and comprises: A tool registry center is used to register available tools, parameter modes, and permission domains in accordance with MCP standard contracts. A policy routing engine is used to select specific tool instances according to intent, parameters, and permissions, tenants, and load policies. An adapter layer is used to convert standard MCP calls into API / SDK calls of target business systems and handle authentication, traffic control, and retry mechanisms. A security and audit module is configured to implement role-based access control (RBAC) or attribute-based access control (ABAC), record operation audit logs, and desensitize sensitive fields.
[0005] As a preferred technical solution of the present application, an external business system layer is further included, which comprises a user information service system, a customer information service system, and a payment / subscription service, and is configured to provide actual business data and operation capabilities.
[0006] As a preferred technical solution of the present application, the communication between the MCP client and the MCP server is at least one of HTTP+SSE or stdio. HTTP+SSE submits a request through HTTP and returns a result through SSE streaming, supports long task progress pushing, and natural language streaming generation. stdio is based on JSON-RPC over stdio implementation, and is suitable for local or same-host container integration, and has low latency characteristics.
[0007] As a preferred technical solution of the present application, the permission determination composer calls a large language model for permission determination before executing intent recognition, and if it is determined that there is no permission, a large language model is called to generate a readable explanation of insufficient permissions, and the MCP client is returned to the instant messaging platform.
[0008] As a preferred technical solution of the present application, the session context manager supports reference resolution, and completes missing parameters in the current request based on historical dialogue records.
[0009] As a preferred technical solution of the present application, the policy routing engine supports dynamic routing selection based on tenant isolation, permission policy, system load, and canary release policy.
[0010] As a preferred technical solution of the present application, the adapter layer supports adaptation of multiple API forms, including REST, GraphQL, RPC, and SDK calls, and integrates authentication management, key rotation, and idempotent retry mechanism.
[0011] As a preferred technical solution of the present application, the synchronous / asynchronous / flow reply coordinator decides the response mode according to the task execution time: For short tasks, synchronous HTTP direct reply is adopted. For long tasks, intermediate results and progress are pushed through SSE streaming, or a task number is returned for subsequent asynchronous query.
[0012] As a preferred technical solution of the application, the customer information service system in the external business system layer is used to query the CustomerId according to the mailbox, mobile phone number or username provided by the user, and the CustomerId is used as a key identifier for querying or operating payment records and subscription information in the payment service system.
[0013] Compared with the prior art, the application has the following beneficial effects: In the scheme of the application: 1. The application stably converts unstructured chat instructions into standardized MCP requests, eliminating the coupling of dialectical APIs of various backend systems. 2. The application constructs a pluggable and programmable "permission / intention→tool (MCPServer / Tool)" routing mechanism, facilitating quick access / offline business capabilities. 3. The application provides synchronous (HTTP) / streaming (SSE) and low-latency (stdio) robust interactions under the premise of ensuring safety, compliance and auditability. 4. The application supports multi-round conversation context, enabling cross-round instructions to be automatically completed with parameters and continuously executed. 5. The application triggers automated business processing flows through natural language instructions, reducing a large number of manual steps and repetitive operations, reducing errors and delays caused by context switching, and significantly improving business processing efficiency and accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0014] Figure 1 The application provides an architecture diagram of an instant messaging driven automated business processing method and system based on a large language model and a model context protocol (MCP). DETAILED DESCRIPTION
[0015] In order for those skilled in the art to better understand the application scheme, the technical solutions in the embodiments of the application will be described clearly and completely below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments are only a part of the embodiments of the application, not all. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the application.
[0016] It should be noted that the embodiments in the application and the features and technical solutions in the embodiments can be combined with each other without conflict.
[0017] It should be noted that: similar reference numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0018] Embodiment 1, a large language model and model context protocol (MCP) based instant messaging driven automation business processing method, comprising the following steps: The user sends a message in a group on an instant messaging platform and a group robot to form a Webhook event; The MCP client exposes an HTTP interface to receive the Webhook event, completes authentication and parses the message; The MCP client sends the message to the large language model, performs ACL permission judgment and identifies the MCP server method and parameters to be called; if the permission judgment is "not authorized", it is aborted, and the permission error is handed over to the large language model to organize an explanation and directly execute a return of "insufficient permissions"; if the permission judgment is "authorized", the next step is performed; The MCP client calls the MCP server (via HTTP+SSE or stdio) to obtain structured results; The MCP client sends the MCP server results to the large language model to obtain the final natural language results; The MCP client sends the final results to the robot Webhook address of the instant messaging platform and initiates the user in the group.
[0019] Embodiment 2, as shown in Figure 1 A large language model and model context protocol (MCP) based instant messaging driven automation business processing system for implementing an MCP based group robot intelligent interaction method, comprising: a user interaction layer, an intelligent processing layer, a core routing and adaptation layer; The user interaction layer is deployed on an instant messaging platform and is used to receive natural language messages sent by the user through instructions and return reply messages to the user; The intelligent processing layer is deployed on the MCP client side and comprises: A Webhook event receiving and authentication module for receiving Webhook events from the instant messaging platform and performing signature verification, token authentication and replay attack protection; A session context manager for maintaining multi-round dialogue state, remembering user parameters and performing default parameter completion according to session ID; A permission determination compiler for calling a large language model to determine the permissions of the current user based on an enterprise policy template, and if the determination is that there is no permission, the process is aborted and a permission insufficient prompt is returned; An intent compiler and parameter extractor for calling a large language model to parse natural language messages into a structured "intent + parameter" form after the permission determination passes; An MCP client for compiling "intent + parameter" into a request conforming to MCP specifications and selecting a target MCP server or tool; Synchronous / Asynchronous / Streaming reply coordinator, used to select direct HTTP reply, server-sent event (SSE) streaming push or asynchronous reply according to task processing time consumption; Core routing and adaptation layer, deployed on the MCP server side, including: Tool registry center, used to register available tools, parameter modes and permission domains in MCP standard contract; Policy routing engine, used to select specific tool instances according to intent, parameters and permissions, tenants, load policies; Adapter layer, used to convert standard MCP calls to API / SDK calls of target business systems, and handle authentication, traffic control and retry mechanisms; Security and audit module, used to implement role-based access control (RBAC) or attribute-based access control (ABAC), record operation audit logs and desensitize sensitive fields.
[0020] Further, it also includes an external business system layer, which includes user information service system, customer information service system, payment / subscription service, used to provide actual business data and operation capabilities.
[0021] Further, the communication between MCP client and MCP server is at least one of HTTP+SSE or stdio; HTTP+SSE submits requests through HTTP and returns results through SSE streaming, supporting long task progress push and natural language streaming generation; stdio is based on JSON-RPC over stdio implementation, suitable for local or same host container integration, with low latency characteristics.
[0022] Further, the permission determination composer calls a large language model for permission determination before executing intent recognition. If it is determined that there is no permission, a large language model is called to generate a readable explanation of insufficient permissions, and returned to the instant messaging platform through the MCP client.
[0023] Further, the session context manager supports reference resolution and completes missing parameters in the current request based on historical dialogue records.
[0024] Further, the policy routing engine supports dynamic routing selection based on tenant isolation, permission policy, system load and canary release policy.
[0025] Further, the adapter layer supports adaptation of multiple API forms, including REST, GraphQL, RPC and SDK calls, and integrates authentication management, key rotation and idempotent retry mechanisms.
[0026] Further, the synchronous / asynchronous / streaming reply coordinator decides the response mode according to the task execution time: For short tasks, use synchronous HTTP direct reply; For long tasks, use SSE streaming to push intermediate results and progress, or return task number for subsequent asynchronous query.
[0027] Further, the customer information service system in the external business system layer is used to query CustomerId according to the mailbox, mobile phone number or username provided by the user, and CustomerId is used as the key identifier for querying or operating payment records and subscription information in the payment service system.
[0028] Example 3, enterprise operation support: Application mode: Through group chat robots to realize the automatic execution of operation and maintenance instructions, such as server state query, log retrieval, service restart, configuration change, etc. Technical features: Use MCP protocol to uniformly encapsulate various operation and maintenance tool APIs, and trigger complex operation and maintenance processes through natural language instructions. Application scenario: IT operation and maintenance team executes "view production environment CPU usage" and "restart web service" instructions in the fly group.
[0029] Example 4, customer service and support: Application mode: Customer service personnel quickly query customer information, handle order problems, execute refund operations, etc. through instant messaging tools; Technical features: Integrate customer information, order, payment and other systems to realize cross-system data query and operation; Application scenario: Customer service personnel query "subscription status of user a@example.com" and "cancel automatic renewal of b@example.com" in the group. Example 5, enterprise internal collaboration: Application mode: Employees quickly obtain business data, execute approval processes, query system status, etc. through group chat; Technical features: Based on role-based permission control, ensure that employees of different ranks can only execute operations with corresponding permissions; Application scenario: Financial personnel query "this month's payment failure records", HR query, and employee permission change history, etc.
[0030] Example 6, data query and analysis: Application mode: Business personnel query various business data through natural language, obtain real-time reports and analysis results; Technical features: Convert complex SQL queries and data analysis tasks into simple natural language instructions; Use case: Sales team queries "number of new customers this week", "conversion rate of product X subscription" and other business metrics.
[0031] Example 7, Querying user subscription information (requires CustomerId): User: "@robot check the subscription information of a@example.com"; LLM (after ACL permission) output: intent=query_subscription, params={email:"a@example.com"}.
[0032] Execution sequence: a. MCP server calls "customer information service" to resolve CustomerId by email; b. Call "payment service / subscription subdomain" to query subscription information by CustomerId; c. Return the result after the large language model restates and replies to the user in the group.
[0033] Example 8, Cancel user subscription (ACL + CustomerId): User: "@robot cancel the subscription of b@example.com"; ACL: Large language model determines whether the operator has the right to cancel the subscription; If not, return a message indicating insufficient rights; After execution: a. Parse CustomerId (customer information service); b. Call payment service to cancel subscription (change interface); c. Return the result (success / failure reason) after the large language model organizes and replies.
[0034] Example 9, Query user payment failure record (requires CustomerId): User: "@robot check the recent payment failure record of c@example.com"; Large language model output: intent=query_payment_failures, params={email:"c@example.com"}; ; Execution: First parse CustomerId, then call payment service to query failure record list; Summarize by large language model into readable list and reply in group.
[0035] Example 10, Asynchronous and streaming receipt implementation (long time-consuming task): When the tool estimates the time to be taken is more than a threshold: push the progress and segment result to the SSE stream periodically; or return the task ID immediately and prompt "will notify you when done"; Trigger a secondary message in the group when the task is completed, with a summary and a link to the details; or return the failure reason and suggest a retry window if it fails; Embodiment 11, security, permission and audit example: Permission: only users with the corresponding role can perform sensitive operations (such as unsubscribing) on the specified object, and the role is mapped to the enterprise identity system; ACL determines in advance and can be linked to user information services; Audit: record the original instruction hash, intent, tool and parameter summary, operator, time, result summary and link ID; sensitive values are stored after desensitization; Error protection: high-risk operations require a second confirmation generated by a large language model, and the user must explicitly confirm before execution.
[0036] In the present application, unless otherwise explicitly specified and limited, the terms "mounting", "connecting", "connecting", "fixing" and the like should be understood broadly, for example, it can be fixedly connected, or it can be detachably connected, or it can be integrated; it can be mechanically connected, or it can be electrically connected or communicate with each other; it can be directly connected, or it can be indirectly connected through an intermediate medium; it can be the internal communication of two elements or the interaction relationship between two elements, unless otherwise explicitly limited. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0037] Obviously, the above-described embodiments are only part of the embodiments of the present application, not all the embodiments, and the preferred embodiments of the present application are given in the drawings, but do not limit the patent scope of the present application. The present application can be realized in many different forms, and conversely, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions recorded in the foregoing embodiments, or equivalently replace some of the technical features. Any equivalent structure made by using the contents of the present application specification and drawings, directly or indirectly applied to other related technical fields, is also within the scope of the patent protection of the present application.
Claims
1. A method for instant messaging driven automation business process based on large language model and model context protocol (MCP), characterized in that, Comprising the following steps: A user sends a message in a group of an instant messaging platform and a group bot to form a Webhook event; An MCP client exposes an HTTP interface to receive the Webhook event, completes authentication and parses the message; The MCP client sends the message to a large language model, performs ACL permission judgment and identifies the MCPServer method and parameters to be called; if the permission judgment is "not authorized", it is aborted, and the permission error is handed over to the large language model to organize an explanation and directly execute a return of "insufficient permissions"; if the permission judgment is "authorized", the next step is performed; The MCP client calls the MCP server to obtain a structured result; The MCP client sends the result of the MCPServer to the large language model to obtain the final natural language result; The MCP client sends the final result to the robot Webhook address of the instant messaging platform and initiates the user in the group.
2. A large language model and model context protocol (MCP) based instant messaging driven automation business processing system for implementing the MCP based group robot intelligent interaction method according to claim 1, characterized in that, Comprising: A user interaction layer, an intelligent processing layer, and a core routing and adaptation layer; The user interaction layer is deployed on an instant messaging platform and is used to receive natural language messages sent by a user through instructions and return reply messages to the user; The intelligent processing layer is deployed on the MCP client side and comprises: A Webhook event receiving and authentication module for receiving Webhook events from an instant messaging platform and performing signature verification, token authentication, and replay attack protection; A session context manager for maintaining multi-round dialogue state, remembering user parameters, and performing default parameter completion according to session ID; A permission judgment compiler for calling a large language model to perform permission judgment on the current user based on an enterprise policy template, and aborting the process and returning a permission insufficient prompt if the judgment is no permission; An intent compiler and parameter extractor for parsing natural language messages into a structured "intent + parameter" form by calling a large language model after the permission judgment is passed; An MCP client for compiling "intent + parameter" into a request conforming to MCP specifications and selecting a target MCP server or tool; A synchronous / asynchronous / streaming reply coordinator for selecting direct HTTP reply, server-sent event (SSE) streaming push, or asynchronous receipt according to task processing time consumption; The core routing and adaptation layer is deployed on the MCP server side and comprises: A tool registry center for registering available tools, parameter modes, and permission domains in MCP standard contracts; A policy routing engine for selecting specific tool instances according to intent, parameters, and permissions, tenants, and load policies; An adapter layer for converting standard MCP calls into API / SDK calls of target business systems and handling authentication, traffic control, and retry mechanisms; A security and audit module for implementing role-based access control (RBAC) or attribute-based access control (ABAC), recording operation audit logs, and desensitizing sensitive fields.
3. The large language model and model context protocol (MCP) based instant messaging driven automated business processing system of claim 2, wherein, Further comprising an external business system layer comprising a user information service system, a customer information service system, and a payment / subscription service for providing actual business data and operation capabilities.
4. The large language model and model context protocol (MCP) based instant messaging driven automated business processing system of claim 2, wherein, The communication between the MCP client and the MCP server is at least one of HTTP+SSE or stdio; HTTP+SSE submits a request through HTTP and returns the result through SSE streaming, supports long task progress pushing and natural language streaming generation; stdio is based on JSON-RPC over stdio implementation, suitable for local or same host container integration.
5. The large language model and model context protocol (MCP) based instant messaging driven automated business processing system of claim 2, wherein, The permission determination composer calls a large language model for permission determination before executing intent recognition. If it is determined that there is no permission, the large language model is called to generate a readable explanation of insufficient permissions, and the MCP client is returned to the instant messaging platform.
6. The large language model and model context protocol (MCP) based instant messaging driven automation business processing system of claim 2, wherein, The session context manager supports reference resolution and completes missing parameters in the current request based on historical conversation records.
7. The large language model and model context protocol (MCP) based instant messaging driven automated business processing system of claim 2, wherein, The policy routing engine supports dynamic routing based on tenant isolation, permission policy, system load, and canary release policy.
8. The large language model and model context protocol (MCP) based instant messaging driven automated business processing system of claim 2, wherein, The adapter layer supports adaptation of multiple API forms, including REST, GraphQL, RPC, and SDK calls, and integrates authentication management, key rotation, and idempotent retry mechanisms.
9. The large language model and model context protocol (MCP) based instant messaging driven automated business processing system of claim 2, wherein, The synchronous / asynchronous / streaming reply coordinator decides the response mode according to the task execution time: For short tasks, use synchronous HTTP direct reply; For long tasks, use SSE streaming to push intermediate results and progress, or return a task number for subsequent asynchronous query.
10. The large language model and model context protocol (MCP) based instant messaging driven automated business processing system of claim 3, wherein, The customer information service system in the external business system layer is used to query CustomerId according to the user-provided email, mobile phone number or username, and CustomerId is used as the key identifier for querying or operating payment records and subscription information in the payment service system.
Citation Information
Cited By
Configuration method and device based on MCP server command system
CN121785687A
A configuration method and device based on an MCP server command system
CN121785687B
Intelligent aviation service message routing and scheduling method based on instant messaging platform
CN122293627A