Search

CN-122020641-A - MCP service treatment method and device based on intelligent agent

CN122020641ACN 122020641 ACN122020641 ACN 122020641ACN-122020641-A

Abstract

An agent-based MCP service management method is provided. In the method, first, model context protocol MCP service data is received. Secondly, performing action time sequence logic TLA + modeling on the first MCP service data through a large model agent, and obtaining the first MCP service data with compliance according to a TLA + modeling result, wherein the large model agent comprises a fine-tuned large model, and the fine-tuned large model is obtained by fine-tuning the large model based on a mapping relation between a path corresponding to the second MCP service data and a classification label. And finally, analyzing the first MCP service data up and down Wen Yuyi based on the large model agent, and extracting classification labels corresponding to the qualified first MCP service data so as to conduct classified classification treatment on the qualified first MCP service data. The method solves the problems that the conventional MCP service treatment method is easy to miss semantic violations and is difficult to cover the security attribute of the MCP service under complex state transition, and improves the accuracy of label classification through compliance verification.

Inventors

  • GU JIANGUO
  • SUN YONG
  • ZHONG XUEJUN
  • ZHANG JING

Assignees

  • 杭州东方通信软件技术有限公司

Dates

Publication Date
20260512
Application Date
20251219

Claims (10)

  1. 1. An agent-based MCP service remediation method, comprising: Receiving first model context protocol MCP service data; Performing action time sequence logic TLA + modeling on the first MCP service data through a large model intelligent body, and obtaining the first MCP service data of compliance according to the TLA + modeling result, wherein the large model intelligent body comprises a fine-tuned large model, and the fine-tuned large model is obtained by fine-tuning the large model based on a mapping relation between a path corresponding to the second MCP service data and a classification label; and analyzing the first MCP service data of the compliance up and down Wen Yuyi based on the large model agent, and extracting a classification label corresponding to the first MCP service data of the compliance so as to conduct classified classification treatment on the first MCP service data of the compliance.
  2. 2. The method of claim 1, wherein the modeling, by a large model agent, the action timing logic TLA + for the first MCP service data comprises: Performing state abstraction on the first MCP service data through the large model intelligent agent to obtain a state machine and an indeterminate form corresponding to the first MCP service data; understanding a governance baseline of natural language of the first MCP service data and generating a legal initial value; writing a Next clause to an Application Programming Interface (API) of the first MCP service data; And converting the security policy and compliance requirements of natural language in the first MCP service data into a TLA+ logic expression.
  3. 3. The method of claim 1, wherein the modeling of the first MCP service data by the large model agent with the action sequential logic TLA + further comprises: Obtaining first non-compliant MCP service data according to the TLA + modeling result; And mapping the abstract state sequence corresponding to the first non-compliant MCP service data into natural language through the large model agent.
  4. 4. The method according to claim 1, wherein the analyzing the first MCP service data up and down Wen Yuyi based on the large model agent, after extracting the classification label corresponding to the compliant first MCP service data, further includes: Correcting a classification label corresponding to the compliant first MCP service data; And learning mapping logic between a path corresponding to the compliant first MCP service data and the modified classification label through the large model agent.
  5. 5. The method according to claim 1, wherein the analyzing the first MCP service data up and down Wen Yuyi based on the large model agent, after extracting the classification label corresponding to the compliant first MCP service data, further includes: The first MCP service data is mapped to a MCP service description vector.
  6. 6. The method of claim 5, wherein after mapping the compliant first MCP service data into MCP service description vectors, comprising: calling an agent through a tool, and determining a plurality of MCP services corresponding to a calling request according to the calling request and the MCP service description vector; and carrying out semantic alignment and intention analysis on the calling request and the MCP service description vector through the intention prejudging agent so as to determine the MCP service most relevant to the calling request.
  7. 7. The method of claim 6, wherein after determining the MCP service most relevant to the call request, further comprising: and recommending other similar MCP services based on the semantic alignment and intent analysis results and the most relevant MCP services by the intent pre-judging agent.
  8. 8. A method for fine tuning a large model, comprising: acquiring a path and a classification label corresponding to the second MCP service data; based on the mapping relation between the path corresponding to the second MCP service data and the classification label, the large model is enabled to understand the semantics of the API interface of the second MCP service data, and the classification label corresponding to the second MCP service data is generated.
  9. 9. The method of claim 8, wherein the enabling the large model to understand semantics of the second MCP service data interface and generating the classification label corresponding to the compliance for the second MCP service data is accomplished by performing fine tuning on the large model using LoRA parameter fine tuning techniques based on the path and the classification label corresponding to the second MCP service data.
  10. 10. An agent-based MCP service remediation device, comprising: the analysis module is used for receiving the first Model Context Protocol (MCP) service data; The modeling module is used for modeling the action time sequence logic TLA + of the first MCP service data through a large model intelligent body, and obtaining the first MCP service data of compliance according to the modeling result of the TLA + ; And the extraction module is used for carrying out up-down Wen Yuyi analysis on the first MCP service data based on the large-model intelligent agent, extracting a classification label corresponding to the compliant first MCP service data and carrying out classified classification treatment on the compliant first MCP service data.

Description

MCP service treatment method and device based on intelligent agent Technical Field The application relates to the technical field of artificial intelligence (ARTIFICIAL INTELLIGENCE, AI), in particular to an agent-based MCP service treatment method and device. Background Currently mainstream AI tool platforms (such as LANGCHAIN, LLAMAINDEX, etc.) and applications in integrating external MCP services typically rely on manual auditing or rule-based static inspection mechanisms for security compliance management and scheduling. High risk operations are intercepted, for example, by regular expression matching sensitive fields, basic parameter checking based on the OpenAPI Schema, or inserting middleware or human intervention at runtime. However, the method has obvious limitations, such as incapability of systematically verifying complex security attributes such as unauthorized access, sensitive data leakage and the like, difficulty in automatically identifying high-order semantic tags such as data topics and compliance bases due to manual marking or simple keyword matching in service classification, difficulty in learning complete knowledge due to insufficient initial data quantity when training a model, and high cost of manual iteration model. Disclosure of Invention The application provides an agent-based MCP service treatment method and device, which solve the technical problems. In a first aspect, an agent-based MCP service remediation method is provided. In the method, first model context protocol MCP service data is received. Secondly, performing action time sequence logic TLA + modeling on the first MCP service data through a large model agent, and obtaining the first MCP service data with compliance according to a TLA + modeling result, wherein the large model agent comprises a fine-tuned large model, and the fine-tuned large model is obtained by fine-tuning the large model based on a mapping relation between a path corresponding to the second MCP service data and a classification label. Then, the up-down Wen Yuyi analysis is carried out on the qualified first MCP service data based on the large model agent, and classification labels corresponding to the qualified first MCP service data are extracted so as to carry out classification management on the qualified first MCP service data. In one possible implementation manner, the performing the action time sequence logic TLA+ modeling on the first MCP service data through the large model intelligent agent includes performing state abstraction on the first MCP service data through the large model intelligent agent to obtain a state machine and an uncertainty corresponding to the first MCP service data. A governance baseline of natural language of the first MCP service data is understood and a legal initial value is generated. The Next clause is written to the application programming interface API of the first MCP service data. The security policy and compliance requirements of the natural language in the first MCP service data are translated into tla+ logic expressions. In one possible implementation, after the modeling of the action sequential logic TLA + by the large model agent, the method further includes obtaining the first MCP service data that is not compliant according to the modeling result of the TLA +. And mapping the abstract state sequence corresponding to the first non-compliant MCP service data into natural language through the large model agent. In one possible implementation manner, the method comprises the steps of analyzing the first MCP service data up and down Wen Yuyi based on the large model agent, extracting the classification label corresponding to the compliant first MCP service data, and correcting the classification label corresponding to the compliant first MCP service data. And learning mapping logic between the paths corresponding to the compliant first MCP service data and the corrected classification labels through the large model agent. In one possible implementation manner, the method comprises the steps of analyzing the first MCP service data up and down Wen Yuyi based on the large model agent, extracting classification labels corresponding to the compliant first MCP service data, and mapping the compliant first MCP service data into MCP service description vectors. In one possible implementation manner, after the mapping of the first compliant MCP service data into the MCP service description vector, the method includes calling, by a tool, the agent, and determining, according to the call request and the MCP service description vector, a plurality of MCP services corresponding to the call request. Semantic alignment and intent parsing are performed on the call request and the MCP service description vector by the intent pre-judgment agent to determine the MCP service most relevant to the call request. In one possible implementation, after determining the most relevant MCP service to the call request, the method further i