MCP Demo Server F12b6e78

MCPAI代理

提供方 freemangh

AI代理 stdio · 本地进程 会话登录 社区 / 第三方
查看接入方式

提供基于Go和Python实现的MCP协议演示服务器,支持echotest、timeserver和fetch工具测试。

一句话选型结论

按资料字段整理

MCP Demo Server F12b6e78 属于AI代理类 MCP 服务器,stdio · 本地进程,会话登录,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类AI代理 传输方式stdio · 本地进程 鉴权会话登录 部署方式本地部署
GitHub 星标 1 仓库热度,无公开仓库时显示未标注
工具数 3 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

AI代理
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量3暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

适用场景

MCP协议Python本地部署SDK演示服务器实现Go语言Python语言

安装与配置

stdio · 本地进程 会话登录
客户端在本机拉起子进程,数据不出本机
pip install -r requirements.txt

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js 等运行时,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 3 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
给代理接外部能力

让代理在任务中途调用搜索、数据库等真实工具。

多步任务编排

把一串操作拆成步骤,由代理按顺序执行。

自动化重复流程

把固定流程交给代理跑,减少手工操作。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 3 个工具,职责相对集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好会话登录对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
MCP Demo Server F12b6e78当前 3 stdio · 本地进程 本地部署 有 2026-05-17
Filesystem 560c4363 13 未标注 本地部署 无 2026-05-17
Server Everything (everything) 11 stdio · 本地进程 本地部署 有 2026-05-17
Time 7365cb6d 2 SSE · 服务端推送 远程部署 有 2026-05-18
Everything Claude Code 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Openmemory 557e1585 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

AI代理
字段来自项目仓库与公开索引,中文说明由本站标注
提供方freemangh上游标注的维护方 freemangh
分类AI代理本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式会话登录远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

32.4 KB
来自项目仓库与上游目录的原文,未做删改

MCP (Model Context Protocol) SDK Demo Servers

This project provides two simple MCP servers (in Go and Python) using the official SDKs.

Repository Structure```

mcp-demo-server/
├── go-server/ # Go implementation
│ ├── main.go # Server code
│ ├── go.mod # Go dependencies
│ ├── Dockerfile # Docker build file
│ └── cmd/
│ └── testclient/ # MCP test client (Go)
│ └── main.go # Test client code
├── python-server/ # Python implementation
│ ├── mcp_server.py # Server code
│ ├── requirements.txt # Python dependencies
│ ├── Dockerfile # Docker build file
│ └── cmd/
│ └── testclient/ # MCP test client (Python)
│ └── testclient.py # Test client code
├── k8s/ # Kubernetes manifests
│ ├── go-server-deployment.yaml # Go server Deployment & Service
│ ├── python-server-deployment.yaml # Python server Deployment & Service
│ └── ingress.yaml # Optional Ingress configuration
├── helm/ # Helm charts
│ ├── mcp-server-go/ # Go server Helm chart
│ │ ├── Chart.yaml # Chart metadata
│ │ ├── values.yaml # Default values
│ │ └── templates/ # Kubernetes templates
│ └── mcp-server-python/ # Python server Helm chart
│ ├── Chart.yaml # Chart metadata
│ ├── values.yaml # Default values
│ └── templates/ # Kubernetes templates
└── README.md # This file


Each server exposes the following tools for testing the MCP protocol:

-   **`echotest`**: Echoes back the provided message
-   **`timeserver`**: Returns the current time with optional IANA timezone support (e.g., "Europe/Kyiv", "America/New_York")
-   **`fetch`**: Fetches content from any HTTP/HTTPS URL with optional size limit

## HTTP Endpoints

When running in HTTP mode, both servers expose the following endpoints:

| Endpoint | Purpose | Method | Response |
|----------|---------|--------|----------|
| `/mcp` | MCP Streamable HTTP endpoint | GET/POST/DELETE | Streamable HTTP transport for MCP protocol (MCP spec 2025-03-26) |
| `/health` | Health check | GET | JSON status: `{"status":"ok","service":"...","version":"v1.1.0"}` |
| `/healthz` | Health check (K8s style) | GET | JSON status: `{"status":"ok","service":"...","version":"v1.1.0"}` |

The health check endpoints (`/health` and `/healthz`) are designed for:
- Kubernetes liveness and readiness probes
- Load balancer health checks
- Monitoring systems
- Quick service status verification

**Transport Protocol:** Both servers use the modern **Streamable HTTP transport** (MCP specification 2025-03-26) which provides:
- Single unified `/mcp` endpoint for all operations
- Stateful session management with `Mcp-Session-Id` header
- Session affinity support for production deployments
- 30-minute session timeout for idle connections

## CLI Alignment

Both servers support consistent command-line arguments:

Argument · Go Server · Python Server · Description
`--mode` · `stdio` \ · `http` · `stdio` \ · `http` · Transport mode
`--host` · default: `0.0.0.0` · default: `0.0.0.0` · Bind address
`--port` · default: `8080` · default: `8080` · Listen port

**Transport Modes:**
- **Go**: `stdio` (default, local) or `http` (Streamable HTTP for network)
- **Python**: `stdio` (default, local) or `http` (Streamable HTTP for network)

## Testing Clients

Because these servers use the real MCP protocol, you need an MCP client to test them. You have two options:

### Option 1: Built-in Test Clients (Recommended)

This repository includes test clients in both Go and Python that support both servers.

#### Go Test Client

**Build:**```bash
cd go-server
go build -o testclient ./cmd/testclient

