Owner decision (3 Oct 2026): where the AITURK CLI is available, TurkServis models are reached through it, not MCP. The backend no longer writes a `turkservis-media` MCP server into config.yaml on startup or when a member endpoint is saved. Existing entries, including disabled ones, are left exactly as they are. A bundled `aiturk-media` skill teaches the agent to list and run media with `aiturk media`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012wwqJMAuhMBMWvsvNLFGb9
53 lines
2.3 KiB
Python
53 lines
2.3 KiB
Python
"""AITURK IDE produces media through the AITURK CLI, never by adding an MCP server."""
|
|
import importlib.util
|
|
from pathlib import Path
|
|
|
|
import yaml
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
SKILL = ROOT / "skills" / "media" / "aiturk-media" / "SKILL.md"
|
|
|
|
|
|
def test_backend_never_registers_a_turkservis_media_mcp_server():
|
|
assert importlib.util.find_spec("hermes_cli.aiturk_media") is None
|
|
source = (ROOT / "hermes_cli" / "web_server.py").read_text(encoding="utf-8")
|
|
for needle in ("aiturk_media", "turkservis-media", "generate_media", "ai.turkservis.online/mcp"):
|
|
assert needle not in source
|
|
|
|
|
|
def test_no_backend_module_writes_the_turkservis_mcp_endpoint_into_config():
|
|
offenders = [
|
|
path.relative_to(ROOT).as_posix()
|
|
for package in ("hermes_cli", "agent", "tools", "gateway", "tui_gateway")
|
|
for path in (ROOT / package).rglob("*.py")
|
|
if "ai.turkservis.online/mcp" in path.read_text(encoding="utf-8", errors="ignore")
|
|
]
|
|
assert offenders == []
|
|
|
|
|
|
def test_existing_user_mcp_entries_are_left_exactly_as_they_are():
|
|
# Startup used to rewrite config.yaml; with the writer gone, a saved config
|
|
# round-trips untouched (including a disabled turkservis-media entry).
|
|
before = {
|
|
"providers": {"turkservis": {"base_url": "https://ai.turkservis.online/v1", "key_env": "MEMBER_KEY"}},
|
|
"mcp_servers": {
|
|
"turkservis-media": {"url": "https://ai.turkservis.online/mcp", "enabled": False},
|
|
"other": {"url": "https://example.org/mcp"},
|
|
},
|
|
}
|
|
source = (ROOT / "hermes_cli" / "web_server.py").read_text(encoding="utf-8")
|
|
lifespan = source[source.index("async def _lifespan("):]
|
|
lifespan = lifespan[:lifespan.index("yield")]
|
|
assert "save_config" not in lifespan and "mcp_servers" not in lifespan
|
|
assert yaml.safe_load(yaml.safe_dump(before)) == before
|
|
|
|
|
|
def test_bundled_skill_teaches_aiturk_media():
|
|
text = SKILL.read_text(encoding="utf-8")
|
|
meta = yaml.safe_load(text.split("---")[1])
|
|
assert meta["name"] == "aiturk-media"
|
|
for phrase in ("aiturk media list --json", "aiturk media run image", "aiturk media run video",
|
|
"aiturk media run tts", "aiturk media run stt", "aiturk login"):
|
|
assert phrase in text
|
|
assert "Do not add or enable an MCP media server" in text
|