@zigrivers/surface-mcp 0.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.
- package/LICENSE +22 -0
- package/README.md +15 -0
- package/dist/index.d.ts +136 -0
- package/dist/index.js +1030 -0
- package/dist/index.js.map +1 -0
- package/package.json +59 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ken Allred
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Surface MCP
|
|
2
|
+
|
|
3
|
+
MCP server adapter for Surface audits.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @zigrivers/surface-mcp
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
See the repository README for usage and release guidance: https://github.com/zigrivers/surface#readme
|
|
12
|
+
|
|
13
|
+
## License
|
|
14
|
+
|
|
15
|
+
MIT.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { AlternativesReportData, Finding, TrackedFinding, Evidence, SurfaceComposition, Result, ValidationCheck, SurfaceCompositionOptions, SurfaceError } from '@zigrivers/surface-core';
|
|
2
|
+
import { Backlog, Capture, IssueExport, Target, GateResult } from '@zigrivers/surface-core/interfaces';
|
|
3
|
+
|
|
4
|
+
declare const SURFACE_MCP_SERVER_NAME = "surface";
|
|
5
|
+
declare const SURFACE_MCP_SERVER_VERSION = "1.0.0";
|
|
6
|
+
declare const SURFACE_MCP_TOOL_SCHEMA_VERSION = "1.0.0";
|
|
7
|
+
declare const TOOL_ORDER: readonly ["surface_capture", "surface_audit", "surface_explain", "surface_backlog", "surface_gate", "surface_validate", "surface_baseline", "surface_verdict", "surface_diff", "surface_alternatives", "surface_trace", "surface_run", "surface_next", "surface_status"];
|
|
8
|
+
type SurfaceMcpToolName = (typeof TOOL_ORDER)[number];
|
|
9
|
+
type JsonSchema = Record<string, unknown>;
|
|
10
|
+
type SurfaceMcpToolDefinition = {
|
|
11
|
+
readonly name: SurfaceMcpToolName;
|
|
12
|
+
readonly title: string;
|
|
13
|
+
readonly description: string;
|
|
14
|
+
readonly schemaVersion: string;
|
|
15
|
+
readonly inputSchema: JsonSchema;
|
|
16
|
+
};
|
|
17
|
+
type SurfaceMcpToolRegistry = {
|
|
18
|
+
readonly serverInfo: {
|
|
19
|
+
readonly name: typeof SURFACE_MCP_SERVER_NAME;
|
|
20
|
+
readonly version: typeof SURFACE_MCP_SERVER_VERSION;
|
|
21
|
+
};
|
|
22
|
+
listTools(): readonly SurfaceMcpToolDefinition[];
|
|
23
|
+
getTool(name: SurfaceMcpToolName): SurfaceMcpToolDefinition | undefined;
|
|
24
|
+
};
|
|
25
|
+
type SurfaceMcpServer = {
|
|
26
|
+
readonly composition: SurfaceComposition;
|
|
27
|
+
readonly registry: SurfaceMcpToolRegistry;
|
|
28
|
+
callTool<TName extends SurfaceMcpToolName>(name: TName, input: unknown): Promise<Result<SurfaceMcpToolOutputMap[TName]>>;
|
|
29
|
+
listTools(): readonly SurfaceMcpToolDefinition[];
|
|
30
|
+
};
|
|
31
|
+
type SurfaceMcpServerOptions = SurfaceCompositionOptions & {
|
|
32
|
+
readonly composition?: SurfaceComposition;
|
|
33
|
+
};
|
|
34
|
+
type McpToolSchemaCompatibilityInput = {
|
|
35
|
+
readonly current: Pick<SurfaceMcpToolDefinition, "inputSchema" | "name" | "schemaVersion">;
|
|
36
|
+
readonly next: Pick<SurfaceMcpToolDefinition, "inputSchema" | "name" | "schemaVersion">;
|
|
37
|
+
};
|
|
38
|
+
type SurfaceMcpAuditOutput = {
|
|
39
|
+
readonly runId: string;
|
|
40
|
+
readonly backlog: Backlog;
|
|
41
|
+
readonly capture: Capture;
|
|
42
|
+
readonly findings: readonly Finding[];
|
|
43
|
+
readonly skippedLenses: readonly {
|
|
44
|
+
readonly lensId: string;
|
|
45
|
+
readonly message: string;
|
|
46
|
+
readonly reason: string;
|
|
47
|
+
}[];
|
|
48
|
+
};
|
|
49
|
+
type SurfaceMcpExplainOutput = {
|
|
50
|
+
readonly finding: Finding;
|
|
51
|
+
readonly rationale: string;
|
|
52
|
+
readonly evidence: readonly Evidence[];
|
|
53
|
+
};
|
|
54
|
+
type SurfaceMcpStatusOutput = {
|
|
55
|
+
readonly currentStage: string;
|
|
56
|
+
readonly progress: {
|
|
57
|
+
readonly completedRuns: number;
|
|
58
|
+
readonly failedRuns: number;
|
|
59
|
+
readonly findings: number;
|
|
60
|
+
};
|
|
61
|
+
readonly runHistory: readonly {
|
|
62
|
+
readonly runId: string;
|
|
63
|
+
readonly status: "completed" | "failed";
|
|
64
|
+
readonly target?: Target;
|
|
65
|
+
readonly findings: number;
|
|
66
|
+
}[];
|
|
67
|
+
};
|
|
68
|
+
type SurfaceMcpValidationOutput = {
|
|
69
|
+
readonly checks: readonly {
|
|
70
|
+
readonly id: string;
|
|
71
|
+
readonly findingId?: string;
|
|
72
|
+
readonly passed: boolean;
|
|
73
|
+
readonly validation: ValidationCheck;
|
|
74
|
+
}[];
|
|
75
|
+
};
|
|
76
|
+
type SurfaceMcpBaselineOutput = {
|
|
77
|
+
readonly baselineId: string;
|
|
78
|
+
readonly count: number;
|
|
79
|
+
readonly reason?: string;
|
|
80
|
+
};
|
|
81
|
+
type SurfaceMcpVerdictOutput = {
|
|
82
|
+
readonly findingId: string;
|
|
83
|
+
readonly decision: "accept" | "reject" | "correct" | "defer";
|
|
84
|
+
readonly rationale: string;
|
|
85
|
+
};
|
|
86
|
+
type SurfaceMcpDiffOutput = {
|
|
87
|
+
readonly resolved: readonly SurfaceMcpDiffEntry[];
|
|
88
|
+
readonly regressed: readonly SurfaceMcpDiffEntry[];
|
|
89
|
+
readonly introduced: readonly SurfaceMcpDiffEntry[];
|
|
90
|
+
readonly stillFailing: readonly SurfaceMcpDiffEntry[];
|
|
91
|
+
readonly identityBroken: readonly SurfaceMcpDiffEntry[];
|
|
92
|
+
};
|
|
93
|
+
type SurfaceMcpDiffEntry = {
|
|
94
|
+
readonly findingId?: string;
|
|
95
|
+
readonly identityKey: string;
|
|
96
|
+
readonly status: TrackedFinding["status"];
|
|
97
|
+
};
|
|
98
|
+
type SurfaceMcpTraceOutput = {
|
|
99
|
+
readonly trackedFinding: TrackedFinding;
|
|
100
|
+
};
|
|
101
|
+
type SurfaceMcpAlternativesOutput = {
|
|
102
|
+
readonly alternatives: AlternativesReportData;
|
|
103
|
+
};
|
|
104
|
+
type SurfaceMcpRunOutput = {
|
|
105
|
+
readonly runId: string;
|
|
106
|
+
readonly stage: string;
|
|
107
|
+
readonly status: "completed";
|
|
108
|
+
};
|
|
109
|
+
type SurfaceMcpNextOutput = {
|
|
110
|
+
readonly eligible: readonly string[];
|
|
111
|
+
};
|
|
112
|
+
type SurfaceMcpToolOutputMap = {
|
|
113
|
+
readonly surface_capture: Capture;
|
|
114
|
+
readonly surface_audit: SurfaceMcpAuditOutput;
|
|
115
|
+
readonly surface_explain: SurfaceMcpExplainOutput;
|
|
116
|
+
readonly surface_backlog: Backlog | IssueExport;
|
|
117
|
+
readonly surface_status: SurfaceMcpStatusOutput;
|
|
118
|
+
readonly surface_gate: GateResult;
|
|
119
|
+
readonly surface_validate: SurfaceMcpValidationOutput;
|
|
120
|
+
readonly surface_baseline: SurfaceMcpBaselineOutput;
|
|
121
|
+
readonly surface_verdict: SurfaceMcpVerdictOutput;
|
|
122
|
+
readonly surface_diff: SurfaceMcpDiffOutput;
|
|
123
|
+
readonly surface_alternatives: SurfaceMcpAlternativesOutput;
|
|
124
|
+
readonly surface_trace: SurfaceMcpTraceOutput;
|
|
125
|
+
readonly surface_run: SurfaceMcpRunOutput;
|
|
126
|
+
readonly surface_next: SurfaceMcpNextOutput;
|
|
127
|
+
};
|
|
128
|
+
type SurfaceMcpToolOutput = SurfaceMcpToolOutputMap[SurfaceMcpToolName];
|
|
129
|
+
declare function createSurfaceMcpToolRegistry(): SurfaceMcpToolRegistry;
|
|
130
|
+
declare function createSurfaceMcpServer(options?: SurfaceMcpServerOptions): SurfaceMcpServer;
|
|
131
|
+
declare function createMcpToolSchemaSnapshot(registry?: SurfaceMcpToolRegistry): readonly Pick<SurfaceMcpToolDefinition, "inputSchema" | "name" | "schemaVersion">[];
|
|
132
|
+
declare function assertMcpToolSchemaCompatibility(input: McpToolSchemaCompatibilityInput): Result<true, SurfaceError>;
|
|
133
|
+
declare function createSurfaceSdkMcpServer(options?: SurfaceMcpServerOptions): Promise<unknown>;
|
|
134
|
+
declare function runSurfaceMcpStdioServer(options?: SurfaceMcpServerOptions): Promise<void>;
|
|
135
|
+
|
|
136
|
+
export { type JsonSchema, type McpToolSchemaCompatibilityInput, SURFACE_MCP_SERVER_NAME, SURFACE_MCP_SERVER_VERSION, SURFACE_MCP_TOOL_SCHEMA_VERSION, type SurfaceMcpAlternativesOutput, type SurfaceMcpAuditOutput, type SurfaceMcpBaselineOutput, type SurfaceMcpDiffEntry, type SurfaceMcpDiffOutput, type SurfaceMcpExplainOutput, type SurfaceMcpNextOutput, type SurfaceMcpRunOutput, type SurfaceMcpServer, type SurfaceMcpServerOptions, type SurfaceMcpStatusOutput, type SurfaceMcpToolDefinition, type SurfaceMcpToolName, type SurfaceMcpToolOutput, type SurfaceMcpToolOutputMap, type SurfaceMcpToolRegistry, type SurfaceMcpTraceOutput, type SurfaceMcpValidationOutput, type SurfaceMcpVerdictOutput, assertMcpToolSchemaCompatibility, createMcpToolSchemaSnapshot, createSurfaceMcpServer, createSurfaceMcpToolRegistry, createSurfaceSdkMcpServer, runSurfaceMcpStdioServer };
|