Visual arrangement method for model tool calling based on MCP

Through the MCP visual orchestration method, using unified agent tools and visual interface configuration, the problem of low efficiency of model tool calling is solved, and efficient and flexible tool calling and configuration are achieved.

CN120743252AActive Publication Date: 2025-10-03深圳市名通科技股份有限公司

Patent Information

Application Number
CN202511196514.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2025-10-03
Estimated Expiration
2045-08-26

AI Technical Summary

Technical Problem

In the existing technology, the calling efficiency of model tools is low, mainly because the integration of external tools requires customized development, which leads to increased interface dispersion and code complexity, and then causes redundant calling links.

Method used

Adopting a visual orchestration method based on MCP, the tool call request is parsed through a unified proxy tool and tool configuration information, standardized call requests are generated, and operations are configured through a visual orchestration interface, reducing manual coding and database maintenance, and achieving efficient conversion between different systems.

Benefits of technology

It improves the efficiency and flexibility of tool calling, reduces configuration complexity and error rate, and ensures the smoothness and efficiency of the tool calling process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120743252A_ABST
    Figure CN120743252A_ABST
Patent Text Reader

Abstract

The invention discloses a visual arrangement method for model tool calling based on an MCP, and relates to the technical field of artificial intelligence, the method is applied to a model context protocol MCP server, and the method comprises the following steps: receiving a first tool calling request sent by a client, the first tool calling request being generated by a large language model deployed on the client according to the MCP; the first tool calling request is analyzed through a preset unified agent tool and preset tool configuration information to construct a second tool calling request, and the tool configuration information is generated according to configuration operation of a preset visual arrangement interface on the MCP server; sending the second tool calling request to the external interface service, and receiving response information generated by the external interface service according to the second tool calling request; and constructing a request result according to the MCP and the response information, and sending the request result to the large language model. According to the method, the model tool calling efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a visual orchestration method for calling a model tool based on MCP. Background Art

[0002] As application scenarios deepen, AI (Artificial Intelligence) models are gradually extending from single natural language processing to multimodal interaction, complex task decision-making, and other directions. By calling external tools such as databases, API (Application Programming Interface) services, and sensors, AI models can break through the limitations of their own static knowledge bases and realize advanced functions such as real-time data acquisition, physical equipment control, and cross-system collaboration.

[0003] Currently, the integration of external tools is typically achieved through customized, point-to-point development. Developers must independently design the call logic for each external tool and implement interaction between the model and the target tool by writing dedicated interfaces or adaptation code. However, as the number and diversity of integrated tools increase, the fragmentation of interfaces and the complexity of the code lead to redundant call links between model tools, which in turn reduces the efficiency of tool calls.

[0004] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention

[0005] The main purpose of this application is to provide a visual arrangement method for model tool calls based on MCP, aiming to solve the technical problem of how to improve the efficiency of model tool calls.

[0006] To achieve the above objectives, the present application proposes a visual orchestration method for model tool calls based on MCP, which is applied to an MCP server and includes: Receiving a first tool call request sent by a client, wherein the first tool call request is generated by a large language model deployed on the client according to the MCP; Parsing the first tool call request using a preset unified proxy tool and preset tool configuration information to construct a second tool call request, wherein the tool configuration information is generated according to a configuration operation for a preset visual orchestration interface on the MCP server; Sending the second tool call request to the external interface service, and receiving response information generated by the external interface service according to the second tool call request; A request result is constructed according to the MCP and the response information, and the request result is sent to the large language model.

[0007] In one embodiment, the step of parsing the first tool call request by using a preset unified proxy tool and preset tool configuration information to construct a second tool call request includes: Extracting the operation tool identifier and tool parameters in the first tool call request through the unified proxy tool; Determining, by the unified agent tool, target configuration information of the target tool indicated by the operation tool identifier from the tool configuration information; Determining, by the unified proxy tool, request parameters that match the tool parameters based on a first mapping relationship between tool parameters and request parameters preset in the target configuration information; A second tool call request is generated through the unified proxy tool according to the request parameters and the target configuration information.

[0008] In one embodiment, before the step of receiving the first tool call request sent by the client, the method further includes: Receiving a connection establishment request sent by the client, parsing the connection establishment request through a preset request interceptor, and determining authentication parameters of the connection establishment request, wherein the authentication parameters include a tenant token and tenant information; Verifying the validity of the tenant token; If the validity verification of the tenant token passes, performing time window verification on the tenant information; If the time window verification of the tenant information passes, determining whether the target tenant indicated by the tenant information has permission to access the MCP server according to the preset MCP authorization information; In a case where the target tenant has permission to access the MCP server, a connection channel is established with the client.

[0009] In one embodiment, before the step of determining, by the unified agent tool, the request parameters that match the tool parameters based on the first mapping relationship between the tool parameters and the request parameters preset in the target configuration information, the step further includes: Determining, by the request interceptor and based on the target configuration information, whether the target tenant has permission to call the target tool; In the case where the target tenant has the permission to call the target tool, the step of determining the request parameters that match the tool parameters through the unified agent tool according to the first mapping relationship between the tool parameters preset in the target configuration information and the request parameters is executed.

[0010] In one embodiment, after the step of establishing a connection channel with the client, the method further includes: Generate a session identifier for the connection channel with the target tenant, and update a preset second mapping relationship between the target tenant and the session identifier; Before the step of determining, by the request interceptor, whether the target tenant has the permission to call the target tool according to the tool identifier and the target configuration information, the method further includes: Extracting the target session identifier in the first tool call request, and determining whether the target tenant and the target session identifier conform to the second mapping relationship; When the target combination and the target session identifier conform to the second mapping relationship, the step of determining whether the target tenant has the permission to call the target tool according to the tool identifier and the target configuration information through the request interceptor is executed.

[0011] In one embodiment, the visual arrangement method of the MCP-based model tool call further includes: Through the preset timer scheduler, detect whether the tool configuration information of each tool has been updated; In a case where tool configuration information of at least one tool is updated, a tool list of the MCP server is updated according to the updated tool configuration information, wherein the tool list is used to provide available tool information to the client.

[0012] In one embodiment, the visual arrangement method of the MCP-based model tool call further includes: When the tool configuration information of at least one tool is updated, the updated tool configuration information is saved in a cache.

