Dynamic modular intelligent tumor staging system and method based on MCP protocol and LLM

By adopting a dynamic modular design based on the MCP protocol and LLM, the coupling and flexibility issues of the automated tumor staging system are solved, enabling flexible adaptation and rapid response of multimodal data, reducing system maintenance costs and the time required to deploy new versions.

CN120932925APending Publication Date: 2025-11-11LIBEN HEALTHCARE (CHENGDU) CO LTD

Patent Information

Application Number
CN202511464556.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-14
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Existing automated tumor staging systems suffer from high coupling and poor flexibility, leading to difficulties in updating staging rules and adapting to multimodal data, high system maintenance costs, and long deployment cycles for new versions.

Method used

A dynamic modular intelligent tumor staging system based on the MCP protocol and LLM is adopted. The staging rules are encapsulated into an independent dynamic staging calculation module. The utility functions are registered through the MCP coordination service module, and semantic parsing and calling are performed using the LLM intelligent agent module. This enables flexible adaptation of multimodal data to structured TNM data and supports dynamic calling and updating.

Benefits of technology

This significantly improves the system's ability to flexibly respond to phased rule iterations and adapt to multimodal data, reduces system maintenance costs and the time required to deploy new versions, and enhances the system's scalability and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120932925A_ABST
    Figure CN120932925A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of medical detection, in particular to a dynamic modular tumor intelligent staging system and method based on an MCP protocol and LLM. Different staging rules are packaged into independent dynamic staging calculation modules respectively and stored in a dynamic staging calculation module library; meanwhile, tool functions corresponding to different staging rules are registered in the MCP coordination service module through an MCP protocol to form a tool function list, so that the staging rules exist in a modular tool form, and strong coupling of rules and core codes in a traditional system is avoided; after semantic analysis is carried out by the LLM intelligent agent module, a corresponding tool function in a tool function list is automatically matched and called, so that flexible adaptation from multi-modal data to structured TNM data is realized; the analysis logic does not need to be reconstructed when the data source type is newly added; on the other hand, when the staging rules are updated or increased, core codes of the system do not need to be modified, the system does not need to be redeployed, and the flexible response capacity of the system to staging rule iteration and multi-modal data adaptation is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical testing technology, and in particular to a dynamic modular intelligent tumor staging system and method based on the MCP protocol and LLM. Background Technology

[0002] Tumor staging is a core component in the diagnosis and treatment of malignant tumors, guiding the selection of treatment plans, assessing prognosis, and monitoring efficacy. Among these, the TNM staging system has become the gold standard in clinical practice due to its scientific rigor and universality. With the advancement of medical research, the TNM staging standard has become more differentiated across multiple cancer types and has undergone continuous version iterations. Furthermore, the multimodal data generated during clinical diagnosis and treatment is growing exponentially, providing rich evidence for accurate staging, but also placing higher demands on the data processing capabilities of the staging system.

[0003] Currently, automated tumor staging systems mainly employ two technical approaches, both of which have significant limitations: Static systems dominated by rule engines transform staging standards into hard-coded rules in the form of if-else statements. While these systems offer high interpretability, they suffer from poor scalability. This means that adding a new cancer type or updating a staging version requires rewriting a large amount of rule code. For example, the CNLC staging standard for liver cancer has more than 20 rules for combining tumor size and number, causing system maintenance costs to increase exponentially with the number of tumors. Furthermore, their modules are highly coupled, with staging logic deeply bound to the core code. Any adjustment to a rule requires overall deployment, resulting in a long implementation cycle for new versions of the standard.

[0004] The static machine learning module directly outputs the grading results by training a classifier. However, it also suffers from the problem that the model must be completely reconstructed after the grading standards are updated, resulting in a long implementation cycle for the new version. Summary of the Invention

[0005] The purpose of this invention is to overcome the technical problems of high coupling and poor flexibility in existing automated tumor staging systems, and to provide a dynamic modular intelligent tumor staging system and method based on the MCP protocol and LLM.