Usage:```bash

Single command mode

./testclient -tool echotest -args '{"message":"Hello"}' -url http://localhost:8080/mcp
./testclient -tool timeserver -args '{"timezone":"Europe/Kyiv"}' -url http://localhost:8080/mcp
./testclient -tool fetch -args '{"url":"https://ifconfig.co/json","max_bytes":1024}' -url http://localhost:8080/mcp

Interactive mode

./testclient -i -url http://localhost:8080/mcp


#### Python Test Client

**Setup:**```bash
cd python-server
# Ensure dependencies are installed (mcp package required)
source venv/bin/activate  # if using venv
pip install -r requirements.txt

Usage:```bash

Single command mode

python3 cmd/testclient/testclient.py -tool echotest -args '{"message":"Hello"}' -url http://localhost:8080/mcp
python3 cmd/testclient/testclient.py -tool timeserver -args '{"timezone":"Europe/Kyiv"}' -url http://localhost:8080/mcp
python3 cmd/testclient/testclient.py -tool fetch -args '{"url":"https://ifconfig.co/json","max_bytes":1024}' -url http://localhost:8080/mcp

Interactive mode

python3 cmd/testclient/testclient.py -i -url http://localhost:8080/mcp


#### Interactive Mode Commands

Both clients support the same interactive commands:
- `help`, `h`, `?` - Show available commands
- `list`, `ls` - List available tools on the server
- `echo ` - Test echotest tool
- `time [timezone]` - Test timeserver tool
- `fetch  [max_bytes]` - Test fetch tool
- `quit`, `exit`, `q` - Exit

### Option 2: Official `mcp-cli`

You can also use the official MCP CLI tool:```bash
go install github.com/modelcontextprotocol/mcp-cli@latest

(Ensure your Go bin directory, e.g., ~/go/bin, is in your $PATH)

1. Go (Golang) Server

Location: go-server/

Files:

  • main.go (Server Code)
  • go.mod / go.sum (Dependencies)
  • Dockerfile (Docker Build File)

Build and Run (Locally)

  1. Navigate to the Go server directory:bash cd go-server

  2. Install dependencies (if needed):bash go mod download

  3. Run the Server:

    Stdio mode (default):```bash
    go run .

    Server: mcp-server-demo-go running in stdio mode

    ```

    HTTP mode (Streamable HTTP for network access):```bash
    go run . --mode=http --host=0.0.0.0 --port=8080

    Server: mcp-server-demo-go v1.1.0 starting...

    Transport: Streamable HTTP (MCP spec 2025-03-26)

    Server listening on 0.0.0.0:8080

    ```

Test (Locally)

For HTTP mode:

