Skip to content

OLS-2018:Document enabling MCP server #97459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: lightspeed-docs-main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions configure/ols-configuring-openshift-lightspeed.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ include::modules/ols-tokens-and-token-quota-limits.adoc[leveloffset=+1]
include::modules/ols-activating-token-quota-limits.adoc[leveloffset=+2]
include::modules/ols-about-postgresql-persistence.adoc[leveloffset=+1]
include::modules/ols-enabling-postgresql-persistence.adoc[leveloffset=+2]
include::modules/ols-about-mcp-server.adoc[leveloffset=+1]
include::modules/ols-enabling-mcp-server.adoc[leveloffset=+2]
13 changes: 13 additions & 0 deletions modules/ols-about-mcp-server.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Module included in the following assemblies:
// * lightspeed-docs-main/configure/ols-configuring-openshift-lightspeed.adoc

:_mod-docs-content-type: CONCEPT
[id="about-mcp-server_{context}"]
= About Model Context Protocol (MCP) server

A Model Context Protocol (MCP) server is a program that implements the Model Context Protocol. The protocol creates a secure intermediary between a large language model (LLM) and external resources, such as data sources or software applications. Using the protocol, an MCP server provides a standardized way for an LLM to increase context by requesting and receiving real-time updates from external resources. This functionality transforms the LLM from a static knowledge base into a dynamic system that uses real-time information to answer questions or complete actions.

:FeatureName: MCP server
include::snippets/technology-preview.adoc[]

MCP server is disabled by default. To enable the functionality, add the `spec.featureGate.MCPServer` specification to the `OLSConfig` custom resource (CR).
69 changes: 69 additions & 0 deletions modules/ols-enabling-mcp-server.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// Module included in the following assemblies:
// * lightspeed-docs-main/configure/ols-configuring-openshift-lightspeed.adoc

:_mod-docs-content-type: PROCEDURE
[id="ols-enabling-mcp-server_{context}"]
= Enabling MCP server

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.

.Prerequisites

* You have installed the the {ols-long} Operator.

* You have configured a large language model provider.

* You have deployed the {ols-long} service.

.Procedure

. Open the {ols-long} `OLSconfig` custom resource (CR) file by running the following command:
+
[source,terminal]
----
$ oc edit olsconfig cluster
----

. Add `MCPServer` to the `spec.ols.featureGates` specification file and include the MCP server information.
+
[source,yaml]
----
apiVersion: ols.openshift.io/v1alpha1
kind: OLSConfig
metadata:
name: cluster
spec:
featureGate:
- MCPServer <1>
mcpServers:
- name: mcp-server-1 <2>
streamableHTTP:
url: http://localhost:8080/mcp <3>
timeout: 30
sseReadTimeout: 10
headers:
- Authorization: Bearer <token>
- Content-Type: application/json
- Accept: application/json
Comment on lines +45 to +47

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know what headers the user might put here, but they will not be these 3 ^^"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onmete do you know what headers could be set here for requests to MCP servers?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The service is providing "kubernetes-authorization: Bearer {user_token}" to the openshift mcp server.

enableSSE: true
- name: mcp-server-2
streamableHTTP:
url: http://localhost:8080/mcp
timeout: 30 <4>
sseReadTimeout: 10 <5>
headers:
- Authorization: Bearer <token>
- Content-Type: application/json
- Accept: application/json
enableSSE: true <6>
----
<1> Specifies the MCPServer functionality.
<2> Specifies the name of the MCP server.
<3> Specifies the URL path that the MCP server uses to communicate.
<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.
<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.
<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`.

. Click *Save*.
+
The save operation saves the file and applies the changes so that the MCP server is available to the {ols-long} service.