[0006] To address the aforementioned technical problems, the present invention provides the following technical solution: On the one hand, a dynamic modular intelligent tumor staging system based on the MCP protocol and LLM is disclosed, including a data acquisition module, an MCP coordination service module, a dynamic staging calculation module library, and an LLM intelligent agent module; The data acquisition module is used to acquire multimodal data sources; The MCP coordination service module has multiple utility functions registered through the MCP protocol, forming a utility function list, where each utility function corresponds to a different phase rule; the LLM agent module performs semantic parsing on the multimodal data source to determine the utility function to be called, and calls the corresponding utility function to perform text parsing on the multimodal data source to obtain structured TNM data; The dynamic phased calculation module calculates the corresponding dynamic phased calculation results based on the structured TNM data.

[0007] This invention encapsulates different phased-out rules into independent dynamic phased-out calculation modules and stores them in a dynamic phased-out calculation module library. Simultaneously, in the MCP coordination service module, utility functions corresponding to different phased-out rules are registered via the MCP protocol to form a utility function list. This allows phased-out rules to exist in a modular tool form, completely decoupled from the system's core architecture, avoiding the strong coupling between rules and core code in traditional systems. Furthermore, the LLM intelligent agent module performs semantic parsing and autonomously matches and calls the corresponding utility functions in the utility function list, achieving flexible adaptation from multimodal data to structured TNM data. Adding new data source types does not require refactoring the parsing logic. On the other hand, when phased-out rules are updated or added, there is no need to modify the system's core code; only the corresponding dynamic phased-out calculation module needs to be added or updated in the dynamic phased-out calculation module library, and the associated utility functions need to be registered or updated in the MCP coordination service module. The entire process supports dynamic invocation without redeploying the system, significantly improving the system's flexible response capability to phased-out rule iteration and multimodal data adaptation.

[0008] Preferably, the dynamic staging calculation module comprises multiple dynamic staging calculation modules, each corresponding to a different cancer type and a different staging version.

[0009] Preferably, the dynamic phased calculation module is a pluggable module.

[0010] Preferably, after obtaining the structured TNM data, the MCP coordination service module queries the corresponding dynamic staging calculation module based on the current cancer type and stage version, and performs staging calculation after finding the corresponding dynamic staging calculation module.

[0011] Preferably, the LLM agent module includes an agent submodule for performing semantic parsing of multimodal data sources and an agent submodule for generating interpretations of dynamic phased calculation results.

[0012] On the other hand, a dynamic modular intelligent tumor staging method based on the MCP protocol and LLM is disclosed, including the following steps: Get the installment request from the client and retrieve the multimodal data from the installment request; The MCP coordination service module sends an information extraction request to the registered LLM agent modules, along with a list of multimodal data and utility functions; the LLM agent modules analyze the semantic information of the multimodal data to determine the utility functions to be invoked. After LLM outputs the utility functions that need to be called, it returns a function call request to the MCP coordination service module. The MCP coordination service module executes the corresponding utility function based on the returned function call request, and parses the multimodal data based on the corresponding utility function to output structured TNM data. After obtaining the structured TNM data, the MCP coordination service module sends a module query request to the module manager. Once the corresponding dynamic phase calculation module is found, it is called to execute the phase calculation and obtain the corresponding phase result.

[0013] Preferably, obtaining the phased results includes the following steps: After receiving a query request, the module manager retrieves module metadata from the unified knowledge base and determines whether a corresponding dynamic installment calculation module exists. If no corresponding dynamic installment calculation module exists, it returns an unsupported error message; if a corresponding dynamic installment calculation module exists, it dynamically loads the specified version of the dynamic installment calculation module. The system then verifies whether the input data conforms to the expected schema of the corresponding dynamic installment calculation module. If it does not conform, a data verification error is returned; if it does conform, the installment calculation logic is executed to obtain the corresponding installment calculation result.

[0014] Preferably, after the dynamic phase calculation module performs phase calculation to obtain the corresponding phase result, the MCP coordination service module sends an interpretation generation request to the LLM agent module, along with the generated phase result and the rule basis corresponding to the phase result; The LLM agent module receives the interpretation generation request, parses the request, matches the requested tool name, and confirms whether the format of the input parameters conforms to the input schema of the corresponding tool. After completion, the LLM agent queries the list of tool functions registered through the MCP protocol, obtains the corresponding tool function, and executes the interpretation generation operation.

[0015] Preferably, during the process of generating the explanation, the corresponding tool function calls the unified knowledge base interface to obtain the specific clauses corresponding to the phased rules, and generates the phased explanation based on these clauses.

[0016] Compared with the prior art, the advantages of the present invention are as follows: This invention encapsulates different phased-out rules into independent dynamic phased-out calculation modules and stores them in a dynamic phased-out calculation module library. Simultaneously, in the MCP coordination service module, utility functions corresponding to different phased-out rules are registered via the MCP protocol to form a utility function list. This allows phased-out rules to exist in a modular tool form, completely decoupled from the system's core architecture, avoiding the strong coupling between rules and core code in traditional systems. Furthermore, the LLM intelligent agent module performs semantic parsing and autonomously matches and calls the corresponding utility functions in the utility function list, achieving flexible adaptation from multimodal data to structured TNM data. Adding new data source types does not require refactoring the parsing logic. On the other hand, when phased-out rules are updated or added, there is no need to modify the system's core code; only the corresponding dynamic phased-out calculation module needs to be added or updated in the dynamic phased-out calculation module library, and the associated utility functions need to be registered or updated in the MCP coordination service module. The entire process supports dynamic invocation without redeploying the system, significantly improving the system's flexible response capability to phased-out rule iteration and multimodal data adaptation. Attached Figure Description

[0017] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. In the drawings: Figure 1 This is a system architecture block diagram of Embodiment 1 of the present invention.

[0018] Figure 2 This is a flowchart of information extraction based on the MCP protocol provided in Embodiment 2 of the present invention.

[0019] Figure 3 The flowchart for loading and calculating the dynamic phased module provided in Embodiment 2 of the present invention is shown. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0021] Example 1 On the one hand, see Figure 1and Figure 2 A dynamic modular intelligent tumor staging system based on the MCP protocol and LLM is disclosed, including a data acquisition module, an MCP coordination service module, a dynamic staging calculation module library, and an LLM intelligent agent module. The data acquisition module is used to acquire multimodal data sources; The MCP coordination service module has multiple utility functions registered via the MCP protocol, forming a utility function list, where each utility function corresponds to a different staging rule; the LLM agent module performs semantic parsing on the multimodal data source to determine the utility function to be called, and calls the corresponding utility function to perform text parsing on the multimodal data source to obtain structured TNM data; the multimodal data source includes clinical text reports, case-based structured data, and medical images.

[0022] The dynamic phased calculation module calculates the corresponding dynamic phased calculation results based on the structured TNM data.

[0023] The dynamic staging calculation module comprises multiple dynamic staging calculation modules, each corresponding to a different cancer type and a different staging version. Each dynamic staging calculation module can be a model or a calculation method based on predefined rules. These multiple dynamic staging calculation modules include lung cancer AJCC9. th Breast cancer UICC8 th Custom rules, etc.; that is, each dynamic staging calculation module corresponds to a different type of cancer and a different staging version.

[0024] The MCP coordination service module includes a module loader, which receives and responds to module loading intelligence. When the MCP coordination service module queries the module manager for a dynamic installment calculation module that matches the installment request, it sends a dynamic loading request to the module loader. The module loader accepts the request and performs the corresponding loading operation.

[0025] Furthermore, the dynamic staging calculation module of this invention can be diversified. Taking oral cancer TNM staging as an example, its dynamic staging calculation module can use one dynamic staging module to calculate T / N / M staging, or it can use one dynamic staging module to calculate T staging, one dynamic staging module to calculate N staging, and one dynamic staging module to calculate M staging. That is, in the constructed dynamic staging calculation module library, multiple dynamic staging calculation modules can be stored. The modules for calculating T / N / M staging, as well as the modules for T staging, N staging, and M staging respectively, can be stored. This achieves high scalability, and it can adapt to different dynamic staging calculation modules according to different needs. In this way, it is possible to quickly update the dynamic staging calculation module. For example, if the TNM staging rules for oral cancer change, and only the T staging changes, we can simply change the corresponding calculation rules of the dynamic staging calculation module corresponding to the T staging, or perform a brief training of the model, without the need for extensive training.

[0026] Similarly, when extracting structured data, the LLM agent module of this application can use one agent for each of the T / N / M phases; or one agent can extract structured data for phase T, one agent can extract structured data for phase N, and one agent can extract structured data for phase M.

[0027] In addition, since this application uses multimodal data as input, and the agent corresponding to the LLM agent module can be for multimodal data, or for each type of data within the multimodal data (i.e., one agent for each type of data, or one agent for multiple modalities of data), it can be adaptively added according to changes in user needs, fully demonstrating the high scalability of this application. When changes occur, we only need to add the corresponding tool function and call the corresponding tool function based on the parsing of the user's input data. The tool function is a standardized interface for interaction between the LLM agent module and the MCP coordination service module. LLM needs to encapsulate its functions as tool functions through the MCP protocol for registration, thereby enabling system calls and avoiding uncontrollable LLM output. The tool function list is maintained by the MCP coordination service module, and each tool function has a clear input / output schema (field definitions and format requirements) to ensure standardized data flow.

[0028] For example, an agent is used to extract complete TNM staging data, as follows: Extract T-stage, N-stage, and M-stage information from unstructured text and output structured TNM data containing the three major fields; The input is unstructured medical text (e.g., a tumor in the right lobe of the lung with a maximum diameter of 3.5cm, no regional lymph node enlargement, and no distant metastasis seen on PET-CT scans across the province); the output is structured data in JSON format, for example: {"t_stage": "T2a","n_stage": "N0", "m_stage": "M0"}.

[0029] As one possible implementation of this embodiment, the dynamic phase calculation module is a pluggable module.

[0030] As one possible implementation of this embodiment, after obtaining the structured TNM data, the MCP coordination service module queries the corresponding dynamic staging calculation module based on the current cancer type and stage version, and performs staging calculation after finding the corresponding dynamic staging calculation module.

[0031] As one possible implementation of this embodiment, the LLM agent module includes an agent submodule for performing semantic parsing of multimodal data sources and an agent submodule for generating interpretations of dynamic phased calculation results.

[0032] In this embodiment, a module manager, a unified knowledge base, and a result output and interpretation module are also included. The module manager stores the metadata (such as cancer type, staging standard version, input / output schema) and version information of all dynamic staging calculation modules in the associated unified knowledge base. It also maintains a module registration system, supporting version control and hot updates of modules (e.g., when adding an AJCC version 10 module, only the dynamic staging calculation module library needs to be uploaded to complete the registration, without modifying the system core), greatly reducing system maintenance costs. Furthermore, the module manager works with the MCP coordination service module to complete module legality verification. Before loading the dynamic staging calculation module, the module manager confirms that the cancer type, version, and staging request of the module to be loaded match the module's metadata in the unified knowledge base, avoiding calculation errors caused by module mismatch.

[0033] The knowledge base stores metadata for the dynamic staging calculation module (such as the module's cancer type, version, and entry function), TNM staging standard knowledge (such as the tumor diameter definition for T2a in AJCC version 9), and predefines confidence weights for various data sources (such as a confidence score of 0.95 for pathology reports and 0.85 for imaging AI) and a custom arbitration rule base (such as the rule "textuality prevails if tumor diameter difference < 0.5cm"). When discrepancies arise in multimodal data, the MCP coordination service module retrieves this information from the knowledge base and resolves conflicts according to the logic of "gold standard priority → confidence difference judgment → rule arbitration" to ensure the accuracy of staging data. Furthermore, the unified knowledge base records update logs and conflict resolution process logs for the dynamic staging calculation module, and stores staging rule details required for LLM generation and interpretation (such as the clause "T2a+N0+M0 corresponds to IB stage"), providing a basis for the output and interpretation generation modules.

[0034] The arbitration logic above is as follows: As mentioned earlier, we are using multi-source data. If each data point is input into a model for TNM data extraction, the following results will be obtained: For text source results: the LLM agent module extracts structured TNM data from unstructured text, such as {"t_stage": "T2a", "n_stage": "N0", "m_stage": "M0"}). For image source results: structured TNM data output by the image AI model in the LLM agent module, such as {"t_stage": "T1b", "n_stage": "N0", "m_stage": "M0"}). At this point, there may be two different ways to record a demerit, so conflict resolution needs to be performed. The specific steps are as follows: The MCP coordination service module compares the core key fields of all data sources to determine whether they are consistent, that is, whether the output structured TNM data is consistent. If they are consistent, the known results are adopted directly without further conflict resolution. The results are then used as the final structured TNM data and passed to the dynamic phase calculation module for phase calculation. If there is a discrepancy, for example, if the T2a result of the text source and the T1b result of the image source are inconsistent, then proceed to the next stage of the conflict resolution process. First, standard data is predefined in the same knowledge base, such as the output of pathology reports; and the confidence levels of various data are predefined, such as 0.95 for pathology reports, 0.85 for imaging AI, and 0.9 for clinical text execution; here, pathology reports are used as standard data. When performing conflict resolution, the system first determines whether the input data includes a pathology report. If it does, the output of the agent corresponding to the pathology report is used as structured TNM data. If no pathology report is found, arbitration is performed based on the confidence difference, as follows: The confidence difference between conflicting data sources is calculated using MCP and compared to a preset difference threshold. If the difference is greater than or equal to the threshold, the result from the source with higher execution confidence is adopted. If the difference is less than the threshold, it indicates that the confidence levels of the two data sources are similar and cannot be directly determined by confidence level. In this case, arbitration is conducted based on a custom arbitration rule of the unified knowledge base, such as: Rule 1: If the difference between the maximum diameter of the tumor shown on the CT image and the text description is less than 0.5 cm, the text result shall prevail; if the difference is greater than or equal to 0.5 cm, the image result shall prevail. Rule 2: If there is a conflict in the N staging, the combined results of enhanced CT and pathological biopsy shall be given priority. The above rules are merely exemplary and can be further defined and supplemented based on medical knowledge.

[0035] If the above rules cannot resolve the issue (there are no corresponding arbitration rules), then manual arbitration will be conducted.

[0036] The results output and explanation module, based on the triggered request to generate an explanation, instructs the LLM agent module to call the `generate_explanation` tool from the tool function list. Based on the staging rules in the unified knowledge base, it generates a natural language explanation containing "staging standard version, TNM data basis, and conclusion derivation logic" (e.g., "According to the AJCC 9th edition lung cancer staging standard, the patient's tumor maximum diameter of 3.5cm meets the T2a definition, with no lymph node or distant metastasis, therefore the stage is IB"). The explanation text is then integrated with the staging result. Finally, the module outputs the final result to the client for visualization. This visualization can display the composition of multimodal data, structured TNM basic data, tumor staging results, a conflict resolution human arbitration interface, the matching logic between TNM data and rules, and the explanation text.

