mcp-server-diff 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/.github/dependabot.yml +21 -0
  2. package/.github/workflows/ci.yml +51 -0
  3. package/.github/workflows/publish.yml +36 -0
  4. package/.github/workflows/release.yml +51 -0
  5. package/.prettierignore +3 -0
  6. package/.prettierrc +8 -0
  7. package/CONTRIBUTING.md +81 -0
  8. package/LICENSE +21 -0
  9. package/README.md +526 -0
  10. package/action.yml +250 -0
  11. package/dist/__tests__/fixtures/http-server.d.ts +7 -0
  12. package/dist/__tests__/fixtures/stdio-server.d.ts +7 -0
  13. package/dist/cli/__tests__/fixtures/http-server.d.ts +7 -0
  14. package/dist/cli/__tests__/fixtures/stdio-server.d.ts +7 -0
  15. package/dist/cli/cli.d.ts +7 -0
  16. package/dist/cli/diff.d.ts +44 -0
  17. package/dist/cli/git.d.ts +37 -0
  18. package/dist/cli/index.d.ts +7 -0
  19. package/dist/cli/index.js +57182 -0
  20. package/dist/cli/licenses.txt +466 -0
  21. package/dist/cli/logger.d.ts +46 -0
  22. package/dist/cli/package.json +3 -0
  23. package/dist/cli/probe.d.ts +35 -0
  24. package/dist/cli/reporter.d.ts +20 -0
  25. package/dist/cli/runner.d.ts +30 -0
  26. package/dist/cli/types.d.ts +134 -0
  27. package/dist/cli.d.ts +7 -0
  28. package/dist/diff.d.ts +44 -0
  29. package/dist/git.d.ts +37 -0
  30. package/dist/index.d.ts +7 -0
  31. package/dist/index.js +58032 -0
  32. package/dist/licenses.txt +466 -0
  33. package/dist/logger.d.ts +46 -0
  34. package/dist/package.json +3 -0
  35. package/dist/probe.d.ts +35 -0
  36. package/dist/reporter.d.ts +20 -0
  37. package/dist/runner.d.ts +30 -0
  38. package/dist/types.d.ts +134 -0
  39. package/eslint.config.mjs +47 -0
  40. package/jest.config.mjs +26 -0
  41. package/package.json +64 -0
  42. package/src/__tests__/fixtures/http-server.ts +103 -0
  43. package/src/__tests__/fixtures/stdio-server.ts +158 -0
  44. package/src/__tests__/integration.test.ts +306 -0
  45. package/src/__tests__/runner.test.ts +430 -0
  46. package/src/cli.ts +421 -0
  47. package/src/diff.ts +252 -0
  48. package/src/git.ts +262 -0
  49. package/src/index.ts +284 -0
  50. package/src/logger.ts +93 -0
  51. package/src/probe.ts +327 -0
  52. package/src/reporter.ts +214 -0
  53. package/src/runner.ts +902 -0
  54. package/src/types.ts +155 -0
  55. package/tsconfig.json +30 -0
