8. MCP Request Lifecycle
An MCP request follows a controlled sequence from client connection to response handling.
On the Hopex side, the server exposes the endpoint, tools, context, security controls, and GraphQL/Web API access. On the AI client side, discovery, authentication, tool selection, and response display depend on the client implementation.
8.1. Connection initialization
The AI client connects to the MCP endpoint exposed by HAS over HTTPS. The MCP Server URL, optional configuration headers, and authentication mode are declared in the AI client according to its own documentation.
HAS exposes the MCP endpoint and applies the server communication framework. URL, headers, OAuth, DCR, and API key configuration are handled by the AI client.
8.2. Tool discovery
The Hopex MCP Server declares its available tools to the AI client. The list covers schema introspection, query and mutation guides, GraphQL execution, relationship exploration, object counting, and diagram access.
The LLM uses this metadata to select a tool. Tool presentation, selection strategy, and ambiguous cases are handled by the AI client.
8.3. Tool invocation
When the LLM selects a tool, the AI client sends an MCP call to the Hopex MCP Server. Transport remains HTTPS. The exchanged messages follow the MCP protocol supported by the installed Hopex MCP Server version.
The call contains the tool name and parameters. The AI client builds these parameters from the user request, conversation context, and tool metadata.
8.4. Validation
The Hopex MCP Server validates the call context before execution. This context includes authentication, the Hopex repository, connection profile, GraphQL schema, available rights, and headers sent by the AI client.
Tool parameters are checked against the selected tool and GraphQL schema. The server executes the request within the authorized scope or returns a structured error.
With a customized schema, validation errors may also indicate that customized metamodel elements are missing, insufficiently documented, or not aligned with the expected AI scenarios described in section 5.2 Customized metamodel exposure.
8.5. Hopex execution
After validation, the MCP Server executes the requested capability. Repository operations go through GraphQL/Web API or exposed Hopex services. The MCP Server does not provide direct repository access.
GraphQL queries cover read operations. GraphQL mutations cover create, update, or delete operations when these capabilities are exposed and authorized. Diagram tools use available Hopex capabilities to find or return views associated with objects.
Write execution follows the mutation authorization rules defined in section 5.1.2 Mutation authorization.
8.6. Response handling
The MCP Server returns a structured response to the AI client. The response contains the tool result, authorized data, useful metadata, and any errors.
The AI client turns this response into the message shown to the user. Formatting, summarization, tool combination, and conversation flow are handled by the AI client and the LLM.
8.7. Timeouts and errors
Errors returned by the MCP Server are structured to cover the main failure cases: authentication, authorization, configuration, invalid parameters, GraphQL schema, data access, and Hopex-side execution.
Retry handling, error display, user messages, and recovery behavior depend on the AI client. On the Hopex side, calls are logged to support diagnosis and support activities.