[0037] Secondly, the MCP coordination service module of this application includes protocol conversion. Since the input is multimodal unstructured text, the MCP coordination service module will trigger the protocol conversion function after input, as follows: Convert the field names and data formats of structured data other than unstructured text into the system's unified TNM data standard format to ensure that all access data is ultimately stored or transmitted in a structured format that conforms to the MCP protocol specification. Furthermore, since the LLM registers as one or more utility functions through the MCP protocol to receive call requests from the MCP service, and the MCP must include a list of currently available utility functions, if the calling formats of the MCP and LLM are inconsistent, the LLM cannot recognize the tool list. Therefore, the MCP needs to perform protocol conversion to adapt the tool list to a format that the LLM can understand. Secondly, the MCP also needs protocol conversion before passing structured TNM data to the dynamic phased-out module, as detailed below: Verify whether the structured data extracted by LLM conforms to the input schema of the target module (e.g., whether the fields are indeed necessary and whether the field formats are correct). If the data fields do not completely match the input schema, default values ​​will be added if the fields are correct; if the field names are inconsistent, the field names will be converted, etc. The converted data is passed to the dynamic installment module to ensure that the module can read and perform calculations correctly.

[0038] This invention encapsulates different phased-out rules into independent dynamic phased-out calculation modules and stores them in a dynamic phased-out calculation module library. Simultaneously, in the MCP coordination service module, utility functions corresponding to different phased-out rules are registered via the MCP protocol to form a utility function list. This allows phased-out rules to exist in a modular tool form, completely decoupled from the system's core architecture, avoiding the strong coupling between rules and core code in traditional systems. Furthermore, the LLM intelligent agent module performs semantic parsing and autonomously matches and calls the corresponding utility functions in the utility function list, achieving flexible adaptation from multimodal data to structured TNM data. Adding new data source types does not require refactoring the parsing logic. On the other hand, when phased-out rules are updated or added, there is no need to modify the system's core code; only the corresponding dynamic phased-out calculation module needs to be added or updated in the dynamic phased-out calculation module library, and the associated utility functions need to be registered or updated in the MCP coordination service module. The entire process supports dynamic invocation without redeploying the system, significantly improving the system's flexible response capability to phased-out rule iteration and multimodal data adaptation.

[0039] Example 2 On the other hand, a dynamic modular intelligent tumor staging method based on the MCP protocol and LLM is disclosed, including the following steps: Before implementing the phased implementation method, the specific deployment of the present invention is explained as follows: Deploy MCPServer (the runtime environment for the MCP coordination service module), configure protocol communication parameters, and ensure that it can schedule other modules; Register LLMAgent (e.g., integrate GPT-4API): Register the LLM agent module as a callable tool via the MCP protocol, and configure the core tool functions (e.g., extract_tnm: extract complete TNM data; extract_t_stage / extract_n_stage / extract_m_stage: extract T / N / M stages separately; generate_explanation: generate result interpretation), and set the input and output formats of the tool functions (e.g., output is JSON containing "t_stage" / "n_stage" / "m_stage" fields). Develop an independent dynamic staging calculation module tailored to the target cancer type and staging criteria: Write a calculation logic file (e.g., lung_cancer_ajcc_9th.py): encapsulate the mapping rules from TNM data to the staging results (e.g., if T2a and N0 and M0, then output the IB period). Write the metadata configuration file (module.json): declare the module properties (cancer type = lung cancer, staging version = AJCC version 9, input schema = must include t_stage / n_stage / m_stage fields, entry function = the name of the function to call the computation logic); Upload the above module files (computation logic + metadata) to the dynamic phased calculation module library. The module manager will automatically scan the files and update the unified knowledge base (which stores module metadata and version information) to complete the module registration.

