Search

CN-122027681-A - Method for managing related dependence of MCP (micro-processor control)

CN122027681ACN 122027681 ACN122027681 ACN 122027681ACN-122027681-A

Abstract

The invention discloses a method for managing related dependence of MCP, which comprises the steps of establishing an MCP dependence list file, carrying out MCP dependence analysis and installation, and carrying out MCP runtime and server life cycle management. The basic service is directly reused to construct the application of the user without repeatedly manufacturing wheels, so that the development efficiency and the robustness of the whole ecology are improved.

Inventors

  • YU YIKAI
  • Kui gang
  • SUN MINJIE
  • SUN SHIXIN
  • LI XIN
  • HAN NIANXIA
  • WANG XIAOYANG
  • LI HUIMING
  • PENG JIE

Assignees

  • 北京道亨软件股份有限公司

Dates

Publication Date
20260512
Application Date
20251224

Claims (8)

  1. 1. A method of managing MCP related dependencies, the method comprising: establishing an MCP dependency manifest file; Performing MCP dependency analysis and installation; MCP runtime and server lifecycle management is performed.
  2. 2. The method for managing MCP related dependencies according to claim 1, wherein said creating an MCP dependency manifest file specifically comprises: each MCP server project root directory contains a standardized manifest file; metadata of the server itself and other MCP server lists on which it depends are declared within the manifest file; The dependent items are specified using names and semantically version ranges, providing a basis for version resolution.
  3. 3. The method of claim 1, wherein the MCP dependency resolution and installation comprises the steps of when a MCP server is started, the MCP runtime environment first reads the dependency list; recursively analyzing the whole dependency tree, downloading all directly and indirectly dependent server packages according to the version requirements, and processing version conflicts.
  4. 4. A method of managing MCP related dependencies according to claim 3, wherein the MCP runtime environment first reading a dependency manifest specifically comprises: the runtime environment accesses one or more MCP server registries, a central repository of npm or MAVENCENTRAL.
  5. 5. The method of managing MCP related dependencies according to claim 1, wherein the MCP runtime and server lifecycle management specifically comprises: After all the dependency items are analyzed, the MCP runtime environment is responsible for starting the processes of the main server and all the dependency servers; when running, each server instance is allocated with an independent communication port, and the complete life cycle is managed; The method comprises the steps that a special context object is injected into a main server in the running process; the protocol is invoked between servers.
  6. 6. The method of claim 5, wherein the complete life cycle comprises starting, stopping, and restarting.
  7. 7. A method of managing MCP-related dependencies according to claim 5, wherein the context objects include handles or client instances of all launched dependencies.
  8. 8. The method for managing MCP related dependencies according to claim 5, wherein the inter-server call protocol specifically comprises: When the main server needs to call a dependent function, calling a standardized function through a context object injected in the running process; After receiving the call request, the MCP runtime environment plays a role of a request agent; safely routing the request to the correct port of the target dependent server, waiting for a response, and returning the result to the main server; proxy mechanisms abstract the complexities of service discovery, network communication, and error handling from the developer.

Description

Method for managing related dependence of MCP (micro-processor control) Technical Field The invention relates to the field of artificial intelligence and software development, in particular to a method for managing related dependence of MCP. Background ModelContextProtocol (MCP) define a client-server architecture that allows MCP hosts (e.g., IDE, AI applications) to connect to multiple independent MCP servers to take advantage of the data sources and tools exposed by these servers. However, existing MCP ecologies and protocols suffer from the following core drawbacks: 1. The lack of interoperability between servers MCP servers are independent and isolated in design. The protocol itself does not provide a standardized mechanism to allow one MCP server to discover, invoke, or utilize the functionality of another MCP server. The ability to build complex applications is greatly limited because developers cannot combine multiple dedicated servers into one more powerful composite service. 2. The combination is primitive and fragile, if the developer wants to combine the functions of multiple servers, the only way is to do manual, temporary integration at the MCP host (client) level. This approach is very clumsy, error-prone, and does not have scalability, resulting in an abnormally complex client logic. 3. Lack of dependency concepts since servers are isolated, the MCP ecosystem is completely free of the core concept of "dependency". Thus, there is no form of dependency management system to handle version control, dependency resolution, and conflict detection between servers. When multiple community developed servers need to be manually combined, version incompatibility problems are quickly encountered and are not solved. Disclosure of Invention In view of the above, the present invention has been made to provide a management MCP related dependency method that overcomes or at least partially solves the above-mentioned problems. According to one aspect of the present invention, there is provided a method of managing MCP related dependencies, the method comprising: establishing an MCP dependency manifest file; Performing MCP dependency analysis and installation; MCP runtime and server lifecycle management is performed. Optionally, the establishing the MCP dependency manifest file specifically includes: each MCP server project root directory contains a standardized manifest file; metadata of the server itself and other MCP server lists on which it depends are declared within the manifest file; The dependent items are specified using names and semantically version ranges, providing a basis for version resolution. Optionally, the MCP dependency parsing and installation specifically includes that when an MCP server is started, the MCP runtime environment first reads the dependency list; recursively analyzing the whole dependency tree, downloading all directly and indirectly dependent server packages according to the version requirements, and processing version conflicts. Optionally, the MCP runtime environment first reads the dependency list specifically includes: the runtime environment accesses one or more MCP server registries, a central repository of npm or MAVENCENTRAL. Optionally, the MCP runtime and server lifecycle management specifically includes: After all the dependency items are analyzed, the MCP runtime environment is responsible for starting the processes of the main server and all the dependency servers; when running, each server instance is allocated with an independent communication port, and the complete life cycle is managed; The method comprises the steps that a special context object is injected into a main server in the running process; the protocol is invoked between servers. Optionally, the complete life cycle specifically comprises starting, stopping and restarting. Optionally, the context object includes all handles or client instances that have launched dependencies. Optionally, the inter-server call protocol specifically includes: When the main server needs to call a dependent function, calling a standardized function through a context object injected in the running process; After receiving the call request, the MCP runtime environment plays a role of a request agent; safely routing the request to the correct port of the target dependent server, waiting for a response, and returning the result to the main server; proxy mechanisms abstract the complexities of service discovery, network communication, and error handling from the developer. The invention provides a method for managing related dependence of MCP, which comprises the steps of establishing a MCP dependence list file, analyzing and installing MCP dependence, and managing MCP operation and server life cycle. The basic service is directly reused to construct the application of the user without repeatedly manufacturing wheels, so that the development efficiency and the robustness of the whole ecology are improved. The foregoing descri