[0013] In one embodiment, the visual arrangement interface includes a tool library panel, a property panel, and a status bar, and the visual arrangement method based on the MCP model tool call further includes: In response to a configuration operation on the tool library panel, determining a tool to be operated; In response to a configuration operation on the property panel, determining tool configuration information of the tool to be operated; In response to a triggering operation on a save control of the status bar, the tool configuration information of the tool to be operated is stored in a preset database, so that the MCP server calls the tool configuration information from the database.

[0014] In addition, to achieve the above-mentioned purpose, the present application also proposes an MCP server, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the visual orchestration method based on the MCP model tool call as described above.

[0015] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the visual orchestration method based on the MCP model tool call as described above are implemented.

[0016] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the steps of the visual orchestration method based on MCP model tool call as described above.

[0017] One or more technical solutions proposed in this application have at least the following technical effects: First, a large language model deployed on a client generates a first tool call request according to the Model Context Protocol (MCP) and sends it to an MCP server. The MCP generation ensures the standardization of the tool call request, ensuring that it can be subsequently processed uniformly through a unified proxy tool. Then, a second tool call request is constructed based on the first tool call request using the unified proxy tool and preset tool configuration information preset on the MCP server. The second tool call request is sent to a preset external interface service to implement an external tool call. The tool configuration information is generated by responding to configuration operations in a visual orchestration interface, without requiring the user to manually construct underlying code or edit a database. This avoids the complexity of code writing and database maintenance, reduces logical errors introduced by manual coding, and helps ensure the normal execution of subsequent tool call requests, thereby improving the efficiency of tool calls. Then, a response message sent by the external interface service is received, a request result is constructed according to the MCP and the response message, and the request result is sent to the large language model for application by the large language model. This application uses a preset unified proxy tool to parse the first tool call request and generate the second tool call request, achieving efficient conversion of tool calls between different systems. This enables the MCP server to flexibly interact with the client and various external tools, eliminating the need to customize a dedicated call interface for each tool, thereby improving the efficiency and flexibility of tool calls. At the same time, tool configuration information is generated through configuration operations in a visual orchestration interface, eliminating the need for users to manually write complex configuration code or modify the database, reducing the complexity and error rate of tool configuration. Users can intuitively select, connect, and set parameters for tools in the visual interface, improving the efficiency of the tool configuration process. At the same time, the reduced error rate ensures the smoothness of the subsequent tool call process, thereby improving the efficiency of tool calls. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0020] Figure 1 A flowchart of the first embodiment of the visual arrangement method for calling the MCP model tool based on this application is provided; Figure 2 A flowchart of implementing tool calls through a unified proxy tool provided in Example 1 of the present application; Figure 3 A flowchart of implementing dynamic updates through a timing scheduler provided in Example 1 of the present application; Figure 4 This is an architectural diagram of the multi-layer permission control provided in Example 2 of this application; Figure 5 This is a schematic diagram of the end-to-end process of calling the model tool provided in Example 2 of this application; Figure 6 This is a design architecture diagram of the visual layout interface provided in Example 3 of this application; Figure 7 This is a schematic diagram of the device structure of the hardware operating environment involved in the visual orchestration method based on MCP model tool call in the embodiment of the present application.

[0021] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0022] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.

[0023] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0024] Current tool configuration and orchestration methods mainly adopt a management method based on configuration files or databases, which lacks a visual graphical interface. The entire tool configuration and orchestration process is not intuitive, which leads to errors or omissions in the configuration process and low efficiency of tool access. At the same time, each integrated external tool often requires independent and usually customized call logic implementation, which increases system complexity and development overhead. As the number and diversity of integrated tools increase, the dispersion between interfaces and the complexity of the code lead to redundant call links of model tools, which reduces the efficiency of external tool calls.

[0025] The present application provides a solution that uses a preset unified proxy tool to parse a first tool call request and generate a second tool call request, thereby achieving efficient conversion of tool calls between different systems. This enables the MCP server to flexibly interact with the client and various external tools, eliminating the need to customize a dedicated call interface for each tool, thereby improving the efficiency and flexibility of tool calls. At the same time, tool configuration information is generated through configuration operations in a visual orchestration interface, eliminating the need for users to manually write complex configuration code or modify the database, reducing the complexity and error rate of tool configuration, and allowing users to intuitively select, connect, and set parameters for tools in the visual interface, thereby improving the efficiency of the tool configuration process. At the same time, the reduced error rate ensures the smoothness of the subsequent tool call process, thereby improving the efficiency of tool calls.

[0026] It should be noted that the execution subject of this embodiment may be an MCP server with data processing, network communication and program execution functions, such as a tablet computer, a personal computer, a mobile phone, etc.

[0027] Based on this, the embodiment of the present application provides a visual arrangement method for model tool calls based on MCP, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the visual arrangement method based on MCP model tool call in this application.

[0028] In this embodiment, the visualization arrangement method based on the MCP model tool call includes steps S10 to S40: Step S10: receiving a first tool call request sent by the client, wherein the first tool call request is generated by a large language model deployed on the client according to the MCP; MCP refers to a protocol standard used to regulate the interaction between AI (Artificial Intelligence) models and external tools and environments. It specifies the request / response structure, fields, encoding methods, and transmission protocols.

[0029] The corresponding client refers to a software component or application that supports MCP. Multiple large language models can be deployed on a client, and a large language model can also be regarded as a client.

[0030] A large language model is a model built using deep learning technology that can independently decide whether to call external tools and generate tool call requests based on the task objective and the target external tool. A tool call request is an instruction for calling a specific tool to complete a specific task. For the sake of distinction, the tool call request generated by the large language model is referred to as the first tool call request.

