@signatrust/mcp-server 0.1.1

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.
@@ -0,0 +1,130 @@
1
+ /**
2
+ * HTTP client for the SignaTrust REST API (v1).
3
+ *
4
+ * Vendored from @signatrustdev/signatrust-sdk. Uses native fetch() (Node 18+)
5
+ * with API key authentication via x-api-key header. All methods return typed
6
+ * responses or throw ApiError on non-2xx status.
7
+ */
8
+ export class ApiError extends Error {
9
+ status;
10
+ body;
11
+ retryAfter;
12
+ constructor(status, body, retryAfter) {
13
+ super(`API request failed with status ${status}`);
14
+ this.status = status;
15
+ this.body = body;
16
+ this.retryAfter = retryAfter;
17
+ this.name = "ApiError";
18
+ }
19
+ }
20
+ // =============================================================================
21
+ // Client
22
+ // =============================================================================
23
+ export class SignaTrustClient {
24
+ apiKey;
25
+ baseUrl;
26
+ extraHeaders;
27
+ constructor(config) {
28
+ this.apiKey = config.apiKey;
29
+ this.baseUrl = config.baseUrl.replace(/\/+$/, "");
30
+ this.extraHeaders = config.extraHeaders ?? {};
31
+ }
32
+ async request(method, path, options) {
33
+ const url = new URL(`${this.baseUrl}${path}`);
34
+ if (options?.params) {
35
+ for (const [key, value] of Object.entries(options.params)) {
36
+ if (value !== undefined) {
37
+ url.searchParams.set(key, String(value));
38
+ }
39
+ }
40
+ }
41
+ const headers = {
42
+ "x-api-key": this.apiKey,
43
+ "Content-Type": "application/json",
44
+ Accept: "application/json",
45
+ ...this.extraHeaders,
46
+ };
47
+ const response = await fetch(url.toString(), {
48
+ method,
49
+ headers,
50
+ body: options?.body ? JSON.stringify(options.body) : undefined,
51
+ });
52
+ const retryAfter = response.headers.get("retry-after");
53
+ if (!response.ok) {
54
+ let body = null;
55
+ try {
56
+ const text = await response.text();
57
+ body = JSON.parse(text);
58
+ }
59
+ catch {
60
+ // Body wasn't JSON, leave as null
61
+ }
62
+ throw new ApiError(response.status, body, retryAfter);
63
+ }
64
+ const data = (await response.json());
65
+ return { ok: true, status: response.status, data, retryAfter };
66
+ }
67
+ async listEnvelopes(params) {
68
+ const { data } = await this.request("GET", "/api/v1/envelopes", { params });
69
+ return data;
70
+ }
71
+ async getEnvelope(id) {
72
+ const { data } = await this.request("GET", `/api/v1/envelopes/${id}`);
73
+ return data;
74
+ }
75
+ async createEnvelope(input) {
76
+ const { data } = await this.request("POST", "/api/v1/envelopes", { body: input });
77
+ return data;
78
+ }
79
+ async listTemplates(params) {
80
+ const { data } = await this.request("GET", "/api/v1/templates", { params });
81
+ return data;
82
+ }
83
+ /**
84
+ * Request a pre-signed upload URL for a new document.
85
+ * After this returns, PUT the file bytes to `uploadUrl` with the given
86
+ * Content-Type header, then use the returned `id` when creating an envelope.
87
+ */
88
+ async requestDocumentUpload(input) {
89
+ const { data } = await this.request("POST", "/api/v1/documents/upload", { body: input });
90
+ return data;
91
+ }
92
+ /**
93
+ * Upload file bytes to a pre-signed S3 URL obtained from requestDocumentUpload.
94
+ * Does not use the API key — the pre-signed URL carries its own auth.
95
+ */
96
+ async putBytesToUploadUrl(uploadUrl, bytes, contentType) {
97
+ const response = await fetch(uploadUrl, {
98
+ method: "PUT",
99
+ headers: { "Content-Type": contentType },
100
+ body: bytes,
101
+ });
102
+ if (!response.ok) {
103
+ throw new ApiError(response.status, `Pre-signed upload failed: ${response.statusText}`, null);
104
+ }
105
+ }
106
+ /**
107
+ * Void an in-progress envelope. Sets status to VOIDED, notifies signers
108
+ * with a cancellation notice, writes an ENVELOPE_VOIDED audit event, and
109
+ * dispatches an `envelope.voided` webhook.
110
+ *
111
+ * Fails with 400 if the envelope is already COMPLETED or already VOIDED.
112
+ */
113
+ async voidEnvelope(envelopeId, reason) {
114
+ const { data } = await this.request("POST", `/api/v1/envelopes/${envelopeId}/void`, { body: reason ? { reason } : {} });
115
+ return data;
116
+ }
117
+ async verifyBlockchain(envelopeId) {
118
+ const { data } = await this.request("GET", `/api/v1/envelopes/${envelopeId}/blockchain`);
119
+ return data;
120
+ }
121
+ /**
122
+ * Trigger AI contract analysis on an envelope's document.
123
+ * Plan-gated: Free plan returns 403.
124
+ */
125
+ async analyzeEnvelope(envelopeId) {
126
+ const { data } = await this.request("POST", `/api/v1/envelopes/${envelopeId}/analyze`);
127
+ return data;
128
+ }
129
+ }
130
+ //# sourceMappingURL=api-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../../src/vendor/signatrust-sdk/api-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmCH,MAAM,OAAO,QAAS,SAAQ,KAAK;IAExB;IACA;IACA;IAHT,YACS,MAAc,EACd,IAAoC,EACpC,UAA0B;QAEjC,KAAK,CAAC,kCAAkC,MAAM,EAAE,CAAC,CAAC;QAJ3C,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAgC;QACpC,eAAU,GAAV,UAAU,CAAgB;QAGjC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AAED,gFAAgF;AAChF,SAAS;AACT,gFAAgF;AAEhF,MAAM,OAAO,gBAAgB;IACnB,MAAM,CAAS;IACf,OAAO,CAAS;IAChB,YAAY,CAAyB;IAE7C,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,EAAE,CAAC;IAChD,CAAC;IAEO,KAAK,CAAC,OAAO,CACnB,MAAc,EACd,IAAY,EACZ,OAGC;QAED,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC,CAAC;QAE9C,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,KAAK,MAAM,CAAC,GAAG,EAAE,KAA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AAE,cAAc,EAAE,WAAW,EAAE;YACxC,IAAI,EAAE,KAAK;SACZ,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,QAAQ,CAChB,QAAQ,CAAC,MAAM,EACf,6BAA6B,QAAQ,CAAC,UAAU,EAAE,EAClD,IAAI,CACL,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,YAAY,CAChB,UAAkB,EAClB,MAAe;QAEf,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CACjC,MAAM,EACN,qBAAqB,UAAU,OAAO,EACtC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CACnC,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,UAAkB;QACvC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CACjC,KAAK,EACL,qBAAqB,UAAU,aAAa,CAC7C,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,eAAe,CAAC,UAAkB;QACtC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CACjC,MAAM,EACN,qBAAqB,UAAU,UAAU,CAC1C,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ export { SignaTrustClient, ApiError } from "./api-client.js";
2
+ export * from "./types.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vendor/signatrust-sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC7D,cAAc,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { SignaTrustClient, ApiError } from "./api-client.js";
2
+ export * from "./types.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/vendor/signatrust-sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC7D,cAAc,YAAY,CAAC"}
@@ -0,0 +1,170 @@
1
+ /**
2
+ * Standalone type definitions for the SignaTrust public API (v1).
3
+ *
4
+ * Vendored from @signatrustdev/signatrust-sdk and corrected to match the
5
+ * actual backend response shapes in signatrust_new/src/types/api-v1.ts.
6
+ * This package has no external runtime dependencies beyond
7
+ * @modelcontextprotocol/sdk.
8
+ */
9
+ export type EnvelopeStatus = "DRAFT" | "SENT" | "NEEDS_SIGNATURE" | "COMPLETED" | "VOIDED" | "DECLINED";
10
+ export type SignerStatus = "PENDING" | "SENT" | "NEEDS_SIGNATURE" | "SIGNED" | "DECLINED";
11
+ export type SignerRole = "SIGNER" | "OBSERVER";
12
+ export type DeliveryMethod = "EMAIL" | "SMS" | "BOTH";
13
+ export type SecurityLevel = "STANDARD" | "VERIFIED" | "CERTIFIED";
14
+ export interface ProblemDetails {
15
+ type: string;
16
+ title: string;
17
+ status: number;
18
+ detail?: string;
19
+ instance?: string;
20
+ errors?: ValidationError[];
21
+ }
22
+ export interface ValidationError {
23
+ field: string;
24
+ message: string;
25
+ code?: string;
26
+ }
27
+ export interface PaginationMeta {
28
+ page: number;
29
+ limit: number;
30
+ total: number;
31
+ totalPages: number;
32
+ hasNext: boolean;
33
+ hasPrev: boolean;
34
+ }
35
+ export interface PaginatedResponse<T> {
36
+ data: T[];
37
+ pagination: PaginationMeta;
38
+ }
39
+ export interface EnvelopeSigner {
40
+ id: string;
41
+ name: string;
42
+ email: string | null;
43
+ phone: string | null;
44
+ role: SignerRole;
45
+ status: SignerStatus;
46
+ routingOrder: number;
47
+ deliveryMethod: DeliveryMethod;
48
+ signedAt: string | null;
49
+ viewedAt: string | null;
50
+ declinedAt: string | null;
51
+ }
52
+ export interface EnvelopeDocument {
53
+ id: string;
54
+ name: string;
55
+ contentType: string;
56
+ size: number;
57
+ hash: string | null;
58
+ createdAt: string;
59
+ }
60
+ /**
61
+ * Envelope shape returned by list / get / create / update.
62
+ * Matches V1EnvelopeDetailResponse in the backend.
63
+ */
64
+ export interface EnvelopeDetail {
65
+ id: string;
66
+ name: string;
67
+ status: EnvelopeStatus;
68
+ securityLevel?: SecurityLevel;
69
+ message: string | null;
70
+ createdAt: string;
71
+ updatedAt: string;
72
+ sentAt: string | null;
73
+ completedAt: string | null;
74
+ voidedAt: string | null;
75
+ voidReason: string | null;
76
+ blockchain: {
77
+ txId: string | null;
78
+ network: string | null;
79
+ explorerUrl: string | null;
80
+ timestamp: string | null;
81
+ };
82
+ documents: EnvelopeDocument[];
83
+ signers: EnvelopeSigner[];
84
+ }
85
+ export interface SignerRoleDef {
86
+ role: string;
87
+ order: number;
88
+ action: string;
89
+ }
90
+ /**
91
+ * Template summary returned by GET /api/v1/templates (list).
92
+ */
93
+ export interface TemplateResponse {
94
+ id: string;
95
+ name: string;
96
+ description: string | null;
97
+ category: string | null;
98
+ vertical: string | null;
99
+ tags: string[];
100
+ contentType: string;
101
+ fieldCount: number;
102
+ signerRoles: SignerRoleDef[];
103
+ featured: boolean;
104
+ isSystem: boolean;
105
+ createdAt: string;
106
+ updatedAt: string;
107
+ }
108
+ /**
109
+ * Response from POST /api/v1/documents/upload.
110
+ * Caller PUTs file bytes to uploadUrl before using the document in an envelope.
111
+ */
112
+ export interface DocumentUploadResponse {
113
+ id: string;
114
+ name: string;
115
+ contentType: string;
116
+ size: number;
117
+ hash: string | null;
118
+ createdAt: string;
119
+ uploadUrl: string;
120
+ }
121
+ /**
122
+ * Response from GET /api/v1/envelopes/{id}/blockchain.
123
+ *
124
+ * compositeHash and fileHash bind document + signer metadata + audit trail.
125
+ * The Solana txId anchors compositeHash publicly and immutably.
126
+ */
127
+ export interface VerificationResponse {
128
+ envelopeId: string;
129
+ txId: string | null;
130
+ network: string | null;
131
+ explorerUrl: string | null;
132
+ compositeHash: string | null;
133
+ fileHash: string | null;
134
+ hashVersion: number | null;
135
+ verified: boolean;
136
+ timestamp: number | null;
137
+ }
138
+ /**
139
+ * Response from POST /api/v1/envelopes/{id}/analyze.
140
+ */
141
+ export interface AnalysisResponse {
142
+ envelopeId: string;
143
+ analysis: Record<string, unknown> | null;
144
+ analyzedAt: string | null;
145
+ }
146
+ export interface CreateEnvelopeSigner {
147
+ name: string;
148
+ email?: string;
149
+ phone?: string;
150
+ role?: SignerRole;
151
+ routingOrder?: number;
152
+ deliveryMethod?: DeliveryMethod;
153
+ }
154
+ /**
155
+ * Body for POST /api/v1/envelopes.
156
+ *
157
+ * Two modes:
158
+ * - Standard: supply `name`, `signers`, `documentIds`.
159
+ * - Template: supply `name` (optional, defaults to template name), `signers`,
160
+ * and `templateId`. Backend copies the template's document server-side.
161
+ */
162
+ export interface CreateEnvelopeInput {
163
+ name: string;
164
+ signers: CreateEnvelopeSigner[];
165
+ documentIds?: string[];
166
+ templateId?: string;
167
+ message?: string;
168
+ securityLevel?: SecurityLevel;
169
+ }
170
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/vendor/signatrust-sdk/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,MAAM,cAAc,GACtB,OAAO,GACP,MAAM,GACN,iBAAiB,GACjB,WAAW,GACX,QAAQ,GACR,UAAU,CAAC;AAEf,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,MAAM,GACN,iBAAiB,GACjB,QAAQ,GACR,UAAU,CAAC;AAEf,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/C,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,KAAK,GA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AAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Standalone type definitions for the SignaTrust public API (v1).
3
+ *
4
+ * Vendored from @signatrustdev/signatrust-sdk and corrected to match the
5
+ * actual backend response shapes in signatrust_new/src/types/api-v1.ts.
6
+ * This package has no external runtime dependencies beyond
7
+ * @modelcontextprotocol/sdk.
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/vendor/signatrust-sdk/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
package/manifest.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "manifest_version": "0.2",
3
+ "name": "signatrust",
4
+ "display_name": "SignaTrust",
5
+ "version": "0.1.0",
6
+ "description": "Send documents for signature with three-tier security (Standard, Verified, Certified), manage templates, and verify Solana blockchain anchors that cryptographically bind the document, signer metadata, and audit trail.",
7
+ "long_description": "SignaTrust is a blockchain-secured electronic signature platform. This MCP server lets AI assistants create and manage signing envelopes, run AI-powered document review, and verify the composite-hash anchor on Solana that makes each signed envelope independently verifiable — even if SignaTrust ceases to exist.\n\nThree-tier signing ceremonies:\n- STANDARD: bearer-token access (routine approvals, internal docs)\n- VERIFIED: adds SMS/email OTP (employment, vendor contracts, healthcare consent)\n- CERTIFIED: adds WebAuthn biometric + device binding (real estate, high-value, regulatory)\n\nEvidence bundle: every envelope is anchored to Solana via a SHA-256 composite hash that binds the final PDF, signer metadata, and the hash-chained audit trail. RFC 3161 qualified timestamps from an independent TSA provide vendor-neutral proof of time.",
8
+ "author": {
9
+ "name": "SignaTrust",
10
+ "url": "https://signatrust.io"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/SignaTrustDev/signatrust-mcp"
15
+ },
16
+ "server": {
17
+ "type": "node",
18
+ "entry_point": "dist/server.js",
19
+ "mcp_config": {
20
+ "command": "node",
21
+ "args": [
22
+ "${__dirname}/dist/server.js"
23
+ ],
24
+ "env": {
25
+ "SIGNATRUST_API_KEY": "${user_config.api_key}",
26
+ "SIGNATRUST_API_URL": "${user_config.api_url}"
27
+ }
28
+ }
29
+ },
30
+ "user_config": {
31
+ "api_key": {
32
+ "type": "string",
33
+ "title": "SignaTrust API Key",
34
+ "description": "Your SignaTrust API key. Create one at https://app.signatrust.io/settings/api-keys",
35
+ "sensitive": true,
36
+ "required": true
37
+ },
38
+ "api_url": {
39
+ "type": "string",
40
+ "title": "SignaTrust API URL",
41
+ "description": "API base URL. Leave as default unless you are self-hosting or using a staging environment.",
42
+ "default": "https://app.signatrust.io",
43
+ "required": false
44
+ }
45
+ },
46
+ "homepage": "https://signatrust.io",
47
+ "documentation": "https://github.com/SignaTrustDev/signatrust-mcp#readme",
48
+ "support": "https://github.com/SignaTrustDev/signatrust-mcp/issues",
49
+ "privacy_policies": ["https://signatrust.io/privacy"],
50
+ "license": "MIT"
51
+ }
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@signatrust/mcp-server",
3
+ "version": "0.1.1",
4
+ "description": "Model Context Protocol server for the SignaTrust document signing API",
5
+ "type": "module",
6
+ "main": "dist/server.js",
7
+ "bin": {
8
+ "signatrust-mcp-server": "dist/server.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "manifest.json",
13
+ "README.md"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsc",
17
+ "dev": "tsc --watch",
18
+ "test": "vitest run",
19
+ "test:watch": "vitest",
20
+ "test:coverage": "vitest run --coverage",
21
+ "bundle": "npm run build && npx @anthropic-ai/mcpb pack .",
22
+ "smoke": "npm run build && node scripts/smoke.mjs",
23
+ "e2e": "npm run build && node scripts/e2e.mjs",
24
+ "prepublishOnly": "npm run build",
25
+ "typecheck": "tsc --noEmit"
26
+ },
27
+ "keywords": [
28
+ "signatrust",
29
+ "mcp",
30
+ "model-context-protocol",
31
+ "document-signing",
32
+ "blockchain",
33
+ "ai-tools"
34
+ ],
35
+ "license": "MIT",
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "https://github.com/SignaTrustDev/signatrust-mcp.git"
39
+ },
40
+ "engines": {
41
+ "node": ">=18"
42
+ },
43
+ "dependencies": {
44
+ "@modelcontextprotocol/sdk": "1.26.0"
45
+ },
46
+ "overrides": {
47
+ "@hono/node-server": "^1.19.10",
48
+ "hono": "^4.11.10"
49
+ },
50
+ "devDependencies": {
51
+ "@types/node": "^25.2.3",
52
+ "@vitest/coverage-v8": "^4.0.0",
53
+ "typescript": "~5.9.3",
54
+ "vitest": "^4.0.0"
55
+ }
56
+ }