The server exposes multiple endpoints. You can verify the server is running:```bash

Test health check endpoint

curl http://localhost:8080/health

Should return: {"status":"ok","service":"mcp-server-demo-go","version":"v1.1.0"}

Test Kubernetes-style health check

curl http://localhost:8080/healthz

Should return: {"status":"ok","service":"mcp-server-demo-go","version":"v1.1.0"}

Test MCP endpoint (Streamable HTTP transport)

curl -X GET http://localhost:8080/mcp

MCP protocol communication (requires proper MCP client)


To interact with the MCP server, use an MCP-compatible client that supports Streamable HTTP transport:
- The built-in test clients (Go/Python) included in this repository
- The official MCP SDKs with Streamable HTTP support (Go SDK v1.1.0+, Python SDK v1.21.2+)
- Custom clients implementing the MCP Streamable HTTP specification (2025-03-26)

**Example with built-in Go test client:**```bash
cd go-server
./testclient -i -url http://localhost:8080/mcp

Example with MCP Go SDK:```go
import "github.com/modelcontextprotocol/go-sdk/mcp"

transport := &mcp.StreamableClientTransport{
Endpoint: "http://localhost:8080/mcp",
MaxRetries: 3,
}
session, err := client.Connect(ctx, transport, nil)


**For stdio mode:** Use with MCP clients that support stdio transport (like the official mcp-cli with command transport)

### Dockerize

1.  **Build the Docker Image:**```bash
    cd go-server
    docker build -t mcp-server-demo-go:latest .
    ```

2.  **Run the Docker Container (HTTP mode - default):**```bash
    docker run -d -p 8080:8080 --name go-mcp mcp-server-demo-go:latest
    # Server runs in HTTP mode (Streamable HTTP transport) by default in Docker
    ```

3.  **Verify the container is running:**```bash
    docker logs go-mcp
    # Should show:
    # mcp-server-demo-go v1.1.0 starting...
    # Transport: Streamable HTTP (MCP spec 2025-03-26)
    # Server listening on 0.0.0.0:8080

    curl http://localhost:8080/health
    # Should return: {"status":"ok","service":"mcp-server-demo-go","version":"v1.1.0"}
    ```

4.  **Run in stdio mode (if needed):**```bash
    docker run -it --name go-mcp mcp-server-demo-go:latest --mode=stdio
    ```

5.  **Stop/Remove:** `docker stop go-mcp && docker rm go-mcp`

## 2. Python Server

**Location:** `python-server/`

**Files:**

-   `mcp_server.py` (Server Code)
-   `requirements.txt` (Dependencies)
-   `Dockerfile` (Docker Build File)

### Build and Run (Locally)

1.  **Navigate to the Python server directory:**```bash
    cd python-server
    ```

2.  **Create a Virtual Environment (recommended):**```bash
    python3 -m venv venv
    source venv/bin/activate
    ```

3.  **Install Dependencies:**```bash
    pip install -r requirements.txt
    ```

4.  **Run the Server:**

    **Stdio mode (default):**```bash
    python3 mcp_server.py
    # Output: INFO - mcp-server-demo-python running in stdio mode
    ```

    **HTTP mode (Streamable HTTP for network access):**```bash
    python3 mcp_server.py --mode=http --host=0.0.0.0 --port=8080
    # Output:
    # INFO - mcp-server-demo-python v1.1.0 starting...
    # INFO - Transport: Streamable HTTP (MCP spec 2025-03-26)
    # INFO - Server listening on 0.0.0.0:8080
    ```

### Test (Locally)

**For HTTP mode:**

The server exposes multiple endpoints. You can verify the server is running:```bash
# Test health check endpoint
curl http://localhost:8080/health
# Should return: {"status":"ok","service":"mcp-server-demo-python","version":"v1.1.0"}

# Test Kubernetes-style health check
curl http://localhost:8080/healthz
# Should return: {"status":"ok","service":"mcp-server-demo-python","version":"v1.1.0"}

# Test MCP endpoint (Streamable HTTP transport)
curl -X GET http://localhost:8080/mcp
# MCP protocol communication (requires proper MCP client)

To interact with the MCP server, use an MCP-compatible client that supports Streamable HTTP transport:
- The built-in test clients (Go/Python) included in this repository
- The official MCP SDKs with Streamable HTTP support (Go SDK v1.1.0+, Python SDK v1.21.2+)
- Custom clients implementing the MCP Streamable HTTP specification (2025-03-26)

Example with built-in Python test client:```bash
cd python-server
python3 cmd/testclient/testclient.py -i -url http://localhost:8080/mcp


**Example with MCP Python SDK:**```python
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