[0031] For example, during operation, the large language model can analyze the current input data (such as the user's natural language instructions, model processing results, etc.) and its own algorithm logic to achieve the task objectives; when it is determined that an external tool needs to be called to assist in completing the task, the target tool to be called is determined, and the parameters required to call the tool (tool parameters) are extracted or inferred from the input data and / or context. For example, when calling the "weather" external tool, at least the city name needs to be provided as a tool parameter; then, a first tool call request that meets the requirements of the MCP protocol is generated based on the target tool and tool parameters; then, the first tool call request is sent to the MCP server through the client, and the MCP server performs subsequent processing.

[0032] It can be understood that according to the MCP construction tool call request, the interaction between the large language model and the external model tool is standardized, so that different large language models can easily call various tools without the need for separate development and adaptation for each model and tool.

[0033] Step S20: parsing the first tool call request using a preset unified proxy tool and preset tool configuration information to construct a second tool call request, wherein the tool configuration information is generated based on a configuration operation for a preset visual orchestration interface on the MCP server; The unified proxy tool is a software module within the MCP server responsible for uniformly processing different types of tool call requests. It parses and converts tool call requests, enabling interaction and collaboration between different models and tools. After receiving the first tool call request, the MCP server routes it to the unified proxy tool for parsing and subsequent request conversion.

[0034] Tool configuration information refers to the service description file for tool calls, including metadata such as the tool's access address URL (Uniform Resource Locator) template, header parameters, request body parameters, parameter mapping relationships, HTTP (Hypertext Transfer Protocol) methods (such as GET / POST), and permission settings. This tool configuration information is generated based on user configuration operations on the visual orchestration interface.

[0035] The visual orchestration interface refers to a graphical user interface deployed on the MCP server, which provides users with a more intuitive and convenient tool configuration and orchestration operation environment. It can provide operations such as tool dragging, connection, and parameter configuration. Through the visual orchestration interface, users can intuitively and conveniently modify and manage these configurations. All user operations on the visual orchestration interface can be converted into corresponding tool configuration information and saved on the MCP server.

[0036] Optionally, the tool configuration information can be stored in the database in the form of a schema. For example, in response to a configuration operation on the visual orchestration interface, after determining the user's input information, the input information is converted into a standard JSON schema (JavaScript Object Notation) format. On this basis, the JSON schema is adapted to MCP and converted into an MCPschema.Tool object (MCP tool object), which is the tool configuration information stored in the database.

[0037] The second tool call request is used to represent the tool call request generated by the unified agent tool. It refers to a standardized request data packet generated on the MCP server side that meets the external model tool call requirements and contains all the detailed information required for the external model tool to perform the task.

[0038] In a feasible implementation, step S20 includes: Step S21: extracting the operation tool identifier and tool parameters in the first tool call request through the unified proxy tool; The tool identifier uniquely identifies a tool. It can be represented by a tool name or code, allowing for quick location of the required tool. Tool parameters are key-value pairs extracted by the large language model, including parameter names and values. These parameters are passed in when invoking the tool identified by the tool identifier. For example, when invoking a weather tool, the tool parameters in the tool invocation request might be {"city":"Beijing"}.

[0039] Optionally, after parsing the first tool call request, the parsed parameters can be checked for integrity before deciding whether to proceed to subsequent steps. For example, the parsed operation tool identifier and tool parameters can be hashed and the resulting hash value compared with the hash value in the first tool call request. If the two are completely consistent, it can be determined that the currently parsed parameters are complete.

[0040] Step S22, determining the target configuration information of the target tool indicated by the operation tool identifier from the tool configuration information through the unified agent tool; The target tool refers to the specific tool instance determined by the operating tool identifier.

[0041] Step S23, determining the request parameters that match the tool parameters based on the first mapping relationship between the tool parameters and the request parameters preset in the target configuration information through the unified proxy tool; Request parameters are key-value pairs consisting of parameter names and values ​​that conform to the interface call specifications of external model tools. They carry data used to specify the request content, conditions, or requirements, and determine how the external model tool processes the request and what response it returns. In the target configuration information, the initial parameter value of each request parameter is empty by default.

[0042] The first mapping relationship refers to the mapping relationship between tool parameters and request parameters, which is used to guide the unified agent tool to determine the parameter name of the request parameter corresponding to any tool parameter based on the parameter name of the tool parameter, and map the parameter value of the tool parameter to the parameter value of the request parameter.

[0043] Optionally, when performing parameter value mapping, you can determine whether the request parameter is an HTTP header transmission parameter or a request body transmission parameter based on the parameter definition in the tool configuration information; for header transmission parameters, the mapped values ​​are combined and encapsulated according to the format requirements of the HTTP header; for request body parameters, the mapped values ​​are organized and encapsulated according to the data format of the request body (such as JSON, XML, etc.), thereby ensuring the correctness of the data format of the request parameters.

[0044] Step S24: Generate a second tool call request through the unified proxy tool according to the request parameters and target configuration information.

[0045] Exemplarily, the target URL can be obtained by reading the URL for accessing the target tool in the tool configuration information and replacing the request parameter fields therein with the parameter values ​​of the updated request parameters; then, based on the tool configuration information, the request header parameters and the corresponding parameter values ​​are determined, and combined with the preset content type, authentication information, etc. in the tool configuration information, the request header is organized to obtain; at the same time, based on the tool configuration information, the request body parameters and the corresponding parameter values ​​are determined; then, combined with the target URL, request header and the above-mentioned request body parameters, etc., a complete second tool call request can be obtained.

[0046] Optionally, before constructing the target URL, you can determine whether the second tool call request currently being constructed is a GET request or a POST request based on the tool configuration information; if it is a GET request, then construct the target URL and organize the request header to obtain the second tool call request; if it is a POST request, you need to further obtain the request body parameters.

[0047] This implementation effectively decouples large language models from the complexity of integrating various external APIs through a parameter conversion mechanism. Simultaneously, by providing a standardized, single entry point for all tool calls, it simplifies tool development and maintenance, promotes code reuse, and reduces the learning curve for integrating new external tools. A unified proxy tool processes and forwards call requests for different model tools, eliminating the need to set up separate forwarding interfaces for each model tool. This improves tool configuration efficiency, avoids interface redundancy on the server, and reduces the workload for managing and maintaining model tools.

[0048] Step S30, sending the second tool call request to the external interface service, and receiving response information generated by the external interface service according to the second tool call request; The external interface service is a pre-developed and configured service module that is independent of the current client and MCP server. It includes a series of model tool access interfaces, which are used to receive tool call requests from the MCP server, execute corresponding business logic based on the content of the request, and return the processing results (response information) to the MCP server.

[0049] Response information refers to the data generated and returned to the request sender after the external interface service receives the second tool call request, including the result of the request processing, status code, possible error information, and related business data, etc., which is used to inform the request sender of the processing status of the request.

[0050] For example, assuming that the second tool call request requests the weather query service to query today's weather in Beijing, after receiving the second tool call request, the external interface service accesses the weather query service according to the target URL therein and passes in the request parameters until the weather query service returns the processing result, packages the processing result into the response information, and sends it to the MCP server.

[0051] Step S40: construct a request result according to the MCP and the response information, and send the request result to the large language model.

[0052] The request result refers to the reply information for the first tool call request, which is constructed based on the MCP and response information and sent to the large language model. By integrating the key data in the response information and adding the necessary context information according to the requirements of the MCP, the large language model can make accurate judgments or generate corresponding outputs based on this information.

[0053] For example, after receiving the response information sent by the external interface service, the MCP server parses and converts the response information according to pre-defined MCP rules, constructs a standardized request result, such as a JSON object, and sends it to the large language model for further analysis and processing.

[0054] For example, please refer to Figure 2 , Figure 2 A flowchart for implementing tool invocation via a unified proxy tool is provided. After receiving a first tool invocation request, the MCP server routes it to the unified proxy tool and uses it to determine authentication parameters, such as the tool identifier and tool parameters, for the first tool invocation request. Furthermore, the integrity of these authentication parameters, such as the tool identifier and tool parameters, can be verified by comparing hash values. If the parameter integrity check fails, the unified proxy tool returns information about the misaligned parameters to the MCP server, which then performs standardized encapsulation, generates a request result, and returns the request result to the client or AI module. If the parameter integrity check passes, the tool configuration information of the target tool indicated by the operation tool identifier is further obtained, and the request parameters (including request header parameters and request body parameters) that match the tool parameters are determined according to the tool configuration information, including the request parameters in the URL in the tool configuration information, to obtain the target URL; the tool configuration information is further read to determine whether the request method of the current tool is a GET request or a POST request; if it is a GET request, the request header can be directly constructed according to the target URL to obtain the second tool call request, and the HttpClientUtil.get method is used to send the GET request to the external interface service; if it is a POST request, it is necessary to further construct the request body of the second tool call request according to the request body parameters, and combine the above request header and request body to obtain the second tool call request, and use the HttpClientUtil.post method to send the POST request to the external interface service; then, after receiving the response information sent by the external interface service, it is processed and standardized according to the MCP protocol to obtain the request result; then, the request result is returned to the large language model or client.

[0055] This embodiment provides a visual orchestration method for model tool invocation based on MCP. By using a preset unified proxy tool to parse a first tool invocation request and generate a second tool invocation request, efficient conversion of tool invocations between different systems is achieved. This enables the MCP server to flexibly interact with clients and various external tools, eliminating the need to customize a dedicated invocation interface for each tool. This improves the efficiency and flexibility of tool invocation. Furthermore, tool configuration information is generated through configuration operations within a visual orchestration interface, eliminating the need for users to manually write complex configuration code or modify databases. This reduces the complexity and error rate of tool configuration, allowing users to intuitively select, connect, and set parameters for tools within the visual interface. This improves the efficiency of the tool configuration process. The reduced error rate ensures the smoothness of subsequent tool invocation processes, thereby improving the efficiency of tool invocation.

[0056] In a feasible embodiment, the method further includes: Step A10: Detecting whether the tool configuration information of each tool has been updated through a preset timing scheduler; A timer scheduler refers to a software component or program module that triggers tasks at pre-set time intervals or specific time points. It can determine whether the configuration information of each tool has been updated by checking whether the update timestamp of the current tool configuration information has changed compared to the update timestamp of the last detection.

[0057] Optionally, the timing scheduler can also determine whether the tool configuration information of each tool has been updated through hash comparison. For example, by calculating the MD5 hash value of the current tool configuration information of each tool and comparing it with the MD5 hash value calculated during the last detection, when there is a difference between the two, it can be determined that the tool configuration information has been updated.

[0058] It is understandable that compared with the hash comparison method, the scheduled task combined with the update timestamp monitoring detection and trigger mechanism is more efficient. It only identifies the modified configuration information and avoids resource-intensive full scans.

[0059] Step A20 : When the tool configuration information of at least one tool is updated, the tool list of the MCP server is updated according to the updated tool configuration information, wherein the tool list is used to provide available tool information to the client.

[0060] The tool list is a data structure maintained on the MCP server that records basic information about available tools, such as tool ID, name, function description, and the memory address of the corresponding tool configuration information. It acts as a directory index for tool resources on the server. When tool configuration information is added or deleted, a corresponding tool record is added or deleted from the tool list.

[0061] For example, please refer to Figure 3 , Figure 3 A flowchart for implementing dynamic updates through a timed scheduler is provided. First, the timed scheduler is initialized so that it queries the database for changes every minute. Specifically, whether the tool configuration information of each tool in the database has changed can be determined by checking whether the update timestamp has changed. If the update timestamp has not changed, the synchronization is skipped. If the update timestamp has changed, the updated tool configuration information is parsed and converted into a standardized JSON Schema format for easy storage in the database. Furthermore, according to the format requirements in MCP, the JSON Schema can be converted into an MCPschema.Tool object (MCP tool object), and based on the MCP tool object, the tool list on the MCP server can be updated, such as adding a new tool object or modifying the tool configuration information of the original tool on the tool list, completing the synchronization between the current tool list and the actual tool configuration information.

[0062] In this implementation, by periodically and automatically detecting updates to tool configuration information, new tools are ensured to become callable, while old tools are gracefully removed without interrupting ongoing operations. The server does not need to be restarted to take effect, achieving "zero downtime" registration. This transforms potentially destructive and time-consuming changes such as adding or modifying tools into seamless background operations, improving the efficiency of deploying and managing external model tools. At the same time, it enables the dynamic release of external model tools, ensuring the real-time nature of the tool list, thereby ensuring the smoothness of the overall model tool calling process.

[0063] In a feasible embodiment, the method further includes: Step A21 : When the tool configuration information of at least one tool is updated, the updated tool configuration information is saved in a cache.

[0064] Caching is a high-speed data storage technology used to temporarily store data for quick access. Saving updated tool configuration information in the cache allows for quick access to the latest tool configuration information, improving the efficiency of model tool calls.

[0065] In this embodiment, by saving the updated tool configuration information to the cache, fast read and write access is provided. At the same time, combined with the tool configuration information stored in the memory, the persistent storage of rule data can be guaranteed when the system is restarted or the memory is insufficient, thereby realizing a multi-level caching strategy and achieving highly concurrent and secure memory management.

[0066] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction and will not be repeated hereafter. On this basis, before step S10, it also includes: Step S01: receiving a connection establishment request sent by a client, parsing the connection establishment request through a preset request interceptor, and determining authentication parameters of the connection establishment request, wherein the authentication parameters include a tenant token and tenant information; The request interceptor is a middleware component deployed on the MCP server to intercept and process incoming requests. It implements security authentication by parsing and validating the requests before they reach the target processing module, thereby reducing the risk of illegal attacks on the MCP server.

[0067] A tenant token is a string or numeric token used to identify and verify a tenant's identity. Different large language models may be deployed on the client. To distinguish requests and data from different large language models, one or more tenant tokens can be assigned to each large language model.

[0068] Tenant information is detailed data about the tenant, which may include tenant name, contact information, permission information, etc., and is used to further verify the tenant's identity and authorize access.

[0069] Optionally, to ensure data transmission security, the client and the MCP server can pre-agree on a custom encryption and decryption method to encrypt and decrypt the authentication parameters. Therefore, after parsing the connection establishment request, the MCP server's request interceptor can call the corresponding decryption method to decrypt the authentication parameters to obtain data such as the tenant token and tenant information.

[0070] Step S02: Verify the validity of the tenant token; For example, after obtaining the tenant token, its digital signature is verified to ensure authenticity, and the hash value of the token is checked to ensure integrity. Then, the expiration time field of the token is determined, the current MCP server time is obtained, and the current time and the expiration time are compared. If the current time is earlier than the expiration time, the token has not expired, indicating that the token is valid.

[0071] Step S03: If the validity verification of the tenant token is passed, the tenant information is subject to time window verification; Time window authentication refers to a time range-based authentication mechanism that sets a valid time window for tenant information in advance, defining that tenant information is valid and available within a specific time period.

[0072] Exemplarily, after the validity verification of the tenant token is passed, the time window parameters of the tenant, including the start time and end time of the time window, can be queried from the database based on the tenant token; then, the current system time is obtained, and the current time is compared with the start time and end time of the preset time window. If the current time is greater than or equal to the start time and less than or equal to the end time, it is determined that the time window verification of the tenant information has passed.

[0073] It is understandable that by performing time window verification, ensuring that access is granted only during the predefined authorization start and authorization end period, attackers are prevented from connecting using expired tenant information, thus adding a time dimension to security.

[0074] Step S04: If the time window verification of the tenant information passes, determine whether the target tenant indicated by the tenant information has the authority to access the MCP server based on the MCP authorization information; MCP authorization information refers to a set of data used to manage tenants' access rights to the MCP server, including tenant identification, authorization validity period, authorized operation permissions, and other information.

[0075] Step S05: If the target tenant has permission to access the MCP server, a connection channel is established with the client.

[0076] For example, after the time window verification is passed, the authorization record corresponding to the target tenant (indicated by the tenant information) is queried from the MCP authorization information database, and permission-related information is extracted from the authorization record to determine whether the target tenant has permission to access the MCP server. Furthermore, after determining that the target tenant has permission to access the MCP server, the MCP server and the client establish a stable connection channel through a negotiated communication protocol (such as the TCP / IP protocol).

[0077] Optionally, a persistent connection channel can be established with the client through the MCP server's SSE (Server-Sent Events) endpoint. This connection channel can then be used to push real-time data from the MCP server to the client. For example, a tool list can be pushed in real time so that the client can obtain the latest information about available tools on the MCP server.

[0078] In a feasible implementation manner, before step S23, the method further includes: Step S06: Using the request interceptor, based on the target configuration information, determine whether the target tenant has the authority to call the target tool; Exemplarily, before generating a second tool call request for the target tool, the request interceptor can first be used to find the tool authorization policy of the target tool in the tool configuration information, and determine whether the target tenant has the permission to call the target tool; if the target tenant does not have the corresponding permission, the client's interception request is rejected and a response message of no permission is returned; if the target tenant has the corresponding permission, a second tool call request for the target tool can be further generated.

[0079] Step S07, when the target tenant has the authority to call the target tool, executes the step of determining the request parameters that match the tool parameters based on the first mapping relationship between the tool parameters and the request parameters preset in the target configuration information through the unified proxy tool.

[0080] For example, please refer to Figure 4 , Figure 4 A multi-layer permission control architecture diagram is provided. After receiving a connection establishment request, the MCP server will be intercepted by a request interceptor for parsing and verification before actually processing it. The request interceptor parses the connection establishment request to obtain authentication parameters such as the tenant token and tenant information, and performs verification, mainly including tenant token verification, time window verification, and MCP authorization verification. The first layer verifies the validity of the tenant token. If the verification passes, the second layer proceeds to the time window verification of the tenant information to ensure that the tenant information is valid at the current time. If the time window verification passes, the third layer proceeds to the MCP authorization verification. Based on the MCP authorization information, it is determined whether the target tenant indicated by the tenant information has permission to access the MCP server. Only if the third layer verification passes will the MCP server establish a connection channel with the client to receive the first tool call request to ensure the client's identity is legitimate. After receiving the first tool call request, the request interceptor can also perform the fourth layer of tool-level permission verification to determine whether the target tenant has permission to call the target tool indicated by the tool identifier in the first tool call request.

[0081] In this implementation, by strictly verifying whether the target tenant has the permission to call a specific tool, a highly fine-grained tool-level permission check is implemented, further reducing unauthorized access.

[0082] In a feasible implementation manner, after step S05, the method further includes: Step B06: Generate a session identifier for the connection channel with the target tenant, and update a preset second mapping relationship between the target tenant and the session identifier; A session ID is a string or number that uniquely identifies a connection channel. The second mapping relationship, typically stored in the MCP as a database table or key-value pair, is the mapping between the target tenant and the session ID. The MCP server uses this mapping to quickly locate the target tenant based on the session ID. This allows it to determine whether the tenant currently sending the first tool call request is the target tenant for the connection channel, preventing security threats like session hijacking and replay attacks.

[0083] Before step S06, the method further includes: Step B07: extracting the target session identifier in the first tool call request, and determining whether the target tenant and the target session identifier conform to the second mapping relationship; Step B08, when the target combination and the target session identifier conform to the second mapping relationship, execute the step of determining whether the target tenant has the authority to call the target tool according to the tool identifier and the target configuration information through the request interceptor.

[0084] For example, after parsing the first tool call request to obtain the tool identifier and tool parameters, the target session identifier can be further extracted therefrom, and based on a pre-stored second mapping relationship rule, it is checked whether the target tenant and the target session identifier exist and match in the mapping relationship; if they do exist and match, it indicates that the target tenant can interact with the MCP server through the connection channel.

[0085] It can be understood that by first determining whether the target tenant and session identifier conform to the second mapping relationship, it is ensured that only legitimate tenants can perform subsequent operations in a legitimate session state, preventing illegal users from impersonating legitimate tenants or using expired sessions for malicious access, thereby effectively protecting the security of the MCP server and tenant data.

[0086] In this embodiment, a request interceptor is used to intercept tool call requests and connection establishment before they reach the main application logic, allowing unauthorized requests to be rejected at the earliest stage of the processing pipeline, thereby saving system resources and enhancing security. In addition, by setting up a four-layer permission verification mechanism including token authentication, time window verification, MCP authorization verification, and fine-grained tool-level authorization verification, even if the check at one layer is bypassed or fails, subsequent layers still provide protection, reflecting a "deep defense" strategy. At the same time, this strict isolation, fine-grained access control, and comprehensive auditing enable different business units or external clients to securely share the same MCP server infrastructure, thereby reducing overall deployment and operating costs.

[0087] For example, please refer to Figure 5 , Figure 5This paper provides an end-to-end flow diagram for model tool calling. The external tool calling of a large language model mainly includes four stages.

[0088] Phase 1 is system initialization, including S101. When the MCP server starts, it queries the database for tool configuration information. After the database returns the tool configuration information of each tool (S102), S103 is executed to register it in the tool list so as to understand the information of the currently available tools.

[0089] Phase 2 is client connection and permission verification. The client executes S201 to request the MCP server to establish an SSE connection. After receiving the request, the MCP server intercepts it through the request interceptor (S202), parses and determines authentication parameters such as the tenant token and tenant information, and executes S203 tenant token verification. After the tenant token verification passes, it executes S204 time window verification, and after the verification passes, it performs MCP authorization verification (S205). If any of the verifications fails, the request will be directly rejected. If all three verifications pass, the request interceptor executes S206, and the permission verification of the tenant indicated by the request passes through the MCP server. The MCP service then executes S207 to establish an SSE connection channel with the client for persistent data transmission and information exchange. The client then executes S208 to notify the large language model deployed on it that the connection is ready and a tool call request can be initiated.

[0090] Phase 3 is tool discovery and invocation. When answering user input questions, the large language model may need to call external tools for assistance. Before requesting to call a specific tool, it can first request a tool list from the client (S301) to determine the currently available tools. The client then executes S302 to request the tool list from the MCP server. Since identity authentication has been performed before establishing the connection channel, the MCP server can directly execute S303 to return the tool list to the client, and the client returns the tool list to the large language model (S304). Furthermore, the large language model can execute S305 to generate a first tool invocation request for a specific tool, and the client sends the first tool invocation request to the MCP server (S306). The MCP service executes S307 to uniformly route the received first tool invocation request to a unified proxy tool, and parses it through the proxy tool to determine the tool identifier and tool parameters (S308). Before further processing, the tenant that established the connection channel can be intercepted by a request interceptor. Perform tool permission verification (S309) to determine whether the current tenant has the permission to call the specific tool; then, if the tool permission verification passes (S310), execute S311 through the unified proxy tool to query the first mapping relationship between the tool parameters and the request parameters in the database. After the database returns the first mapping relationship (S312), execute S313 parameter conversion to map the parameter values ​​of the tool parameters to the parameter values ​​of the request parameters, and construct a second tool call request based on this; then execute S314 to send the second tool call request to the external result service, which is processed by the external interface service to generate a response message and return the response message to the unified proxy tool (S315); then, the unified proxy tool performs standardized packaging of the response message according to the format requirements of the MCP (S316), generates a request result, and returns the request result to the MCP server (S317); then, the MCP server executes S308 to return the request result to the client, and the client returns the request result to the large language model (S319).

[0091] The fourth stage is configuration hot update, which can be executed in parallel with the second and third stages. The main task is for the MCP server to regularly detect changes in tool configuration information in the database (S401), and the database returns the updated tool configuration information (S402). The MCP server can then automatically update the tool list based on the updated tool configuration information without restarting the service, achieving zero-downtime update (S403), thereby ensuring that the available tool information in the tool list is accurate.

[0092] Based on the first and / or second embodiments of the present application, in the third embodiment of the present application, the same or similar contents as those in the first and second embodiments above can be referred to above and will not be described in detail. On this basis, the visual arrangement interface includes a tool library panel, a property panel, and a status bar. The visual arrangement method based on the MCP model tool call also includes: Step E10, in response to the configuration operation on the tool library panel, determining the tool to be operated; The tool library panel is a graphical area that presents the collection of tools available in the system in a visual way. It can be composed of a series of icons, buttons or list items, each element corresponding to a specific tool.

[0093] A configuration operation refers to an act of interaction between a user and a software system, activating a function or event in the system through a specific signal generated by an input device (such as a mouse, keyboard, touch screen, etc.); a configuration operation can be a single click, double click, slide, drag, etc., and this embodiment does not impose specific restrictions on this.

[0094] The tool to be operated is a tool that the user currently wants to configure, determined based on the user's configuration operation. Each tool to be operated has its own unique corresponding operation tool identifier, so as to distinguish different tools and their tool configuration information.

[0095] Step E20, in response to the configuration operation on the property panel, determining the tool configuration information of the tool to be operated; The property panel is a user interface component in the visual orchestration interface used to display and edit the properties of specific objects (such as tools and services). It can exist in the form of a window or panel. By interacting with the MCP server, it can obtain and display the property information of the current tool to be operated in real time, and can also modify these properties by receiving user input. The property panel can contain various controls such as text boxes, drop-down menus, check boxes, etc., which are used to display and edit different types of properties.

[0096] Step E30 , in response to a triggering operation on a save control in the status bar, storing the tool configuration information of the tool to be operated in a preset database, so that the MCP server can call the tool configuration information from the database.

[0097] The status bar displays various information related to the current system status, application status, or user operations. This information can be conveyed through graphics, text, or icons, and can integrate interactive controls. The Save control is a functional interactive element in the status bar that can appear as a button, icon, or link.

[0098] Optionally, the status bar may also include a version selection box for displaying the historical edit versions of the tool being operated. The user can select different historical edit situations of the tool being operated for viewing or further editing by configuring different historical edit versions in the version selection box. After detecting the configuration operation for different historical edit versions in the version selection box, the target historical version is determined, and the tool configuration information of the target historical version is displayed in the property panel for the user to view or edit. In other words, version control can be implemented through the version selection box.

[0099] Optionally, an orchestration canvas may be displayed on the visual orchestration interface for configuring dependencies between the tool to be operated and other tools.

[0100] For example, please refer to Figure 6 , Figure 6A design architecture diagram of a visual orchestration interface is provided. The visual orchestration interface includes a tool library panel, an orchestration canvas, a property panel, and a status bar. The arrangement of the tool library panel on the left, the orchestration canvas in the center, the property panel on the right, and the status bar at the bottom is different from the specific limitations of this embodiment. The tool library panel displays a tool classification tree, a search filter, a tool card list, and a batch operation control. Users can expand or merge tool nodes on the tool classification tree by configuring the node. The MCP server will simultaneously display the relevant information (such as tool identification, tool parameters, etc.) of the node and the tool nodes below it in the tool card list. Users can also directly select one or more target tools by configuring the search filter. Similarly, the MCP server will simultaneously display the relevant information of the target tools included in the search results of the configuration operation in the tool card list. Furthermore, users can select the tool to be operated by configuring any tool in the tool card list. Users can also select multiple tools in the tool card list and determine multiple tools to be operated by configuring the batch operation control. The orchestration canvas includes a drag-and-drop orchestration area and a connection selection area. After the user determines the tools to be operated through the tool classification tree or tool card list, the determined tools will be randomly arranged and displayed in the drag-and-drop orchestration area. The user can drag and move the icons corresponding to different tools in the drag-and-drop orchestration area, and at the same time, through the configuration operation in the connection selection area, select tool connection lines to connect the dragged tool icons to clarify the dependency relationship between the tools. The property panel includes a tool configuration area, a parameter configuration area, a permission control area, and a validation control. Users can enter basic information related to the tool to be operated in the tool configuration area, such as the tool name, tool ID, tool parameters, etc., clarify the mapping relationship between tool parameters and request parameters in the parameter configuration area, and determine which tenants have the right to call the tool to be operated in the permission control area. In response to the configuration operation in the tool configuration area, the MCP server determines the basic information of the tool to be operated; in response to the configuration operation in the parameter configuration area, it determines the parameter mapping information of the tool to be operated; in response to the configuration operation in the permission control area, it determines the permission control information of the tool to be operated; in response to the trigger operation in the validation control, it converts the above basic information, parameter mapping information, and permission control information into JSONSchema format for user verification, and at the same time constructs a call request to determine whether the tool to be operated can be correctly accessed. The status bar includes a save control and a version option box. Users can trigger the save control to convert the above configurations for the orchestration canvas and property panel into tool configuration information and save it in the database. At the same time, the memory mapping relationship of the tool to be operated is updated for subsequent calls; a version number is simultaneously generated and saved in the version option box. The operations for the version option box are not repeated here.

[0101] Optionally, the visual editing interface and overall external tool call logic can be implemented by configuring a front-end display layer, an interactive control layer, a data management layer, and a back-end API layer. The front-end display layer utilizes JavaScript frameworks such as Vue.js or React, and UI (User Interface) component libraries such as Element UI or Ant Design, to build a dynamic visual editing interface. Data visualization is handled by charting libraries such as ECharts, while interactive flowchart rendering and drag-and-drop functionality are supported by Canvas technology. The interactive control layer manages all user configuration operations for the visual editing interface, including drag-and-drop operations, permission management, and tracking tool configuration changes. The data management layer can utilize a JSON Schema validator to verify the integrity and correctness of tool configuration information. A state management library such as Vuex or Redux can provide predictable state management in response to triggering actions on validation controls. An API data adapter converts user input into a back-end storage format, enabling seamless front-end and back-end communication. WebSockets are used to enable real-time communication between different management tools on the MCP server (such as the unified proxy tool, timer scheduler, and request interceptor). The backend API provides a dedicated application programming interface through the controller to implement key functions such as permission verification, configuration information monitoring, and tool orchestration. For example, the preset MCP tenant management controller can be used to manage the different tenants who can access the MCP server and the tool permission information and timeliness information that each tenant can call.

[0102] In this embodiment, by providing a visual editing interface, the user is allowed to quickly determine and configure the tool to be operated through simple configuration operations, which reduces the time the user spends searching for tools and editing hard codes, thereby improving overall operational efficiency.

[0103] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the visual orchestration method of the present application based on the MCP model tool call. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0104] An embodiment of the present application provides an MCP server, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the visual orchestration method called by the MCP-based model tool in the first embodiment.

[0105] Reference below Figure 7, which shows a schematic diagram of the structure of an MCP server suitable for implementing embodiments of the present application. The MCP server in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 7 The MCP server shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0106] like Figure 7 As shown, the MCP server may include a processing device 1001 (e.g., a central processing unit (CPU), a graphics processing unit (GPU), etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for MCP server operation. Processing device 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems may be connected to the I / O interface 1006: input devices 1007, such as a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008, such as a liquid crystal display (LCD), speaker, vibrator, etc.; storage device 1003, such as a magnetic tape or hard disk; and communication devices 1009. The communication device 1009 can allow the MCP server to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an MCP server with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have instead.

[0107] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are performed.

[0108] The MCP server provided in the embodiments of this application employs the visual orchestration method for MCP-based model tool invocations described in the aforementioned embodiments, solving the technical problem of improving the efficiency of model tool invocations. Compared to the prior art, the MCP server provided in this application achieves the same beneficial effects as the visual orchestration method for MCP-based model tool invocations described in the aforementioned embodiments. Other technical features of the MCP server are the same as those disclosed in the aforementioned embodiments and are not further elaborated here.

[0109] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0110] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

[0111] An embodiment of the present application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, and the computer-readable program instructions are used to execute the visual orchestration method for calling the MCP-based model tool in the above embodiment.