[0040] See Figure 2 After deployment, when the client needs to stage a patient's tumor, it initiates a request through the user interface, and the system data acquisition module receives the staging requirement parameters and multimodal medical data. The staging requirements parameters include specifying the target cancer type and the target staging standard version, which are used to match the corresponding dynamic staging calculation module in the future. Multimodal medical data includes unstructured text (such as patients' CT reports, pathological diagnosis descriptions, etc.), structured pathological data (such as the degree of tumor differentiation in pathological biopsies), and AI analysis results of medical images; After receiving the data, the data acquisition module integrates the information and transmits it to the MCP Server (MCP Coordination Service Module).

[0041] Since the input medical text is in natural language format, it cannot be directly used for calculations in the dynamic staging module. Therefore, the LLM agent module converts it into standardized structured TNM data, which is then uniformly scheduled by the MCP coordination service module, as follows: The MCP Server sends an information extraction request to the registered LLM Agent, along with two key pieces of information: the unstructured medical text to be parsed and a list of currently available utility functions (i.e., registered tools such as extract_tnm / extract_t_stage). See Figure 3 As shown, the LLM Agent analyzes the semantics of the text and determines the tool to be invoked (e.g., if the text contains complete TNM information, the extract_tnm tool is invoked; if only T-stage confirmation is needed, the extract_t_stage sub-tool can be invoked). After determination, the LLM Agent returns a function call request to the MCP Server, including the tool function name and parameters. Upon receiving the request, the MCP Server executes the corresponding tool function, which parses the text and outputs structured TNM data. Further, the MCP Server forwards the structured TNM data to the LLM Agent. After the LLM Agent confirms that no further tool function calls are needed, the MCP Server obtains the final structured TNM data for subsequent dynamic stage calculations.

[0042] The MCP Server sends a module query request to the Module Manager, with the cancer type and stage version as the request parameters. The Module Manager retrieves module metadata from the unified knowledge base to determine if a stage module matching the request parameters exists. If no matching module exists, the Module Manager returns an error indicating that the cancer type or stage version is not supported, and the MCP Server passes the error information to the output module. If a matching module exists, the Module Manager dynamically loads the corresponding dynamic stage calculation module from the dynamic stage calculation module library and returns a loading success notification to the MCP Server after loading is complete.

[0043] The MCP Server passes the acquired structured TNM data to the successfully loaded dynamic installment calculation module. The dynamic installment calculation module verifies the data format based on the input schema in its own metadata, and checks whether all required fields are included (such as whether t_stage / n_stage / m_stage are complete and in the correct format). If the data does not conform to the schema, the module returns a data verification error, and the MCP Server feeds back the error to the output module, which then prompts the user to supplement the data. If the data conforms, the dynamic installment calculation module executes the internally encapsulated installment rules to calculate the corresponding installment result.

[0044] If the user needs to understand the basis of the installment results, the MCP Server triggers the interpretation generation function of the LLM agent module based on the user's request; the MCP Server sends an interpretation generation request to the LLM Agent, along with two key pieces of information: the generated installment results and the rule basis corresponding to the installment results; The LLM Agent calls the generate_explanation tool and generates a natural language explanation based on the accompanying key information, such as: According to the AJCC 9th edition lung cancer staging criteria, the patient's tumor has a maximum diameter of 3.5cm (meets the T2a definition), no regional lymph node metastasis (N0), and no distant metastasis (M0), therefore the stage is IB; The LLM Agent returns the explanation text to the MCPServer, and the MCP Server integrates the staging result and the explanation text.

[0045] Finally, the MCP Server passes the phased results to the results output and interpretation module, which then presents the results to the user interface.

[0046] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.

[0047] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.

Claims

1. A dynamic modular intelligent tumor staging system based on the MCP protocol and LLM, characterized in that, It includes a data acquisition module, an MCP coordination service module, a dynamic phased calculation module library, and an LLM agent module; The data acquisition module is used to acquire multimodal data sources; The MCP coordination service module has multiple utility functions registered through the MCP protocol, forming a utility function list, where each utility function corresponds to a different phase rule; the LLM agent module performs semantic parsing on the multimodal data source to determine the utility function to be called, and calls the corresponding utility function to perform text parsing on the multimodal data source to obtain structured TNM data; The dynamic phased calculation module calculates the corresponding dynamic phased calculation results based on the structured TNM data.