async with streamablehttp_client("http://localhost:8080/mcp") as (read, write):
    async with ClientSession(read, write) as session:
        await session.initialize()
        result = await session.call_tool("timeserver", arguments={})
        print(result)

For stdio mode: Use with MCP clients that support stdio transport (like the official mcp-cli with command transport)

Dockerize

  1. Build the Docker Image:bash cd python-server docker build -t mcp-server-demo-python:latest .

  2. Run the Docker Container (HTTP mode - default):bash docker run -d -p 8080:8080 --name py-mcp mcp-server-demo-python:latest # Server runs in HTTP mode (Streamable HTTP transport) by default in Docker

  3. Verify the container is running:```bash
    docker logs py-mcp
    # Should show:
    # INFO - mcp-server-demo-python v1.1.0 starting...
    # INFO - Transport: Streamable HTTP (MCP spec 2025-03-26)
    # INFO - Server listening on 0.0.0.0:8080

    curl http://localhost:8080/health

    Should return: {"status":"ok","service":"mcp-server-demo-python","version":"v1.1.0"}

    ```

  4. Run in stdio mode (if needed):bash docker run -it --name py-mcp mcp-server-demo-python:latest --mode=stdio

  5. Stop/Remove: docker stop py-mcp && docker rm py-mcp

3. Production Deployment

This section covers building production-ready Docker images and deploying to Kubernetes.

Docker Image Build for Production

Building and Tagging Images

For production deployments, it's recommended to use semantic versioning and push images to a container registry.

Go Server:```bash
cd go-server

Set version and registry configuration

VERSION=v1.1.0
REGISTRY_USER=yourusername # For Docker Hub

REGISTRY=gcr.io/your-project-id # For GCR

REGISTRY=123456789012.dkr.ecr.us-east-1.amazonaws.com # For ECR

Build with version tag

docker build -t mcp-server-demo-go:${VERSION} -t mcp-server-demo-go:latest .

Tag for your container registry

For Docker Hub:

docker tag mcp-server-demo-go:${VERSION} ${REGISTRY_USER}/mcp-server-demo-go:${VERSION}
docker tag mcp-server-demo-go:latest ${REGISTRY_USER}/mcp-server-demo-go:latest

For Google Container Registry (GCR) or Amazon ECR:

docker tag mcp-server-demo-go:${VERSION} ${REGISTRY}/mcp-server-demo-go:${VERSION}

docker tag mcp-server-demo-go:latest ${REGISTRY}/mcp-server-demo-go:latest


**Python Server:**```bash
cd python-server

# Set version and registry configuration
VERSION=v1.1.0
REGISTRY_USER=yourusername              # For Docker Hub
# REGISTRY=gcr.io/your-project-id       # For GCR
# REGISTRY=123456789012.dkr.ecr.us-east-1.amazonaws.com  # For ECR

# Build with version tag
docker build -t mcp-server-demo-python:${VERSION} -t mcp-server-demo-python:latest .

# Tag for your container registry
# For Docker Hub:
docker tag mcp-server-demo-python:${VERSION} ${REGISTRY_USER}/mcp-server-demo-python:${VERSION}
docker tag mcp-server-demo-python:latest ${REGISTRY_USER}/mcp-server-demo-python:latest

# For Google Container Registry (GCR) or Amazon ECR:
# docker tag mcp-server-demo-python:${VERSION} ${REGISTRY}/mcp-server-demo-python:${VERSION}
# docker tag mcp-server-demo-python:latest ${REGISTRY}/mcp-server-demo-python:latest

Pushing to Container Registry

Docker Hub:```bash

Login to Docker Hub

docker login

Push images

docker push ${REGISTRY_USER}/mcp-server-demo-go:${VERSION}
docker push ${REGISTRY_USER}/mcp-server-demo-go:latest
docker push ${REGISTRY_USER}/mcp-server-demo-python:${VERSION}
docker push ${REGISTRY_USER}/mcp-server-demo-python:latest


**Google Container Registry (GCR):**```bash
# Authenticate with GCR
gcloud auth configure-docker

# Push images
docker push ${REGISTRY}/mcp-server-demo-go:${VERSION}
docker push ${REGISTRY}/mcp-server-demo-go:latest
docker push ${REGISTRY}/mcp-server-demo-python:${VERSION}
docker push ${REGISTRY}/mcp-server-demo-python:latest

