Principle:8beeeaaat Touchdesigner mcp Compatibility Gated HTTP Client
| Knowledge Sources | |
|---|---|
| Domains | HTTP_Client, Version_Compatibility |
| Last Updated | 2026-10-28 00:00 GMT |
Overview
A client-side gate that blocks every downstream API call until the remote server's version has been verified compatible, caching the verdict to avoid redundant re-checks.
Description
When a long-lived HTTP client talks to a versioned remote server, blindly forwarding requests to an incompatible server produces cryptic failures. The compatibility-gated HTTP client pattern interleaves a version check before every API call, but caches the result so the check cost is amortized: a successful check is cached for a longer TTL (minutes) while a failed check is cached for a shorter TTL (seconds) to allow retry without hammering the unreachable server. When the cache expires or is invalidated (e.g. an explicit info request), the client re-queries the server's version endpoint and classifies it via a semver-based policy engine. If the verdict is an error, the call is blocked and the cached error is re-thrown; if it's a warning, the call proceeds and a notice is appended to the tool result for the user.
Usage
Use this principle when an MCP server bridges to an external component (like a TouchDesigner .tox) whose API version evolves independently of the npm package version, and you need fail-fast protection against version drift without re-checking on every request.
Theoretical Basis
The gate is a cache-aside read-through pattern applied to version verification:
# Abstract algorithm (NOT real implementation)
def api_call(operation, params):
verify_compatibility() # may raise cached error
return handle_response(operation(params))
def verify_compatibility():
if has_valid_success_cache():
return
if has_cached_error() and not error_ttl_expired():
raise cached_error
result = check_version()
if result.success:
set_success_cache()
else:
set_error_cache()
raise result.error
Key design properties:
- Error cache TTL < success cache TTL: failed checks expire sooner, allowing retry recovery.
- Explicit invalidation: certain calls (e.g. getTdInfo) invalidate the cache to force a fresh check.
- Non-blocking warnings: a warning-level verdict still allows the call but surfaces a user-facing notice.