package/src/types.ts ADDED
@@ -0,0 +1,155 @@
1
+ /**
2
+ * Type definitions for MCP Conformance Action
3
+ */
4
+
5
+ export interface TestConfiguration {
6
+ name: string;
7
+ transport: "stdio" | "streamable-http";
8
+ start_command?: string;
9
+ args?: string;
10
+ server_url?: string;
11
+ headers?: Record<string, string>;
12
+ env_vars?: string;
13
+ custom_messages?: CustomMessage[];
14
+ /** Command to run before starting the MCP server for this config */
15
+ pre_test_command?: string;
16
+ /** Milliseconds to wait after pre_test_command before starting the server */
17
+ pre_test_wait_ms?: number;
18
+ /** Milliseconds to wait for HTTP server to start (when using start_command with HTTP transport) */
19
+ startup_wait_ms?: number;
20
+ /** Command to run after stopping the MCP server for this config (cleanup) */
21
+ post_test_command?: string;
22
+ }
23
+
24
+ export interface CustomMessage {
25
+ id: number;
26
+ name: string;
27
+ message: Record<string, unknown>;
28
+ }
29
+
30
+ export interface ActionInputs {
31
+ // Language setup
32
+ setupNode: boolean;
33
+ nodeVersion: string;
34
+ setupPython: boolean;
35
+ pythonVersion: string;
36
+ setupGo: boolean;
37
+ goVersion: string;
38
+ setupRust: boolean;
39
+ rustToolchain: string;
40
+ setupDotnet: boolean;
41
+ dotnetVersion: string;
42
+
43
+ // Build configuration
44
+ installCommand: string;
45
+ buildCommand: string;
46
+ startCommand: string;
47
+
48
+ // Transport configuration
49
+ transport: "stdio" | "streamable-http";
50
+ serverUrl: string;
51
+ headers: Record<string, string>;
52
+ configurations: TestConfiguration[];
53
+ customMessages: CustomMessage[];
54
+
55
+ // Test configuration
56
+ compareRef: string;
57
+ failOnError: boolean;
58
+ failOnDiff: boolean;
59
+ envVars: string;
60
+ serverTimeout: number;
61
+
62
+ // Shared HTTP server configuration
63
+ httpStartCommand: string;
64
+ httpStartupWaitMs: number;
65
+ }
66
+
67
+ export interface ProbeResult {
68
+ initialize: InitializeInfo | null;
69
+ tools: ToolsResult | null;
70
+ prompts: PromptsResult | null;
71
+ resources: ResourcesResult | null;
72
+ resourceTemplates: ResourceTemplatesResult | null;
73
+ customResponses: Map<string, unknown>;
74
+ error?: string;
75
+ }
76
+
77
+ export interface InitializeInfo {
78
+ serverInfo?: {
79
+ name: string;
80
+ version: string;
81
+ };
82
+ capabilities?: Record<string, unknown>;
83
+ }
84
+
85
+ export interface ToolsResult {
86
+ tools: Array<{
87
+ name: string;
88
+ description?: string;
89
+ inputSchema?: Record<string, unknown>;
90
+ }>;
91
+ }
92
+
93
+ export interface PromptsResult {
94
+ prompts: Array<{
95
+ name: string;
96
+ description?: string;
97
+ arguments?: Array<{
98
+ name: string;
99
+ description?: string;
100
+ required?: boolean;
101
+ }>;
102
+ }>;
103
+ }
104
+
105
+ export interface ResourcesResult {
106
+ resources: Array<{
107
+ uri: string;
108
+ name: string;
109
+ description?: string;
110
+ mimeType?: string;
111
+ }>;
112
+ }
113
+
114
+ export interface ResourceTemplatesResult {
115
+ resourceTemplates: Array<{
116
+ uriTemplate: string;
117
+ name: string;
118
+ description?: string;
119
+ mimeType?: string;
120
+ }>;
121
+ }
122
+
123
+ /** Counts of MCP primitives discovered */
124
+ export interface PrimitiveCounts {
125
+ tools: number;
126
+ prompts: number;
127
+ resources: number;
128
+ resourceTemplates: number;
129
+ }
130
+
131
+ export interface TestResult {
132
+ configName: string;
133
+ transport: string;
134
+ branchTime: number;
135
+ baseTime: number;
136
+ hasDifferences: boolean;
137
+ diffs: Map<string, string>;
138
+ /** Primitive counts from current branch */
139
+ branchCounts?: PrimitiveCounts;
140
+ /** Primitive counts from base ref */
141
+ baseCounts?: PrimitiveCounts;
142
+ /** Error message if probing failed */
143
+ error?: string;
144
+ }
145
+
146
+ export interface ConformanceReport {
147
+ generatedAt: string;
148
+ currentBranch: string;
149
+ compareRef: string;
150
+ results: TestResult[];
151
+ totalBranchTime: number;
152
+ totalBaseTime: number;
153
+ passedCount: number;
154
+ diffCount: number;
155
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "lib": ["ES2022"],
7
+ "declaration": true,
8
+ "strict": true,
9
+ "noImplicitAny": true,
10
+ "strictNullChecks": true,
11
+ "noImplicitThis": true,
12
+ "alwaysStrict": true,
13
+ "noUnusedLocals": false,
14
+ "noUnusedParameters": false,
15
+ "noImplicitReturns": true,
16
+ "noFallthroughCasesInSwitch": false,
17
+ "inlineSourceMap": false,
18
+ "inlineSources": false,
19
+ "experimentalDecorators": true,
20
+ "strictPropertyInitialization": false,
21
+ "outDir": "./lib",
22
+ "rootDir": "./src",
23
+ "esModuleInterop": true,
24
+ "skipLibCheck": true,
25
+ "forceConsistentCasingInFileNames": true,
26
+ "resolveJsonModule": true
27
+ },
28
+ "include": ["src/**/*"],
29
+ "exclude": ["node_modules", "dist", "lib", "**/*.test.ts"]
30
+ }