Amazon ECR:```bash

Set AWS region

AWS_REGION=us-east-1

Authenticate with ECR

aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${REGISTRY}

Create repositories if they don't exist

aws ecr create-repository --repository-name mcp-server-demo-go --region ${AWS_REGION}
aws ecr create-repository --repository-name mcp-server-demo-python --region ${AWS_REGION}

Push images

docker push ${REGISTRY}/mcp-server-demo-go:${VERSION}
docker push ${REGISTRY}/mcp-server-demo-go:latest
docker push ${REGISTRY}/mcp-server-demo-python:${VERSION}
docker push ${REGISTRY}/mcp-server-demo-python:latest


### Kubernetes Deployment

This project includes ready-to-use Kubernetes manifests in the `k8s/` directory.

#### Prerequisites

1. **Kubernetes cluster** - You can use:
   - Local: Minikube, Kind, Docker Desktop with Kubernetes
   - Cloud: GKE, EKS, AKS, or any other Kubernetes cluster

2. **kubectl** - Kubernetes CLI tool configured to access your cluster

3. **Container images** - Either:
   - Use local images (for Minikube/Kind with `imagePullPolicy: IfNotPresent`)
   - Push images to a registry and update image references in manifests

#### Deployment Manifests Overview

The `k8s/` directory contains:

- `go-server-deployment.yaml` - Go server Deployment and Service
- `python-server-deployment.yaml` - Python server Deployment and Service
- `ingress.yaml` - Optional Ingress for external access

Each deployment includes:
- **2 replicas** for high availability
- **Health checks** (liveness and readiness probes)
- **Resource limits** (CPU and memory)
- **Security context** (non-root user, dropped capabilities)
- **ClusterIP Service** for internal cluster communication

#### Step-by-Step Deployment

**1. Prepare your cluster:**

For local testing with Minikube:```bash
# Start Minikube
minikube start

# Load local images into Minikube (if not using a registry)
minikube image load mcp-server-demo-go:latest
minikube image load mcp-server-demo-python:latest

For Kind:```bash

Create Kind cluster

kind create cluster --name mcp-demo

Load local images into Kind (if not using a registry)

kind load docker-image mcp-server-demo-go:latest --name mcp-demo
kind load docker-image mcp-server-demo-python:latest --name mcp-demo


**2. Update image references (if using a registry):**

Edit the manifest files to use your registry images:```bash
# Set your registry and version
REGISTRY_USER=yourusername
VERSION=v1.1.0

# For go-server-deployment.yaml, change:
# image: mcp-server-demo-go:latest
# to:
# image: ${REGISTRY_USER}/mcp-server-demo-go:${VERSION}

# For python-server-deployment.yaml, change:
# image: mcp-server-demo-python:latest
# to:
# image: ${REGISTRY_USER}/mcp-server-demo-python:${VERSION}

Or use sed to update:```bash
cd k8s
sed -i "s|mcp-server-demo-go:latest|${REGISTRY_USER}/mcp-server-demo-go:${VERSION}|g" go-server-deployment.yaml
sed -i "s|mcp-server-demo-python:latest|${REGISTRY_USER}/mcp-server-demo-python:${VERSION}|g" python-server-deployment.yaml


**3. Deploy to Kubernetes:**```bash
# Deploy Go server
kubectl apply -f k8s/go-server-deployment.yaml

# Deploy Python server
kubectl apply -f k8s/python-server-deployment.yaml

# Optional: Deploy Ingress (requires Ingress controller)
kubectl apply -f k8s/ingress.yaml

4. Verify deployments:```bash

Check deployment status

kubectl get deployments
kubectl get pods
kubectl get services

Wait for pods to be ready

kubectl wait --for=condition=ready pod -l app=mcp-server-demo-go --timeout=60s
kubectl wait --for=condition=ready pod -l app=mcp-server-demo-python --timeout=60s

Check pod logs

kubectl logs -l app=mcp-server-demo-go
kubectl logs -l app=mcp-server-demo-python


Expected output:```
NAME                                    READY   STATUS    RESTARTS   AGE
mcp-server-demo-go-xxxxxxxxxx-xxxxx     1/1     Running   0          30s
mcp-server-demo-go-xxxxxxxxxx-xxxxx     1/1     Running   0          30s
mcp-server-demo-python-xxxxxxxxxx-xxxx  1/1     Running   0          30s
mcp-server-demo-python-xxxxxxxxxx-xxxx  1/1     Running   0          30s

Testing Kubernetes Deployments

Method 1: Port Forwarding (Quick Test)```bash

Forward Go server port

kubectl port-forward svc/mcp-server-demo-go 8080:8080

In another terminal, test the server

curl http://localhost:8080/health

Should return 200 OK

Test with built-in test client

cd go-server
./testclient -tool timeserver -args '{}' -url http://localhost:8080/mcp

Forward Python server port (use a different local port)

kubectl port-forward svc/mcp-server-demo-python 8081:8080

Test Python server

curl http://localhost:8081/health
cd python-server
python3 cmd/testclient/testclient.py -tool timeserver -args '{}' -url http://localhost:8081/mcp


**Method 2: From within the cluster (create a test pod)**```bash
# Create a temporary test pod
kubectl run test-client --image=curlimages/curl:latest -it --rm --restart=Never -- sh

# Inside the pod, test the services
curl http://mcp-server-demo-go:8080/health
curl http://mcp-server-demo-python:8080/health

Method 3: Using Ingress (External Access)

If you deployed the Ingress:```bash

Get Ingress address

kubectl get ingress

For Minikube, enable Ingress addon

minikube addons enable ingress

Get Minikube IP

minikube ip

Test with Ingress (update /etc/hosts to point domain to Minikube IP)

Add line: <minikube-ip> mcp-demo.example.com mcp-go.example.com mcp-python.example.com

curl http://mcp-go.example.com/health
curl http://mcp-python.example.com/health

Or use the test clients

./testclient -tool timeserver -args '{}' -url http://mcp-go.example.com/mcp


**Method 4: Interactive Testing**```bash
# Port forward and use interactive mode
kubectl port-forward svc/mcp-server-demo-go 8080:8080

# In another terminal
cd go-server
./testclient -i -url http://localhost:8080/mcp

# Interactive commands:
mcp&gt; list
mcp&gt; echo Hello from Kubernetes!
mcp&gt; time Europe/Kyiv
mcp&gt; fetch https://ifconfig.co/json 1024

Health Checks and Monitoring

Check pod health:```bash

View pod status and ready state

kubectl get pods -l app=mcp-server-demo-go -o wide
kubectl get pods -l app=mcp-server-demo-python -o wide

Describe pod to see health check results

kubectl describe pod -l app=mcp-server-demo-go | grep -A 5 "Liveness|Readiness"

View events

kubectl get events --sort-by=.metadata.creationTimestamp


**Check resource usage:**```bash
# View resource consumption
kubectl top pods -l app=mcp-server-demo-go
kubectl top pods -l app=mcp-server-demo-python

# View resource limits
kubectl describe deployment mcp-server-demo-go | grep -A 5 &quot;Limits\|Requests&quot;

Scaling Deployments```bash

Scale Go server to 3 replicas

kubectl scale deployment mcp-server-demo-go --replicas=3

Scale Python server to 3 replicas

kubectl scale deployment mcp-server-demo-python --replicas=3

Verify scaling

kubectl get pods -l app=mcp-server-demo-go
kubectl get pods -l app=mcp-server-demo-python

Auto-scaling (HPA - requires metrics-server)

kubectl autoscale deployment mcp-server-demo-go --cpu-percent=70 --min=2 --max=10
kubectl autoscale deployment mcp-server-demo-python --cpu-percent=70 --min=2 --max=10


#### Updating Deployments```bash
# Update to a new version
NEW_VERSION=v1.1.0
kubectl set image deployment/mcp-server-demo-go mcp-server=${REGISTRY_USER}/mcp-server-demo-go:${NEW_VERSION}
kubectl set image deployment/mcp-server-demo-python mcp-server=${REGISTRY_USER}/mcp-server-demo-python:${NEW_VERSION}

# Check rollout status
kubectl rollout status deployment/mcp-server-demo-go
kubectl rollout status deployment/mcp-server-demo-python

# Rollback if needed
kubectl rollout undo deployment/mcp-server-demo-go
kubectl rollout undo deployment/mcp-server-demo-python