2. The dynamic modular intelligent tumor staging system based on MCP protocol and LLM according to claim 1, characterized in that, The dynamic staging calculation module library contains multiple dynamic staging calculation modules, each corresponding to different cancer types and different staging versions.

3. The dynamic modular intelligent tumor staging system based on MCP protocol and LLM according to claim 2, characterized in that, The dynamic phased calculation module is a pluggable module.

4. The dynamic modular intelligent tumor staging system based on MCP protocol and LLM according to claim 2, characterized in that, After obtaining the structured TNM data, the MCP coordination service module queries the corresponding dynamic staging calculation module based on the current cancer type and stage version, and performs staging calculation after finding the corresponding dynamic staging calculation module.

5. The dynamic modular intelligent tumor staging system based on MCP protocol and LLM according to claim 1, characterized in that, The LLM agent module includes an agent submodule for performing semantic parsing of multimodal data sources and an agent submodule for generating interpretations of dynamic phased calculation results.

6. A dynamic modular intelligent tumor staging method based on MCP protocol and LLM, characterized in that, Includes the following steps: Get the installment request from the client and retrieve the multimodal data from the installment request; The MCP coordination service module sends an information extraction request to the registered LLM agent modules, along with a list of multimodal data and utility functions; the LLM agent modules analyze the semantic information of the multimodal data to determine the utility functions to be invoked. After LLM outputs the utility functions that need to be called, it returns a function call request to the MCP coordination service module. The MCP coordination service module executes the corresponding utility function based on the returned function call request, and parses the multimodal data based on the corresponding utility function to output structured TNM data. After obtaining the structured TNM data, the MCP coordination service module sends a module query request to the module manager. Once the corresponding dynamic phase calculation module is found, it is called to execute the phase calculation and obtain the corresponding phase result.

7. The dynamic modular intelligent tumor staging method based on MCP protocol and LLM according to claim 6, characterized in that, The process of obtaining the phased results includes the following steps: After receiving a query request, the module manager retrieves module metadata from the unified knowledge base and determines whether a corresponding dynamic installment calculation module exists. If no corresponding dynamic installment calculation module exists, it returns an unsupported error message; if a corresponding dynamic installment calculation module exists, it dynamically loads the specified version of the dynamic installment calculation module. The system then verifies whether the input data conforms to the expected schema of the corresponding dynamic installment calculation module. If it does not conform, a data verification error is returned; if it does conform, the installment calculation logic is executed to obtain the corresponding installment calculation result.

8. The dynamic modular intelligent tumor staging method based on MCP protocol and LLM according to claim 6, characterized in that, After obtaining the corresponding phased results through the dynamic phased calculation module, the MCP coordination service module sends an interpretation generation request to the LLM agent module, along with the generated phased results and the corresponding rule basis. The LLM agent module receives and parses the interpretation and generation request, matches the tool name in the request, and confirms whether the format of the input parameters conforms to the input schema of the corresponding tool. Once completed, the LLM agent queries the list of utility functions registered through the MCP protocol, retrieves the corresponding utility functions, and performs the interpretation and generation operation.

9. The dynamic modular intelligent tumor staging method based on MCP protocol and LLM according to claim 8, characterized in that, During the process of generating the explanation, the unified knowledge base interface is called through the corresponding tool function to obtain the specific terms corresponding to the phased rules, and the phased explanation is generated based on this.

Citation Information

Patent Citations

  • LLM adaptive staging system based on dynamic staging module

    CN120356601A

  • Data analysis method and device, storage medium and electronic equipment

    CN120611800A

  • Network protocol analysis system based on model context protocol MCP

    CN120768812A

Cited By

  • Building energy consumption analysis method and system based on MCP service model and agent

    CN121809861A