[0112] The computer-readable storage medium provided in the embodiments of the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0113] The computer-readable storage medium may be included in the MCP server; or may exist independently without being assembled into the MCP server.

[0114] The computer-readable storage medium carries one or more programs. When executed by an MCP server, the one or more programs cause the MCP server to: receive a first tool call request sent by a client, where the first tool call request is generated by a large language model deployed on the client according to the MCP; parse the first tool call request using a preset unified proxy tool and preset tool configuration information to construct a second tool call request, where the tool configuration information is generated based on a configuration operation for a preset visual orchestration interface on the MCP server; send the second tool call request to an external interface service, and receive response information generated by the external interface service based on the second tool call request; construct a request result based on the MCP and the response information, and send the request result to the large language model.

[0115] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0116] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0117] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.

[0118] The computer-readable storage medium provided in the embodiments of this application stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned MCP-based visual orchestration method for model tool invocation. This computer-readable storage medium can address the technical problem of improving the efficiency of model tool invocation. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this application are similar to those of the MCP-based visual orchestration method for model tool invocation provided in the aforementioned embodiments, and are not further elaborated here.

[0119] An embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned visual orchestration method based on MCP model tool call.

[0120] The computer program product provided in the embodiments of this application can solve the technical problem of how to improve the efficiency of model tool invocation. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the MCP-based visual orchestration method for model tool invocation provided in the above embodiments, and will not be elaborated here.

[0121] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A visual arrangement method for model tool calls based on MCP, characterized in that: The visual orchestration method for calling the MCP-based model tool is applied to the Model Context Protocol MCP server, and the method includes: Receiving a first tool call request sent by a client, wherein the first tool call request is generated by a large language model deployed on the client according to the MCP; Parsing the first tool call request using a preset unified proxy tool and preset tool configuration information to construct a second tool call request, wherein the tool configuration information is generated according to a configuration operation for a preset visual orchestration interface on the MCP server; Sending the second tool call request to the external interface service, and receiving response information generated by the external interface service according to the second tool call request; A request result is constructed according to the MCP and the response information, and the request result is sent to the large language model.

2. The visual arrangement method for calling a model tool based on MCP according to claim 1, characterized in that: The step of parsing the first tool call request by using a preset unified proxy tool and preset tool configuration information to construct a second tool call request includes: Extracting the operation tool identifier and tool parameters in the first tool call request through the unified proxy tool; Determining, by the unified agent tool, target configuration information of the target tool indicated by the operation tool identifier from the tool configuration information; Determining, by the unified proxy tool, request parameters that match the tool parameters based on a first mapping relationship between tool parameters and request parameters preset in the target configuration information; A second tool call request is generated through the unified proxy tool according to the request parameters and the target configuration information.

3. The visual arrangement method for calling a model tool based on MCP according to claim 2, characterized in that: Before the step of receiving the first tool call request sent by the client, the method further includes: Receiving a connection establishment request sent by the client, parsing the connection establishment request through a preset request interceptor, and determining authentication parameters of the connection establishment request, wherein the authentication parameters include a tenant token and tenant information; Verifying the validity of the tenant token; If the validity verification of the tenant token passes, performing time window verification on the tenant information; If the time window verification of the tenant information passes, determining whether the target tenant indicated by the tenant information has permission to access the MCP server according to the preset MCP authorization information; In a case where the target tenant has permission to access the MCP server, a connection channel is established with the client.

4. The visual arrangement method for calling a model tool based on MCP according to claim 3, characterized in that: Before the step of determining, by the unified agent tool, the request parameters that match the tool parameters according to the first mapping relationship between the tool parameters and the request parameters preset in the target configuration information, the step further includes: Determining, by the request interceptor and based on the target configuration information, whether the target tenant has permission to call the target tool; In the case where the target tenant has the permission to call the target tool, the step of determining the request parameters that match the tool parameters through the unified agent tool according to the first mapping relationship between the tool parameters preset in the target configuration information and the request parameters is executed.

5. The visual arrangement method for calling a model tool based on MCP according to claim 4, characterized in that: After the step of establishing a connection channel with the client, the method further includes: Generate a session identifier for the connection channel with the target tenant, and update a preset second mapping relationship between the target tenant and the session identifier; Before the step of determining, by the request interceptor, whether the target tenant has the permission to call the target tool according to the tool identifier and the target configuration information, the method further includes: Extracting the target session identifier in the first tool call request, and determining whether the target tenant and the target session identifier conform to the second mapping relationship; When the target combination and the target session identifier conform to the second mapping relationship, the step of determining whether the target tenant has the permission to call the target tool according to the tool identifier and the target configuration information through the request interceptor is executed.