# View rollout history
kubectl rollout history deployment/mcp-server-demo-go

Troubleshooting

Pods not starting:```bash

Check pod status

kubectl get pods -l app=mcp-server-demo-go

View pod events and logs

kubectl describe pod <pod-name>
kubectl logs <pod-name>

Common issues:

- Image pull errors: Check image name and registry authentication

- CrashLoopBackOff: Check logs for application errors

- Pending: Check resource availability (CPU/memory)


**Health checks failing:**```bash
# Check endpoint manually from within cluster
kubectl run test --image=curlimages/curl -it --rm --restart=Never -- curl -I http://mcp-server-demo-go:8080/sse

# Adjust health check timing if needed (edit deployment)
kubectl edit deployment mcp-server-demo-go
# Increase initialDelaySeconds or failureThreshold

Service not accessible:```bash

Verify service endpoints

kubectl get endpoints mcp-server-demo-go

Check if pods are ready

kubectl get pods -l app=mcp-server-demo-go

Test service from within cluster

kubectl run test --image=curlimages/curl -it --rm --restart=Never -- curl http://mcp-server-demo-go:8080/mcp


#### Cleanup```bash
# Delete all resources
kubectl delete -f k8s/go-server-deployment.yaml
kubectl delete -f k8s/python-server-deployment.yaml
kubectl delete -f k8s/ingress.yaml

# Or delete by label
kubectl delete all -l app=mcp-server-demo-go
kubectl delete all -l app=mcp-server-demo-python

# Delete Minikube cluster (if used)
minikube delete

# Delete Kind cluster (if used)
kind delete cluster --name mcp-demo

Helm Deployment

This project includes Helm charts for simplified deployment and management of both MCP servers.

Prerequisites

  1. Helm 3.x installed (Installation guide)
  2. Kubernetes cluster with kubectl configured
  3. Container images built and accessible (local or registry)

Helm Charts Overview

The helm/ directory contains two Helm charts:

  • helm/mcp-server-go/ - Helm chart for Go server
  • helm/mcp-server-python/ - Helm chart for Python server

Each chart includes:
- Configurable deployment with replicas, resources, and security contexts
- Service configuration (ClusterIP, NodePort, LoadBalancer)
- Optional Ingress with TLS support
- Optional Horizontal Pod Autoscaler (HPA)
- Customizable health probes
- NOTES with post-installation instructions

Installing with Helm

Install Go Server:```bash

Install with default values (uses local image)

helm install mcp-go ./helm/mcp-server-go

Install with custom values

helm install mcp-go ./helm/mcp-server-go \
--set image.repository=${REGISTRY_USER}/mcp-server-demo-go \
--set image.tag=${VERSION} \
--set replicaCount=3

Install with Ingress enabled

helm install mcp-go ./helm/mcp-server-go \
--set ingress.enabled=true \
--set ingress.hosts[0].host=mcp-go.example.com \
--set ingress.hosts[0].paths[0].path=/ \
--set ingress.hosts[0].paths[0].pathType=Prefix

Install with autoscaling enabled

helm install mcp-go ./helm/mcp-server-go \
--set autoscaling.enabled=true \
--set autoscaling.minReplicas=2 \
--set autoscaling.maxReplicas=10 \
--set autoscaling.targetCPUUtilizationPercentage=70


**Install Python Server:**```bash
# Install with default values (uses local image)
helm install mcp-python ./helm/mcp-server-python

# Install with custom values
helm install mcp-python ./helm/mcp-server-python \
  --set image.repository=${REGISTRY_USER}/mcp-server-demo-python \
  --set image.tag=${VERSION} \
  --set replicaCount=3

# Install with Ingress enabled
helm install mcp-python ./helm/mcp-server-python \
  --set ingress.enabled=true \
  --set ingress.hosts[0].host=mcp-python.example.com \
  --set ingress.hosts[0].paths[0].path=/ \
  --set ingress.hosts[0].paths[0].pathType=Prefix

Install to a specific namespace:```bash

Create namespace

kubectl create namespace mcp-servers

Install both servers to the namespace

helm install mcp-go ./helm/mcp-server-go -n mcp-servers
helm install mcp-python ./helm/mcp-server-python -n mcp-servers


#### Using a Custom Values File

Create a custom values file to override defaults:

**custom-values-go.yaml:**```yaml
replicaCount: 3

