mcpField
K
kuadrant-mcp-poc

kuadrant-mcp-poc

Local
github.com/KuadrantCloud & Infra0Updated 70w ago

About kuadrant-mcp-poc

kuadrant-mcp-poc is a proof of concept for deploying an MCP server in a Kubernetes cluster and configuring its gateway with Kuadrant. It uses the Streamable HTTP-capable everything MCP server and applies TLS, DNS, authentication, and rate-limit policies.

Key features

  1. 01Deploy an MCP server on Kubernetes
  2. 02Configure a Kuadrant gateway
  3. 03Set up TLS and DNS policies
  4. 04Configure API key auth and rate limits

Use cases

  1. 01Test a remote MCP server in a cluster
  2. 02Configure DNS and TLS for an MCP server
  3. 03Authenticate and limit client requests

MCP support

It deploys the everything MCP server for access over Streamable HTTP and demonstrates client connections and tool invocation.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"kuadrant-mcp-poc": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"build"
]
}
}
}
Run commanddocker run -i --rm build

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
ocibuild

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

kuadrant-mcp-poc

Introduction:

This POC used the everything MCP server as it has Streamable-HTTP capabilities

Prerequisties

  • K8s cluster
  • Kuadrant installed, for more info see Kuadrant docs
Set the environment variables
export QUAY_USERNAME=xxxx # Quay username
export KUADRANT_AWS_ACCESS_KEY_ID=xxxx # AWS Key ID with access to manage the DNS Zone ID below
export KUADRANT_AWS_SECRET_ACCESS_KEY=xxxx # AWS Secret Access Key with access to manage the DNS Zone ID below

Installation

  1. Update the mcp-server/mcp-server-everything.yaml file with your root domain.

1. Install the MCP Server in your K8s cluster.

```sh
   kubectl apply -f mcp-server/mcp-server-everything.yaml
  1. Ensure the MCP everything Server pod is running.
   kubectl get pods -n mcp-server
  1. Create the gateway namespace:
    kubectl create ns mcp-gateway
  1. Create the secret credentials in the same namespace as the Gateway - these will be used to configure DNS:
   kubectl -n mcp-gateway create secret generic aws-credentials \
   --type=kuadrant.io/aws \
   --from-literal=AWS_ACCESS_KEY_ID=$KUADRANT_AWS_ACCESS_KEY_ID \
   --from-literal=AWS_SECRET_ACCESS_KEY=$KUADRANT_AWS_SECRET_ACCESS_KEY
  1. Create the secret credentials in the cert-manager namespace:

   kubectl -n cert-manager create secret generic aws-credentials \
   --type=kuadrant.io/aws \
   --from-literal=AWS_ACCESS_KEY_ID=$KUADRANT_AWS_ACCESS_KEY_ID \
   --from-literal=AWS_SECRET_ACCESS_KEY=$KUADRANT_AWS_SECRET_ACCESS_KEY
  1. Create the Kuadrant Gateway NOTE Update the kuadrant/gateway.yaml file with your root domain.
    kubectl apply -f kuadrant/gateway.yaml
  1. Create the Lets encrypt Cluster issuer and TlS Policy:
  kubectl apply -f kuadrant/tls.yaml
**Note**: The cert can't be self signed. MCP clients dont accept self signed certs yet.
  1. Create the DNSPolicy:
   kubectl apply -f kuadrant/dns.yaml
  1. After a minute, Test that the MCP server is responding
curl -v -X POST "https://api.KUADRANT_ZONE_ROOT_DOMAIN_GOES_HERE/mcp" \
      -H "Content-Type: application/json" \
      -H "Accept: application/json, text/event-stream" \
      -d '{
            "jsonrpc": "2.0",
            "method": "initialize",
            "params": {
              "protocolVersion": "2024-11-05",
              "capabilities": {
                "resources": {},
                "tools": {},
                "prompts": {}
              },
              "clientInfo": {
                "name": "test-curl-client",
                "version": "1.0"
              }
            },
            "id": 1
          }'
  1. Create the Rate limit policy:
    kubectl apply -f kuadrant/rlp.yaml
  1. Create the Auth policy and the API Key secrets:
   kubectl apply -f kuadrant/auth.yaml
MCP Client

In this example we are using Vscode Co pilot as our MCP client as it has capabilities to connect using Streamable HTTP

  1. Add the following to your VSCode setting.json. For more info please see the official VSCode MCP docs
"mcp": {
    "servers": {
      "my-mcp-server": {
        "type": "http",
        "url": "https://KUADRANT_ZONE_ROOT_DOMAIN_GOES_HERE/mcp",
        "headers": {
          "Authorization": "APIKEY IAMALICE"
        }
      }
    }
  },
  1. The Client should be able to use the server now and you should be able to avail of the MCP server tools. Open co pilot in vscode using ⌃⌘I and in the drop down click agent.

  2. In the chat type:

    add 500 and 500
  1. Vscode will ask you about using allowing Co pilot invoke the tool from the MCP server, ensure you allow it.

  2. The chat will output the answer and also show you it ran add from the MCP server

  3. If you leave out the Auth header in the config or ask the chat questions using the tool to many times to quickly, the auth and rate limit policies deployed will deny and limit the requests.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.