원클릭으로
protocol-golden-testing
Pattern for testing MCP protocol compatibility using golden JSON snapshots
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Pattern for testing MCP protocol compatibility using golden JSON snapshots
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | protocol-golden-testing |
| description | Pattern for testing MCP protocol compatibility using golden JSON snapshots |
| domain | testing |
| confidence | high |
| source | manual — designed during protocol compatibility test architecture session |
When building an MCP server that must remain compatible with a reference implementation (VS Code Copilot Chat), protocol drift is the primary risk. The reference implementation updates independently and isn't available in CI. This skill covers how to test protocol compatibility without the reference running.
Store reference JSON responses as snapshot files. Compare using structural superset checks:
This avoids brittle value comparisons while catching structural regressions.
Test the full protocol exchange over real named pipes with mocked backend services:
McpPipeServer with mocked IVsServiceRpcNamedPipeClientStream as Copilot CLI wouldinitialize, tools/list, tool calls)Add an internal constructor to RpcClient accepting a pre-configured IVsServiceRpc. Since the test project already has [InternalsVisibleTo], this enables mocked integration tests without a real VS pipe connection.
Snapshots/ directorySnapshots/VERSION tracks the VS Code extension version they were captured from// Structural superset check (pseudo-code)
void AssertSchemaMatch(JsonElement actual, JsonElement golden)
{
foreach (var prop in golden.EnumerateObject())
{
Assert.True(actual.TryGetProperty(prop.Name, out var actualProp));
Assert.Equal(prop.Value.ValueKind, actualProp.ValueKind);
if (prop.Value.ValueKind == JsonValueKind.Object)
AssertSchemaMatch(actualProp, prop.Value); // recurse
}
}