image:
  repository: ${REGISTRY_USER}/mcp-server-demo-go
  tag: &quot;v1.0.3&quot;
  pullPolicy: Always

resources:
  limits:
    cpu: 1000m
    memory: 256Mi
  requests:
    cpu: 200m
    memory: 128Mi

ingress:
  enabled: true
  className: nginx
  hosts:
    - host: mcp-go.example.com
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: mcp-go-tls
      hosts:
        - mcp-go.example.com

autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 10
  targetCPUUtilizationPercentage: 70

Install with custom values:```bash
helm install mcp-go ./helm/mcp-server-go -f custom-values-go.yaml


#### Managing Helm Releases

**List installed releases:**```bash
helm list
helm list -n mcp-servers  # In specific namespace

Get release status:```bash
helm status mcp-go
helm status mcp-python


**Upgrade a release:**```bash
# Upgrade with new image version
helm upgrade mcp-go ./helm/mcp-server-go \
  --set image.tag=v1.1.0

# Upgrade with custom values file
helm upgrade mcp-go ./helm/mcp-server-go -f custom-values-go.yaml

# Upgrade with reuse of previous values
helm upgrade mcp-go ./helm/mcp-server-go --reuse-values --set replicaCount=5

Rollback a release:```bash

Rollback to previous revision

helm rollback mcp-go

Rollback to specific revision

helm rollback mcp-go 2

View rollback history

helm history mcp-go


**Uninstall a release:**```bash
helm uninstall mcp-go
helm uninstall mcp-python

# Uninstall from specific namespace
helm uninstall mcp-go -n mcp-servers

Testing Helm Deployments

Dry run (validate without installing):```bash
helm install mcp-go ./helm/mcp-server-go --dry-run --debug


**Template rendering (see generated manifests):**```bash
helm template mcp-go ./helm/mcp-server-go
helm template mcp-go ./helm/mcp-server-go -f custom-values-go.yaml

Lint chart (check for issues):```bash
helm lint ./helm/mcp-server-go
helm lint ./helm/mcp-server-python


**Test the deployed application:**```bash
# Port forward to access the service
kubectl port-forward svc/mcp-go-mcp-server-go 8080:8080

# In another terminal, test with the test client
cd go-server
./testclient -i -url http://localhost:8080/mcp

Packaging and Distributing Helm Charts

Package charts:```bash

Package individual charts

helm package ./helm/mcp-server-go
helm package ./helm/mcp-server-python

This creates mcp-server-go-1.0.0.tgz and mcp-server-python-1.0.0.tgz


**Install from packaged chart:**```bash
helm install mcp-go mcp-server-go-1.0.0.tgz

Create Helm repository index:```bash

Create index file for multiple charts

helm repo index . --url https://example.com/charts

This generates index.yaml for hosting as a chart repository


#### Common Helm Values Configurations

**For Production Environments:**```yaml
# Production configuration example
replicaCount: 3

image:
  repository: your-registry.io/mcp-server-demo-go
  tag: &quot;v1.1.0&quot;
  pullPolicy: Always

imagePullSecrets:
  - name: registry-secret

resources:
  limits:
    cpu: 1000m
    memory: 256Mi
  requests:
    cpu: 200m
    memory: 128Mi

autoscaling:
  enabled: true

…(正文过长,页面只展示前面部分,完整内容见仓库)

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
MCP Demo Server F12b6e78 怎么安装?

在客户端按下面的安装命令接入:pip install -r requirements.txt。装完在客户端配置里引用同一个包或端点。

MCP Demo Server F12b6e78 怎么在客户端里配置?

它的传输方式未标注,在客户端 MCP 配置里按官方文档填写启动命令和参数,保存后重启客户端生效。

MCP Demo Server F12b6e78 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

MCP Demo Server F12b6e78 需要 API Key 吗?

资料标注需要会话登录认证,使用前准备好对应凭据,并按最小权限配置。

MCP Demo Server F12b6e78 能提供哪些能力?

资料显示约 3 个工具;能力标签包括 服务器实现、Go语言、Python。具体工具清单以官方文档为准。

MCP Demo Server F12b6e78 需要什么运行环境?

属于本地进程,需要在本机装好运行环境。

MCP Demo Server F12b6e78 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。