6. The visual arrangement method for calling a model tool based on MCP according to claim 1, characterized in that: The visual arrangement method of the MCP-based model tool call also includes: Through the preset timer scheduler, detect whether the tool configuration information of each tool has been updated; In a case where tool configuration information of at least one tool is updated, a tool list of the MCP server is updated according to the updated tool configuration information, wherein the tool list is used to provide available tool information to the client.

7. The visual arrangement method for calling a model tool based on MCP according to claim 6, characterized in that: The visual arrangement method of the MCP-based model tool call also includes: When the tool configuration information of at least one tool is updated, the updated tool configuration information is saved in a cache.

8. The visual arrangement method for calling a model tool based on MCP according to claim 1, characterized in that: The visual arrangement interface includes a tool library panel, a property panel, and a status bar. The visual arrangement method based on the MCP model tool call also includes: In response to a configuration operation on the tool library panel, determining a tool to be operated; In response to a configuration operation on the property panel, determining tool configuration information of the tool to be operated; In response to a triggering operation on a save control of the status bar, the tool configuration information of the tool to be operated is stored in a preset database, so that the MCP server calls the tool configuration information from the database.

9. An MCP server, characterized in that: The MCP server includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the visual orchestration method based on MCP model tool invocation according to any one of claims 1 to 8.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the visual arrangement method based on MCP model tool call according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Interface calling method and device based on visual arrangement, equipment and medium

    CN117573110A

  • Tool calling method and device, electronic equipment, medium and program product

    CN120295696A

  • Biological information MCP service calling method, system, equipment and medium

    CN120336048A

  • Intelligent centralized agent for autonomously orchestrating multiple data tools

    US20250231801A1

Cited By

  • MCP calling method and device, equipment, storage medium and computer program product

    CN121277649A

  • Method and device for using collaborative office intelligent agent and medium

    CN121326407A

  • Security enhancement method and device related to model context protocol, and medium

    CN121396489A

  • Data processing method and device

    CN121567769A

  • Model context protocol interaction method and device based on code execution

    CN121658099A