dse120071750/m8m-harness-builder / skills/m8m/m8m-mcp-connection-builder
m8m-mcp-connection-builder
VerifiedAuthor reusable MCP connection context and usage guides locally, then deliver an authorized installation to the configured M8M tenant's persistent server installer. Use for new connections or explicit version changes.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 2.5 KB |
| agents/openai.yaml | config | 263 B |
| references/server-delivery.md | markdown | 6.9 KB |
| scripts/m8m_delivery_common.py | script | 3.8 KB |
| scripts/m8m_deploy.py | script | 5.6 KB |
| scripts/m8m_local_bundle.py | script | 4.5 KB |
scripts/m8m_delivery_common.py
View on GitHub"""Portable local delivery helpers; no platform checkout or third-party imports."""
from __future__ import annotations
import hashlib
import json
import os
from pathlib import Path, PurePosixPath
import tempfile
MAX_FILES = 10000
MAX_BYTES = 512 * 1024 * 1024
MAX_FILE_BYTES = 64 * 1024 * 1024
SKIP_DIRECTORIES = {".git", ".hg", ".svn", ".codex", ".ssh", "__pycache__", ".pytest_cache", "node_modules"}
def sha256(data: bytes) -> str:
return "sha256:" + hashlib.sha256(data).hexdigest()
def encoded(value) -> bytes:
return json.dumps(value, sort_keys=True, separators=(",", ":"),
ensure_ascii=False, allow_nan=False).encode("utf-8")
def relative(value: str) -> str:
if (not isinstance(value, str) or not value or "\\" in value or ":" in value
or "\x00" in value or len(value) > 512):
raise ValueError("Use a relative POSIX file path.")
path = PurePosixPath(value)
if path.is_absolute() or any(p in {"", ".", ".."} for p in value.split("/")):
raise ValueError("A file path escapes or aliases its intake.")
return path.as_posix()
def no_links(path: Path):
for item in (path, *path.parents):
if item.is_symlink() or getattr(item, "is_junction", lambda: False)():
raise ValueError("Delivery paths must not contain links.")
def collect(root):
"""Collect selected context with the server's transport limits and path rules."""
root = Path(root).absolute()
no_links(root)
if not root.exists():
raise ValueError("The selected intake does not exist.")
paths = []
if root.is_dir():
for directory, dirs, names in os.walk(root, followlinks=False):
for name in dirs:
no_links(Path(directory) / name)
dirs[:] = sorted(d for d in dirs if d not in SKIP_DIRECTORIES)
paths.extend(Path(directory) / name for name in sorted(names))
else:
paths = [root]
files, total = {}, 0
for path in sorted(paths):
no_links(path)
if path.name in SKIP_DIRECTORIES:
continue
if not path.is_file():
continue
if (path.name.startswith(".env") or path.name in {"auth.json", "credentials.json"}
or path.suffix.lower() in {".pem", ".key", ".sqlite3"}):
raise ValueError("Choose credential-free source/runtime context for delivery.")
size = path.stat().st_size
total += size
if len(files) >= MAX_FILES or size > MAX_FILE_BYTES or total > MAX_BYTES:
raise ValueError("Intake exceeds the server transport bound.")
name = path.relative_to(root).as_posix() if root.is_dir() else path.name
files[relative(name)] = path.read_bytes()
if not files:
raise ValueError("Select at least one reusable intake file.")
return files
def transfer_digest(files):
return sha256(encoded([{"path": name, "bytes": len(data), "digest": sha256(data)}
for name, data in sorted(files.items())]))
def immutable(path: Path, data: bytes):
"""Publish atomically without replacement, including Windows drives without hardlinks."""
no_links(path)
path.parent.mkdir(parents=True, exist_ok=True)
with tempfile.NamedTemporaryFile(dir=path.parent, delete=False) as handle:
temporary = Path(handle.name)
handle.write(data)
handle.flush()
os.fsync(handle.fileno())
try:
try:
if os.name == "nt":
os.rename(temporary, path) # Windows rename refuses an existing destination.
else:
os.link(temporary, path)
except FileExistsError:
if path.read_bytes() != data:
raise ValueError("The existing export has different bytes; choose a new output path.")
finally:
temporary.unlink(missing_ok=True)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |