|
| 1 | +// Module included in the following assemblies: |
| 2 | +// * lightspeed-docs-main/configure/ols-configuring-openshift-lightspeed.adoc |
| 3 | + |
| 4 | +:_mod-docs-content-type: PROCEDURE |
| 5 | +[id="ols-enabling-mcp-server_{context}"] |
| 6 | += Enabling MCP server |
| 7 | + |
| 8 | +Enable the Model Context Protocol (MCP) server so that a large language model (LLM) can securely access an external tool, such as a database or API, and obtain real-time updates. |
| 9 | + |
| 10 | +.Prerequisites |
| 11 | + |
| 12 | +* You have installed the the {ols-long} Operator. |
| 13 | +
|
| 14 | +* You have configured a large language model provider. |
| 15 | +
|
| 16 | +* You have deployed the {ols-long} service. |
| 17 | +
|
| 18 | +.Procedure |
| 19 | + |
| 20 | +. Open the {ols-long} `OLSconfig` custom resource (CR) file by running the following command: |
| 21 | ++ |
| 22 | +[source,terminal] |
| 23 | +---- |
| 24 | +$ oc edit olsconfig cluster |
| 25 | +---- |
| 26 | + |
| 27 | +. Modify the `spec.ols.featureGates` specification to include MCP server information. |
| 28 | ++ |
| 29 | +[source,yaml] |
| 30 | +---- |
| 31 | +apiVersion: ols.openshift.io/v1alpha1 |
| 32 | +kind: OLSConfig |
| 33 | +metadata: |
| 34 | + name: cluster |
| 35 | +spec: |
| 36 | + featureGate: |
| 37 | + - MCPServer <1> |
| 38 | + mcpServers: |
| 39 | + - name: mcp-server-1 <2> |
| 40 | + streamableHTTP: |
| 41 | + url: http://localhost:8080/mcp <3> |
| 42 | + timeout: 30 |
| 43 | + sseReadTimeout: 10 |
| 44 | + headers: |
| 45 | + - Authorization: Bearer <token> |
| 46 | + - Content-Type: application/json |
| 47 | + - Accept: application/json |
| 48 | + enableSSE: true |
| 49 | + - name: mcp-server-2 |
| 50 | + streamableHTTP: |
| 51 | + url: http://localhost:8080/mcp |
| 52 | + timeout: 30 <4> |
| 53 | + sseReadTimeout: 10 <5> |
| 54 | + headers: |
| 55 | + - Authorization: Bearer <token> |
| 56 | + - Content-Type: application/json |
| 57 | + - Accept: application/json |
| 58 | + enableSSE: true <6> |
| 59 | +---- |
| 60 | +<1> Specifies the MCPServer functionality. |
| 61 | +<2> Specifies the name of the MCP server. |
| 62 | +<3> Specifies the URL path that the MCP server uses to communicate. |
| 63 | +<4> Specifies the time that the MCP server has to respond to a query. If the client does not receive a query within the time specified, the MCP server times out. In this example, the timeout is 30 seconds. |
| 64 | +<5> Specifies the amount of time a client waits for new data from a Server-Sent Events (SSE) connection. If the client does not receive data within that time, the client closes the connection. |
| 65 | +<6> When you set `enableSSE` to true the MCP server establishes a one-way channel that the MCP server uses to push updates to the client whenever the server has new information. The default setting is `false`. |
| 66 | + |
| 67 | +. Click *Save*. |
| 68 | ++ |
| 69 | +The save operation saves the file and applies the changes so that the MCP server is available to the {ols-long} service. |
0 commit comments