Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Kubernetes MCP Orders Playground

A reproducible Proof of Concept demonstrating a remote Model Context Protocol server written in Go, Cline as the MCP client, and PostgreSQL persistence for order-management tools running in Kubernetes.

This repository is an educational playground. It is not a production-ready order-management platform.

License: MIT Kubernetes Go MCP Cline

πŸ”Ž Overview

The playground exposes five MCP tools:

  • list_orders
  • get_order
  • create_order
  • update_order
  • delete_order

Each order contains an order_id, client_id, decimal amount, and address_delivery. Data is persisted in PostgreSQL.

Cline connects to the Go MCP server through Streamable HTTP at http://127.0.0.1:8080/mcp. The language model is configured independently in Cline; the current setup uses the hosted deepseek/deepseek-v4-flash model.

The Go server does not call the language model itself. This separation keeps MCP tools deterministic and allows the model or MCP client to be replaced independently.

πŸ—οΈ Architecture

Kubernetes MCP Orders architecture

🧩 Components

Component Purpose
Cline Open-source VS Code agent, LLM host, and MCP client
DeepSeek V4 Flash Hosted language model selected in Cline
Go MCP server Defines and executes order tools
PostgreSQL Durable order storage
Kubernetes Runs and connects all server-side components
Kind Recommended local Kubernetes environment

🎯 Objective

This playground demonstrates how an LLM host can discover and invoke typed business tools without giving the model direct database access.

βœ… Prerequisites

  • Docker Desktop
  • kind
  • kubectl
  • Go 1.25 or newer for local validation
  • VS Code with the Cline extension

πŸš€ Quick Start

1️⃣ Deploy the playground

make deploy

This creates a Kind cluster, builds the Go image locally, loads it into Kind, and applies the Kubernetes manifests.

2️⃣ Expose the MCP server to Cline

Keep this command running in a separate terminal:

kubectl -n mcp-orders port-forward service/orders-mcp 8080:8080

3️⃣ Configure the model in Cline

In Cline's model selector, choose:

Model: deepseek/deepseek-v4-flash

The model is currently marked FREE in Cline. Model availability and quotas may change over time.

4️⃣ Configure the MCP server in Cline

Open MCP Servers in Cline, choose Configure MCP Servers, and add:

{
  "mcpServers": {
    "orders": {
      "type": "streamableHttp",
      "url": "http://127.0.0.1:8080/mcp",
      "disabled": false,
      "autoApprove": ["list_orders", "get_order"]
    }
  }
}

Read-only tools are auto-approved. Create, update, and delete operations intentionally require interactive approval.

πŸ§ͺ Demo

Try these prompts in Cline:

Create an order for client C-1007, amount 49.90, delivered to 10 Rue de Rivoli, 75001 Paris.

Cline calling the create_order MCP tool

Cline creates an order through the create_order MCP tool.

List the latest orders and show their IDs.

Cline calling the list_orders MCP tool

Cline retrieves persisted orders through the list_orders MCP tool.

Change order <ORDER_ID> to amount 59.90 and delivery address 20 Avenue de France, 75013 Paris.

Cline calling the update_order MCP tool

Cline updates an existing order through the update_order MCP tool.

Delete order <ORDER_ID>.

Cline calling the delete_order MCP tool

Cline deletes the order with explicit confirmation and verifies that it is no longer present.

The delete tool requires confirm=true. Cline should request explicit confirmation before invoking it.

πŸ” Verification

kubectl -n mcp-orders get pods,pvc,services,jobs
curl -fsS http://127.0.0.1:8080/healthz

Inspect persisted records:

kubectl -n mcp-orders exec statefulset/postgres -- \
  psql -U orders -d orders -c \
  'SELECT order_id, client_id, amount, address_delivery, created_at FROM orders ORDER BY created_at DESC;'

πŸ” Tool safety

  • The LLM never receives PostgreSQL credentials.
  • SQL statements are parameterized through pgx.
  • Amounts are stored as NUMERIC(12,2), not floating-point values.
  • Write tools include clear confirmation-oriented descriptions.
  • delete_order rejects calls unless confirm=true.
  • Only read-only tools are included in Cline's autoApprove list.

The included database credential is deliberately a local demonstration value. Replace it before using the manifests in any shared environment.

🧰 Validation

make validate

🧹 Cleanup

Preserve persistent volumes:

make cleanup

Delete persistent data as well:

DELETE_PVCS=true make cleanup

Delete the complete Kind cluster:

kind delete cluster --name mcp-orders

πŸŽ“ What You Will Learn

  • How Cline connects to a remote MCP server
  • How Streamable HTTP differs from a local STDIO MCP server
  • How to define strongly typed MCP tools in Go
  • How to isolate LLM inference from deterministic business operations
  • How to persist tool state in PostgreSQL
  • How to apply approval boundaries to destructive tools

πŸ“š References

πŸ› About OpenMind Systems Lab

OpenMind Systems Lab is an independent French non-profit association dedicated to research, experimental development and technical benchmarking in Cloud Native technologies.

Our mission is to produce practical, reproducible and educational Open Source Proofs of Concept covering Kubernetes, Platform Engineering, Distributed Messaging, Infrastructure Security and Artificial Intelligence.

GitHub Organization:

https://github.com/openmind-systems-lab


Made with ❀️ by OpenMind Systems Lab

About

A reproducible Proof of Concept demonstrating a remote Model Context Protocol server written in Go, Cline as the MCP client, and PostgreSQL persistence for order-management tools running in Kubernetes.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages