Local resource interaction and state feedback method and system based on MCP protocol

By establishing a unified communication mechanism between browser plugins and local service programs through the MCP protocol, the problems of low interaction efficiency and non-real-time status feedback between browser plugins and local systems are solved, enabling efficient and real-time operation and status feedback of various local resources, thereby improving user experience and system scalability.

CN121603485APending Publication Date: 2026-03-03WANDE INFORMATION SOFTWARE (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511789839.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-01
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing browser plugins have low interaction efficiency with the local system, lack a unified protocol resulting in poor scalability, non-real-time status feedback, and a poor user experience.

Method used

A unified communication mechanism between browser plugins and local service programs is designed using the MCP protocol. A secure encrypted channel is implemented through a TCP long connection. A new status event type is added to push operation progress and status in real time, and transparent access to various local resources is supported.

Benefits of technology

It improves the interaction efficiency between browser plugins and the local system, enables transparent access to various local resources and real-time status feedback, and enhances user experience and system scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121603485A_ABST
    Figure CN121603485A_ABST
Patent Text Reader

Abstract

The invention relates to a local resource interaction and state feedback method and system based on an MCP protocol, and the method comprises the steps: 1, enabling a browser plug-in to actively initiate a connection request to a local service program after the browser plug-in is started, and building MCP protocol long connection based on a TCP (Transmission Control Protocol) through HTTP (Hyper Text Transport Protocol) negotiation; step 2, the plug-in packages the user request into an MCP protocol message, and sends an MCP resource request to a local service program through the established long connection; step 3, the service program receives and analyzes the MCP request message, checks user permission, generates a protocol message, and sends an operation result and final state feedback; and step 4, the plug-in receives and analyzes the MCP protocol message returned by the server, and the plug-in updates the user interface according to the feedback information to realize visualization of the operation state, progress and result. The problems that how to enable the browser plug-in to efficiently interact with the local system resources to provide the extended function and feed back the calling state and result of the system resources in real time are solved, and effective interaction between the browser and the local system resources is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer network technology, and in particular to a method and system for browser plugins to interact with local system resources and provide status feedback based on the MCP (Model Context Protocol), aiming to expand the browser's localization processing capabilities and interactive functions. Background Technology

[0002] As modern browsers continue to expand their functionality, browser plugins, as lightweight extension tools, have been widely used to improve user experience and enhance browser capabilities. However, current browser plugin capabilities mainly focus on accessing web page resources and interface optimization, lacking the ability to directly and efficiently interact with local systems, such as accessing user files, email systems, MIS, and other internal systems.

[0003] In existing related technologies, the main solutions for browser plugins to interact with the local system include: 1. Chrome Native Messaging API Solution: This solution uses the NativeMessaging API provided by the Chrome browser to enable communication between the plugin and the native application. However, it requires developing a separate native application for each function and communicating via the JSON-RPC protocol. Disadvantages include low communication efficiency, frequent inter-process communication, and a lack of a unified state management mechanism. 2. Electron Framework Solution: This solution uses the Electron framework to package a web application into a desktop application, accessing local resources via Node.js; it uses IPC (Inter-Process Communication) to achieve communication between the rendering process and the main process; its disadvantages include large application size, long startup time, and unsuitability for lightweight plugin scenarios. 3. WebSocket long connection solution: A WebSocket server runs locally, and browser plugins communicate via WebSocket connections; it supports bidirectional communication and can achieve real-time data push; disadvantages: lack of standardized protocol specifications, different applications need to customize communication formats, and it has poor scalability. 4. File Upload / Download API Solution: Interacts with local resources indirectly through the browser's file upload / download API; requires users to manually select files, and cannot achieve automated resource access; disadvantages: poor user experience, inability to achieve real-time interaction, and limited functionality. Existing technologies share the following common drawbacks: Efficiency issues: Due to the lack of a flexible and unified protocol, different functional modules require separate development and interface definition, leading to repetitive work; Scalability issues: Existing technologies cannot be flexibly extended to other local resources, requiring redevelopment for each resource; Status feedback issues: Existing technologies typically use fixed polling methods to check operation status and cannot provide real-time feedback, resulting in delayed responses; Protocol standardization issues: The lack of a unified communication protocol standard leads to poor interoperability between different applications. Summary of the Invention

[0004] This invention aims to solve the following technical problems: 1. How to enable browser plugins to interact efficiently with local system resources to provide extended functionality; 2. How to achieve transparent access to various local resources (such as file systems, email systems, MIS systems, etc.) through a unified protocol. 3. How to provide real-time feedback on the status and results of system resource calls to improve user experience and avoid the real-time issues caused by traditional polling methods.

[0005] To address the aforementioned technical problems, this invention proposes a method and system for local resource interaction and status feedback based on the MCP protocol. By designing a unified communication mechanism between the local service program (MCP Server) and the browser plugin (MCP Client), effective interaction between the browser and local system resources is achieved.

[0006] The technical solution of this invention is as follows: A method for local resource interaction and status feedback based on the MCP protocol, comprising: Step 1: Connection Initialization Step 1.1 After the browser plugin is launched, it actively initiates a connection request to the local service program and establishes a long connection based on the TCP MCP protocol through HTTP negotiation; Step 1.2 During the connection establishment process, the plugin and the service program exchange authentication tokens to complete identity verification and establish a secure encrypted channel; Step 2: Request Generation and Sending Step 2.1 When a user initiates a resource operation in the browser interface, the plugin abstracts the user operation into a standard MCP resource request; Step 2.2 The plugin encapsulates the request into an MCP protocol message, including resource type, operation type, parameter information, and authentication information; Step 2.3 The plugin sends the MCP resource request to the local service program through the established long connection; Step 3: Server-side processing and feedback Step 3.1 The service program receives and parses the MCP request message and verifies the user's permissions; Step 3.2 The service program calls the corresponding local system resource interface and performs resource operations according to the request content; Step 3.3 During the operation, the service program generates a "status event" protocol message and periodically pushes the operation progress, status and possible abnormal information to the plugin in real time. Step 3.4 After the operation is completed, the service program sends the operation result and final status feedback; Step 4: Client feedback processing and interface update Step 4.1 The plugin receives and parses the MCP protocol messages returned by the server, including the progress push of the status event and the final operation result; Step 4.2 The plugin updates the user interface based on the feedback information to visualize the operation status, progress, and results; Step 4.3 For abnormal situations, the plugin displays corresponding error messages or handling suggestions.

[0007] Furthermore, the MCP protocol message includes: A new "status" event type has been added to the MCP protocol message structure for asynchronous, real-time reporting of operation progress and intermediate status. An event type field, `event_type`, has been added to the MCP protocol data message structure, with a new value type "status". The status event includes fields for operation ID, progress percentage, and status description. When the local service program performs resource operations, it periodically pushes status event messages to the client via the MCP protocol. The client parses the status event messages and updates the operation progress or status display in real time.

[0008] A local resource interaction and status feedback system based on the MCP protocol, used to implement the local resource interaction and status feedback method based on the MCP protocol as described above, including: Browser Plugin: As an MCP Client, it runs on the browser side and is used to establish connections with local service programs via the MCP protocol, send resource operation requests, and receive status feedback. Communication module: Implements the MCP protocol to connect with the local service program and exchanges data via TCP communication. Request assembly module: responsible for encapsulating the resource access operations initiated by the user on the browser into MCP protocol data packets; Status monitoring and feedback module: This module listens for messages from local service programs, parses them according to the protocol, and displays them to the user. Local service program: As an MCP server, it runs on the user's computer, providing resource service interfaces that support the MCP protocol, as well as a message event mechanism to handle requests initiated by plugins and return results and status. Protocol parser: Parses and verifies parameters of the received request content from the MCP Client; Resource Manager: Based on the parsed request, it calls the local operating system's interface to perform specific operations; Event mechanism module: Listens for various events during the data operation process and pushes event messages to the client; Status feedback module: Generates status feedback messages based on the operation results and pushes them to the client in MCP protocol format to achieve feedback.

[0009] The beneficial effects of this invention are as follows: Unified Resource Management: By abstracting operations on different types of resources through the MCP protocol, it avoids designing separate interfaces for each type of resource, thereby improving development efficiency; Real-time feedback mechanism: The event-driven approach is used to proactively push results, avoiding the waste of resources caused by polling and improving the real-time performance of the interaction; High scalability: New resource types can be added at any time (such as adding video playback and audio processing functions), simply by defining new command types and parameters; Enhanced user experience: The plugin can quickly respond to changes in operation status and update interface information, providing users with a smooth interactive experience. Attached Figure Description

[0010] Figure 1 This is a system architecture diagram of the present invention; Figure 2 This is a flowchart illustrating the workflow of the browser plugin of this invention. Detailed Implementation

[0011] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.

[0012] A method for local resource interaction and status feedback based on the MCP protocol is as follows: 1. Architecture Design This resource interaction system involves the following main components and modules: Browser Plugin: As an MCP Client, it runs on the browser side and is used to establish connections with local service programs via the MCP protocol, send resource operation requests, and receive status feedback. 1. Communication module: Implements the MCP protocol to connect with the local service program and exchanges data through TCP communication.

[0013] 2. Request Assembly Module: Responsible for encapsulating resource access operations initiated by users on the browser into MCP protocol data packets.

[0014] 3. Status monitoring and feedback module: This module monitors messages from local service programs, parses them according to the protocol, and displays them to the user.

[0015] Local service program: As an MCP server, it runs on the user's computer, providing a resource service interface that supports the MCP protocol, as well as a message event mechanism to handle requests initiated by plugins and return results and status.

[0016] 1. Protocol parser: Parses and verifies parameters of the received MCP Client request content.

[0017] 2. Resource Manager: Based on the parsed request, it calls the local operating system's interfaces to perform specific operations on resources such as the file system and email system.

[0018] 3. Event Mechanism Module: Listens for various events (such as progress updates) during the data operation process and pushes event messages to the client.

[0019] 4. Status Feedback Module: Generates status feedback messages based on the operation results and pushes them to the client in MCP protocol format to provide feedback on operation results, event notifications, etc.

[0020] 2. Introduction to the MCP Protocol MCP (Model Context Protocol) is an open-source protocol introduced by Anthropic, designed to achieve seamless integration of large language models (LLMs) with external data sources and tools. It establishes secure, bidirectional links between large models and data sources. The core purpose of this protocol is to enhance the functionality and usability of LLMs, enabling them to invoke external tools or obtain real-time data based on context, rather than being limited to static knowledge.

[0021] This invention makes the following key improvements to the MCP protocol: A new status event type has been added: used to push operation status and progress information in real time. This effectively solves the problem that the existing protocol only supports the final result feedback and cannot monitor the operation progress in real time, thus improving the user experience and the process controllability of the system.

[0022] Traditional MCP protocols primarily support synchronous feedback between requests and results, failing to meet the real-time status and progress updates required for complex resource operations. This invention adds a "status" event type to the MCP protocol message structure for asynchronous, real-time reporting of operation progress and intermediate states.

[0023] 1. In the data packet structure of the MCP protocol, an event type field (event_type) is added, and its value has a new "status" type.

[0024] 2. The status event includes fields such as operation ID, progress percentage, and status description.

[0025] 3. When the local service program performs resource operations (such as file transfer, batch processing, etc.), it periodically pushes status event messages to the client through the MCP protocol.

[0026] 4. The client parses the status event message and updates the operation progress or status display in real time.

[0027] 2.1 MCP Protocol Message Format The MCP protocol message format used in this invention is as follows: Request message format: { "jsonrpc": "2.0", "id": "unique_request_id", "method": "tools / call", "params": { "name": "resource_operation_name", "arguments": { "operation_type": "read|write|execute", "resource_path": " / path / to / resource", "parameters": {...} } } } Status feedback message format: { "jsonrpc": "2.0", "method": "notifications / status", "params": { "event": "status", "data": { "id": "unique_request_id", "message": "Description of operation status", "progress": 75, "timestamp": "2024-01-01T12:00:00Z" } } } event: status indicates a status change. data: contains id, message, and progress, where id is a unique identifier for the plugin request operation; message represents the status information being transmitted; and progress represents the execution progress.

[0028] Result feedback message format: { "jsonrpc": "2.0", "method": "notifications / message", "params": { "event": "message", "data": { "id": "unique_request_id", "content": "Operation result content", "status": "success|error", "timestamp": "2024-01-01T12:00:00Z" } } } event: message indicates the execution result. data: contains id and content, where id is a unique identifier for the plugin request operation; content represents the returned result information.

[0029] 3. Implementation Cases This method includes the following steps: 1. Connection Initialization 1.1 After the browser plugin is launched, it actively initiates a connection request to the local service program and establishes a long connection based on the TCP MCP protocol through HTTP negotiation.

[0030] 1.2 During the connection establishment process, the plugin and the service program exchange authentication tokens to complete identity verification and establish a secure encrypted channel.

[0031] 2. Request generation and sending 2.1 When a user initiates a resource operation (such as file reading / writing, function call, etc.) in the browser interface, the plugin abstracts the user operation into a standard MCP resource request.

[0032] 2.2 The plugin encapsulates the request into an MCP protocol message, including resource type, operation type, parameter information, and authentication information.

[0033] 2.3 The plugin sends MCP resource requests to the local service program through the established long connection.

[0034] 3. Server-side processing and feedback 3.1 The service program receives and parses the MCP request message and verifies the user's permissions.

[0035] 3.2 The service program calls the corresponding local system resource interface and performs resource operations according to the request content.

[0036] 3.3 During the operation, the service program generates a "status event" protocol message and periodically pushes the operation progress, status and possible abnormal information to the plugin in real time.

[0037] 3.4 After the operation is completed, the service program sends the operation result and final status feedback. 4. Client feedback handling and interface updates 4.1 The plugin receives and parses the MCP protocol messages returned by the server, including the progress push of the status event and the final operation result.

[0038] 4.2 The plugin updates the user interface based on feedback information, enabling visualization of operation status, progress, and results.

[0039] 4.3 In case of operation failure, permission error, or other issues, the plugin will display the corresponding error message or handling suggestions.

[0040] The above-described embodiments are merely one implementation of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention should be determined by the appended claims.

Claims

1. A method for local resource interaction and status feedback based on the MCP protocol, characterized in that, include: Step 1: Connection Initialization Step 1.1 After the browser plugin is launched, it actively initiates a connection request to the local service program and establishes a long connection based on the TCP MCP protocol through HTTP negotiation; Step 1.2 During the connection establishment process, the plugin and the service program exchange authentication tokens to complete identity verification and establish a secure encrypted channel; Step 2: Request Generation and Sending Step 2.1 When a user initiates a resource operation in the browser interface, the plugin abstracts the user operation into a standard MCP resource request; Step 2.2 The plugin encapsulates the request into an MCP protocol message, including resource type, operation type, parameter information, and authentication information; Step 2.3 The plugin sends the MCP resource request to the local service program through the established long connection; Step 3: Server-side processing and feedback Step 3.1 The service program receives and parses the MCP request message and verifies the user's permissions; Step 3.2 The service program calls the corresponding local system resource interface and performs resource operations according to the request content; Step 3.3 During the operation, the service program generates a "status event" protocol message and periodically pushes the operation progress, status and possible abnormal information to the plugin in real time. Step 3.4 After the operation is completed, the service program sends the operation result and final status feedback; Step 4: Client feedback processing and interface update Step 4.1 The plugin receives and parses the MCP protocol messages returned by the server, including the progress push of the status event and the final operation result; Step 4.2 The plugin updates the user interface based on the feedback information to visualize the operation status, progress, and results; Step 4.3 For abnormal situations, the plugin displays corresponding error messages or handling suggestions.

2. The local resource interaction and status feedback method based on the MCP protocol according to claim 1, characterized in that, MCP protocol messages include: A new "status" event type has been added to the MCP protocol message structure for asynchronous, real-time reporting of operation progress and intermediate status. An event type field, `event_type`, has been added to the MCP protocol data message structure, with a new value type "status". The status event includes fields for operation ID, progress percentage, and status description. When the local service program performs resource operations, it periodically pushes status event messages to the client via the MCP protocol. The client parses the status event messages and updates the operation progress or status display in real time.

3. A local resource interaction and status feedback system based on the MCP protocol, characterized in that, A method for implementing local resource interaction and status feedback based on the MCP protocol as described in any one of claims 1-2 includes: Browser Plugin: As an MCP Client, it runs on the browser side and is used to establish connections with local service programs via the MCP protocol, send resource operation requests, and receive status feedback. Communication module: Implements the MCP protocol to connect with the local service program and exchanges data via TCP communication. Request assembly module: responsible for encapsulating the resource access operations initiated by the user on the browser into MCP protocol data packets; Status monitoring and feedback module: This module listens for messages from local service programs, parses them according to the protocol, and displays them to the user. Local service program: As an MCP server, it runs on the user's computer, providing resource service interfaces that support the MCP protocol, as well as a message event mechanism to handle requests initiated by plugins and return results and status. Protocol parser: Parses and verifies parameters of the received request content from the MCP Client; Resource Manager: Based on the parsed request, it calls the local operating system's interface to perform specific operations; Event mechanism module: Listens for various events during the data operation process and pushes event messages to the client; Status feedback module: Generates status feedback messages based on the operation results and pushes them to the client in MCP protocol format to achieve feedback.