cloudbro-draupnir/mcp-sesrver
If you are the rightful owner of mcp-sesrver and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Draupnir MCP Server is a static MCP server designed for Cilium-based Zero Trust configurations, offering tools and prompts for Cilium Network Policy management.
Draupnir MCP Server (Cilium ZeroโTrust edition)
๋ชฉํ: Cilium ๊ธฐ๋ฐ Zero Trust ๋ ํผ๋ฐ์ค(์: Draupnir)์ ๊ตฌ์ฑ์ ๋ค๋ฃจ๋ ์ ์ MCP ์๋ฒ. data/
ํด๋์ YAML/MD/์ฝ๋๋ค์ ๋ฆฌ์์ค๋ก ๋
ธ์ถํ๊ณ , Cilium ๋คํธ์ํฌ ์ ์ฑ
(CNP/CCNP)์ ์ํ ๊ฒ์ฆ/ํ
ํ๋ฆฟ/์ฒดํฌ๋ฆฌ์คํธ/ํ๋ธ ํํฐ ์์ฑ ํด๊ณผ ํ๋กฌํํธ๋ฅผ ์ ๊ณต.
Quick start (uv)
uv python install 3.12
uv sync
# ์ํ ๋ฐ์ดํฐ
mkdir -p data && echo "apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: allow-dns
spec:
endpointSelector: {}
egress:
- toEndpoints:
- matchLabels: {k8s:io.kubernetes.pod.namespace: kube-system}
toPorts:
- ports: [{ port: \"53\", protocol: UDP }]
" > data/allow-dns.yaml
# stdio ์คํ
uv run draupnir-mcp-server
Draupnir ๋ฆฌํฌ์งํ ๋ฆฌ ๊ฐ์ ธ์ค๊ธฐ
๋ ๊ฐ์ง ๋ฐฉ์์ ์ง์ํฉ๋๋ค.
A) ZIP ๊ธฐ๋ฐ (๊ถ์ฅ: ๋น ๋ฅด๊ฒ ์๋ํ ๋)
# ZIP ์ง์ (์: /mnt/data/draupnir-main.zip)
make import ZIP=/absolute/path/to/draupnir.zip
# ๋๋
uv run cnp-ingest --zip /absolute/path/to/draupnir.zip --dest data
B) Git submodule ๊ธฐ๋ฐ (๊ถ์ฅ: ์ ์คํธ๋ฆผ์ ์ง์ ์ถ์ ํ ๋)
# ํ๋ก์ ํธ ๋ฃจํธ์์
make submodule-add SUBMODULE_URL=https://github.com/cloudbro-draupnir/draupnir.git SUBMODULE_PATH=vendor/draupnir
# ์ต์ ๋ฐ์
make submodule-update SUBMODULE_PATH=vendor/draupnir
# ์ ์ฑ
/์ํ์ data/์ ๋๊ธฐํํ๊ณ ์ถ๋ค๋ฉด (ํ์ ์ rsync ๋ฑ ํ์ฒ๋ฆฌ ์ถ๊ฐ)
# rsync -av vendor/draupnir/policies/ data/policies/
ZIP์ ๊ฐํธํจ, ์๋ธ๋ชจ๋์ ์ฅ๊ธฐ ์ ์ง/๋๊ธฐํ์ ์ ๋ฆฌํฉ๋๋ค. ๋ ๋ฐฉ๋ฒ์ ํผ์ฉํด๋ ๋ฌด๋ฐฉํฉ๋๋ค.
MCP ํด๋ผ์ด์ธํธ ์ค์ ์์ (Claude Desktop)
~/Library/Application Support/Claude/mcp.json
:
{
"mcpServers": {
"draupnir-mcp-server": {
"command": "uv",
"args": ["run", "draupnir-mcp-server"],
"env": { "STATIC_MCP_DATA_DIR": "${HOME}/path/to/project/data" }
}
}
}
์ ๊ณต ๊ธฐ๋ฅ
- Resources:
data/
์ ํ์ผ๋ค์file://
URI๋ก ๋ ธ์ถ - Tools
list_files(pattern)
read_text(path)
/search_text(query, glob)
healthcheck()
list_cilium_policies(glob)
โ CNP/CCNP๋ง ํํฐ๋งvalidate_cilium_policy(path)
โ ํ์ ํ๋/์์ ์ฑ ๊ฒฝ๊ณgenerate_policy_template(app, namespace, ...)
โ ZeroโTrust ํ ํ๋ฆฟhubble_filters(src, dst, verdict)
โ ํ๋ธ ๊ด์ธก ์ค๋ํซzero_trust_checklist(glob)
โ ZT posture ์์ฝ
- Prompts
hardening-review
โ ํ๋๋ ๋ฆฌ๋ทฐ ๊ฐ์ด๋write-cilium-policy
โ ์ ๊ท ์๋น์ค ์ ์ฑ ํ ํ๋ฆฟ
๋์๋ณด๋/๊ฐ์ด๋ ์ฐธ๊ณ
- Grafana: Cilium Policy Verdicts (ID 18015)
- Isovalent Labs: Cilium ZeroโTrust Visibility
HTTP/SSE ๋ชจ๋ (์ต์ )
uv run draupnir-mcp-server --http 0.0.0.0:8765
Streamlit UI (์ต์ )
make setup # ensure deps
make ui # launches Streamlit at http://localhost:8501
ํ๊ฒฝ ๋ณ์ STATIC_MCP_DATA_DIR
๋ฅผ UI ์ฌ์ด๋๋ฐ์์ ์ค์ /๋ก๋ํ ์ ์์ต๋๋ค.
Makefile
์๋ํ ํ๊น ํฌํจ: setup
, run
, run-http
, lint
, import
, submodule-add
, submodule-update
, sample
, client-config
, package
, clean
Kubernetes ํตํฉ
.kube/config
๊ฐ ์ด๋ฏธ ์ค์ ๋์ด ์๊ณ , kubectl config use-context <CTX>
๋ก ์ปจํ
์คํธ๋ฅผ ์ ํํ๋ค๊ณ ๊ฐ์ ํฉ๋๋ค.
MCP ํด
k8s_context()
: ํ์ฌ ์ปจํ ์คํธ ํ์ธk8s_cluster_info()
:kubectl cluster-info
+kubectl get nodes -o wide
k8s_service_accounts(all_namespaces=True)
:kubectl get sa -A -o json
์์ฝ
Make ํ๊น (kubectl ์ ์ )
make kctx CONTEXT=gke_reflecting-surf-472800-e7_asia-northeast2-a_cluster2 # ์ปจํ
์คํธ ์ ํ
make kinfo # cluster-info + nodes
make ksa # SA ์์ฝ (์ ๋ค์์คํ์ด์ค)
# (์ต์
) Hubble CLI๊ฐ ์ค์น๋์ด ์๋ค๋ฉด
make kverdicts VERDICT=DROPPED DURATION=30s # ์ต๊ทผ verdict ๊ด์ธก
Developer Examples
Quick dev usage (direct import):
export STATIC_MCP_DATA_DIR=data
python - <<'PY'
from draupnir_mcp_server import server
print(server.list_files("**/*.yaml")[:3])
print(server.validate_cilium_policy("allow-dns.yaml")["warnings"])
PY
Template test example (pytest):
def test_my_tool(tmp_path, monkeypatch):
import os, importlib
os.environ["STATIC_MCP_DATA_DIR"] = str(tmp_path / "data")
(tmp_path / "data").mkdir(parents=True, exist_ok=True)
server = importlib.reload(importlib.import_module("draupnir_mcp_server.server"))
# result = server.my_tool(...)
# assert result == expected
Contributing
- Contributor guide: see
AGENTS.md
for project structure, commands, style, and examples. - Examples: see โMCP Tools & Examplesโ and โTesting Guidelinesโ sections in
AGENTS.md
.