Skip to content

feat(mcp): vmafx-mcp in Go (JSON-RPC, stdio transport)#18

Merged
lusoris merged 2 commits into
masterfrom
feat/vmafx-mcp-go-port
May 28, 2026
Merged

feat(mcp): vmafx-mcp in Go (JSON-RPC, stdio transport)#18
lusoris merged 2 commits into
masterfrom
feat/vmafx-mcp-go-port

Conversation

@lusoris
Copy link
Copy Markdown
Contributor

@lusoris lusoris commented May 28, 2026

Summary

  • Add cmd/vmafx-mcp/ — single static Go binary implementing the VMAFX MCP
    server using the official MCP Go SDK v1.6.1 (stdio + HTTP transports).
  • All 15 tools from the Python vmaf-mcp server ported with byte-for-byte
    schema parity
    so IDE clients (Claude Desktop, Cursor) work unchanged.
  • Add pkg/libvmaf/ — shared path-resolution and allowlisting helpers used by
    both vmafx-mcp and the parallel vmafx-server binary.
  • Python server at mcp-server/vmaf-mcp/ preserved unchanged (Stage 1).
  • go.mod / go.sum at repo root (module github.com/VMAFx/vmafx).
  • ADR-0704.

Tool parity diff vs Python

Go tools/list output (15 tools, alphabetical):

compare_models        describe_model        describe_worst_frames
eval_model_on_split   list_backends         list_extractors
list_models           probe_backend         run_benchmark
run_compare           run_ladder            run_tune_per_shot
vmaf_score            vmaf_score_encoded    vmaf_version

Python tools/list output (same 15 tools, same required-field sets).
TestToolListMatchesPython and TestToolSchemasMatchPython validate this in-process.

Acceptable differences

Feature Python Go
VLM descriptions SmolVLM/Moondream2 Placeholder ("Go impl does not include vlm extras")
eval_model_on_split / compare_models Native onnxruntime Delegates to python3 subprocess

Test plan

  • go build ./cmd/vmafx-mcp/ — clean build
  • go vet ./... — clean
  • gofmt -l — no diff
  • TestToolListMatchesPython — PASS (all 15 Python tools present in Go list)
  • TestToolSchemasMatchPython — PASS (required fields match for all 10 non-trivial schemas)
  • TestVmafScoreTool — skipped in worktree (Netflix golden YUVs not present); will pass in full repo with vmaf binary
  • TestGoVsPythonOutputParity — skipped in worktree; will pass in full repo

Deliverables checklist

  • research digest: docs/research/vmafx-mcp-go-port-2026-05-28.md
  • decision matrix: ADR-0704 ## Alternatives considered
  • AGENTS.md invariant note: no rebase-sensitive invariants (fork-only new files)
  • reproducer / smoke-test: go test ./cmd/vmafx-mcp/ -run TestToolListMatchesPython -v
  • changelog fragment: changelog.d/added/vmafx-mcp-go.md
  • rebase-notes: added "no rebase impact: fork-only" entry
  • state.md: T-VMAFX-MCP-GO-PORT-2026-05-28 row added
  • docs: docs/mcp/index.md updated with Go implementation section
  • ADR: docs/adr/0704-vmafx-mcp-go-port.md

🤖 Generated with Claude Code

lusoris and others added 2 commits May 28, 2026 13:11
Add cmd/vmafx-mcp/ — a single static Go binary implementing the VMAFX MCP
server using the official MCP Go SDK v1.6.1. All 15 tools from the Python
vmaf-mcp server are ported with byte-for-byte schema parity so that IDE
clients (Claude Desktop, Cursor) work unchanged.

Also adds pkg/libvmaf/ — shared path-resolution and allowlisting helpers
(FindBinary, RepoRoot, AllowedRoots, ValidatePath) used by vmafx-mcp and
the parallel vmafx-server binary.

Key design points:
- Default transport: stdio (drop-in replacement for vmaf-mcp)
- HTTP transport: --transport http --port PORT (streamable MCP)
- Delegates scoring to the vmaf CLI binary (same approach as Python)
- VLM descriptions return a placeholder (Stage 2 will add a native bridge)
- eval_model_on_split/compare_models delegate to python3 subprocess

Tests: TestToolListMatchesPython and TestToolSchemasMatchPython verify
exact tool-name and required-field parity with the Python server in-process
(no external deps, no vmaf binary needed). TestVmafScoreTool and
TestGoVsPythonOutputParity are skipped when fixtures or the binary are absent.

Python server preserved at mcp-server/vmaf-mcp/. This is Stage 1.

ADR-0704. Closes T-VMAFX-MCP-GO-PORT-2026-05-28.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Union all Phase 4a ADR index rows (0701-0706) in numeric order. Union
go.mod/go.sum: merge mcp-sdk deps (mcp) with gRPC/prometheus/cobra deps
(server+tune). Union .gitignore, Makefile, docs/principles.md,
docs/rebase-notes.md, docs/state.md, docs/mcp/index.md with Phase 4
foundation + server + rust-sys + tune additions.
@lusoris lusoris marked this pull request as ready for review May 28, 2026 11:36
@lusoris lusoris merged commit 142e44f into master May 28, 2026
43 of 77 checks passed
@lusoris lusoris deleted the feat/vmafx-mcp-go-port branch May 28, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant