@signdocs-brasil/mcp-server 0.1.0 → 0.3.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/README.md +77 -3
- package/dist/bin/http.d.ts +2 -0
- package/dist/bin/http.js +35 -0
- package/dist/bin/http.js.map +1 -0
- package/dist/bin/stdio.js +2 -1
- package/dist/bin/stdio.js.map +1 -1
- package/dist/client.d.ts +50 -0
- package/dist/client.js +71 -0
- package/dist/client.js.map +1 -1
- package/dist/http/server.d.ts +29 -29
- package/dist/http/server.js +160 -36
- package/dist/http/server.js.map +1 -1
- package/dist/http/shared.d.ts +31 -0
- package/dist/http/shared.js +67 -0
- package/dist/http/shared.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/lambda.d.ts +51 -0
- package/dist/lambda.js +96 -0
- package/dist/lambda.js.map +1 -0
- package/dist/schemas.d.ts +6 -6
- package/dist/server.d.ts +7 -5
- package/dist/server.js +13 -12
- package/dist/server.js.map +1 -1
- package/dist/tools/documents.d.ts +2 -1
- package/dist/tools/documents.js +3 -4
- package/dist/tools/documents.js.map +1 -1
- package/dist/tools/envelopes.d.ts +2 -1
- package/dist/tools/envelopes.js +6 -6
- package/dist/tools/envelopes.js.map +1 -1
- package/dist/tools/evidence.d.ts +2 -1
- package/dist/tools/evidence.js +2 -3
- package/dist/tools/evidence.js.map +1 -1
- package/dist/tools/signingSessions.d.ts +2 -1
- package/dist/tools/signingSessions.js +8 -8
- package/dist/tools/signingSessions.js.map +1 -1
- package/dist/tools/transactions.d.ts +2 -1
- package/dist/tools/transactions.js +4 -5
- package/dist/tools/transactions.js.map +1 -1
- package/dist/tools/verify.d.ts +2 -1
- package/dist/tools/verify.js +5 -7
- package/dist/tools/verify.js.map +1 -1
- package/dist/tools/webhooks.d.ts +2 -1
- package/dist/tools/webhooks.js +5 -6
- package/dist/tools/webhooks.js.map +1 -1
- package/package.json +22 -6
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { buildClient, getBaseUrl, resolveEnvironment, DEFAULT_SCOPES, } from '../client.js';
|
|
2
|
+
export function headerValue(headers, name) {
|
|
3
|
+
const raw = headers[name] ?? headers[name.toLowerCase()];
|
|
4
|
+
return Array.isArray(raw) ? raw[0] : raw;
|
|
5
|
+
}
|
|
6
|
+
/** Parse the Authorization header into a Bearer token or Basic client credentials. */
|
|
7
|
+
export function extractAuthFromHeaders(headers) {
|
|
8
|
+
const auth = headerValue(headers, 'authorization');
|
|
9
|
+
if (!auth)
|
|
10
|
+
return null;
|
|
11
|
+
const space = auth.indexOf(' ');
|
|
12
|
+
if (space < 0)
|
|
13
|
+
return null;
|
|
14
|
+
const scheme = auth.slice(0, space).toLowerCase();
|
|
15
|
+
const value = auth.slice(space + 1).trim();
|
|
16
|
+
if (!value)
|
|
17
|
+
return null;
|
|
18
|
+
if (scheme === 'bearer')
|
|
19
|
+
return { mode: 'bearer', bearer: value };
|
|
20
|
+
if (scheme === 'basic') {
|
|
21
|
+
const decoded = Buffer.from(value, 'base64').toString('utf8');
|
|
22
|
+
const sep = decoded.indexOf(':');
|
|
23
|
+
if (sep < 0)
|
|
24
|
+
return null;
|
|
25
|
+
return { mode: 'credentials', clientId: decoded.slice(0, sep), clientSecret: decoded.slice(sep + 1) };
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
/** Resolve the SignDocs environment from the X-SignDocs-Environment header, else fallback. */
|
|
30
|
+
export function environmentFromHeaders(headers, fallback) {
|
|
31
|
+
const value = headerValue(headers, 'x-signdocs-environment');
|
|
32
|
+
if (value && value.trim()) {
|
|
33
|
+
try {
|
|
34
|
+
return resolveEnvironment(value);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
/* ignore invalid header, use fallback */
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return fallback;
|
|
41
|
+
}
|
|
42
|
+
/** Build a request-scoped tool context (fresh SDK client) from parsed auth. */
|
|
43
|
+
export function buildContextForAuth(auth, environment) {
|
|
44
|
+
const client = auth.mode === 'bearer'
|
|
45
|
+
? buildClient({ mode: 'bearer', bearer: auth.bearer, environment })
|
|
46
|
+
: buildClient({ mode: 'credentials', clientId: auth.clientId, clientSecret: auth.clientSecret, environment });
|
|
47
|
+
return { client, environment };
|
|
48
|
+
}
|
|
49
|
+
/** RFC 9728 protected-resource metadata pointing at the SignDocs authorization server. */
|
|
50
|
+
export function protectedResourceMetadata(resourceUrl, environment) {
|
|
51
|
+
return {
|
|
52
|
+
resource: resourceUrl,
|
|
53
|
+
authorization_servers: [getBaseUrl(environment)],
|
|
54
|
+
scopes_supported: DEFAULT_SCOPES,
|
|
55
|
+
bearer_methods_supported: ['header'],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/** WWW-Authenticate challenge value pointing a client at the resource metadata. */
|
|
59
|
+
export function wwwAuthenticate(metadataUrl) {
|
|
60
|
+
return `Bearer resource_metadata="${metadataUrl}"`;
|
|
61
|
+
}
|
|
62
|
+
export const UNAUTHORIZED_BODY = {
|
|
63
|
+
error: 'unauthorized',
|
|
64
|
+
error_description: 'Provide a SignDocs OAuth2 access token (Authorization: Bearer <token>) or client ' +
|
|
65
|
+
'credentials (Authorization: Basic base64(clientId:clientSecret)).',
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/http/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,cAAc,GAGf,MAAM,cAAc,CAAC;AAetB,MAAM,UAAU,WAAW,CAAC,OAAkB,EAAE,IAAY;IAC1D,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IACzD,OAAO,KAAK,CAAC,OAAO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,EAAE,cAAc;IACrB,iBAAiB,EACf,mFAAmF;QACnF,mEAAmE;CACtE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API of @signdocs-brasil/mcp-server.
|
|
3
|
+
*
|
|
4
|
+
* - `createServer(ctx)` — transport-agnostic MCP server (tools + resources).
|
|
5
|
+
* - `buildClient` / `getStdioContext` — request-scoped SignDocs SDK clients.
|
|
6
|
+
* - `createHttpServer` — long-running remote Streamable-HTTP server (also at "./http").
|
|
7
|
+
* - `createLambdaHandler` — API Gateway v2 adapter (also at "./lambda").
|
|
8
|
+
*/
|
|
9
|
+
export { createServer, SERVER_NAME, SERVER_VERSION } from './server.js';
|
|
10
|
+
export { buildClient, getClient, getStdioContext, getBaseUrl, resolveEnvironment, buildSigningUrl, StaticTokenCache, DEFAULT_SCOPES, type Environment, type ToolContext, type BuildClientOptions, type ResolvedEnv, } from './client.js';
|
|
11
|
+
export { createHttpServer, type HttpServerOptions } from './http/server.js';
|
|
12
|
+
export { createLambdaHandler, type LambdaHandler, type LambdaHandlerOptions, type ApiGatewayV2Event, type ApiGatewayV2Result, } from './lambda.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API of @signdocs-brasil/mcp-server.
|
|
3
|
+
*
|
|
4
|
+
* - `createServer(ctx)` — transport-agnostic MCP server (tools + resources).
|
|
5
|
+
* - `buildClient` / `getStdioContext` — request-scoped SignDocs SDK clients.
|
|
6
|
+
* - `createHttpServer` — long-running remote Streamable-HTTP server (also at "./http").
|
|
7
|
+
* - `createLambdaHandler` — API Gateway v2 adapter (also at "./lambda").
|
|
8
|
+
*/
|
|
9
|
+
export { createServer, SERVER_NAME, SERVER_VERSION } from './server.js';
|
|
10
|
+
export { buildClient, getClient, getStdioContext, getBaseUrl, resolveEnvironment, buildSigningUrl, StaticTokenCache, DEFAULT_SCOPES, } from './client.js';
|
|
11
|
+
export { createHttpServer } from './http/server.js';
|
|
12
|
+
export { createLambdaHandler, } from './lambda.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EACL,WAAW,EACX,SAAS,EACT,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,cAAc,GAKf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAA0B,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EACL,mBAAmB,GAKpB,MAAM,aAAa,CAAC"}
|
package/dist/lambda.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Environment } from './client.js';
|
|
2
|
+
/**
|
|
3
|
+
* AWS Lambda (API Gateway HTTP API v2) adapter for the MCP server.
|
|
4
|
+
*
|
|
5
|
+
* Runs the transport in STATELESS mode — a fresh server + transport per
|
|
6
|
+
* invocation — which works with standard MCP clients and needs no shared
|
|
7
|
+
* session store (a perfect fit for Lambda's per-request isolation). Auth is
|
|
8
|
+
* per request: Bearer access-token passthrough or Basic client_credentials.
|
|
9
|
+
*
|
|
10
|
+
* Built on the SDK's Web-Standard transport (Request → Response), so no
|
|
11
|
+
* Node req/res shim is needed; Node 18+ provides global Request/Response.
|
|
12
|
+
*
|
|
13
|
+
* Minimal local event/result types avoid an `aws-lambda` dependency; the
|
|
14
|
+
* returned handler is structurally compatible with `APIGatewayProxyHandlerV2`.
|
|
15
|
+
*/
|
|
16
|
+
export interface ApiGatewayV2Event {
|
|
17
|
+
version?: string;
|
|
18
|
+
routeKey?: string;
|
|
19
|
+
rawPath?: string;
|
|
20
|
+
rawQueryString?: string;
|
|
21
|
+
headers?: Record<string, string | undefined>;
|
|
22
|
+
requestContext?: {
|
|
23
|
+
http?: {
|
|
24
|
+
method?: string;
|
|
25
|
+
path?: string;
|
|
26
|
+
sourceIp?: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
body?: string;
|
|
30
|
+
isBase64Encoded?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface ApiGatewayV2Result {
|
|
33
|
+
statusCode: number;
|
|
34
|
+
headers?: Record<string, string>;
|
|
35
|
+
body?: string;
|
|
36
|
+
isBase64Encoded?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export type LambdaHandler = (event: ApiGatewayV2Event) => Promise<ApiGatewayV2Result>;
|
|
39
|
+
export interface LambdaHandlerOptions {
|
|
40
|
+
/** Environment when a request doesn't send X-SignDocs-Environment. Default 'hml'. */
|
|
41
|
+
defaultEnvironment?: Environment;
|
|
42
|
+
/** Public base origin (e.g. https://mcp-hml.signdocs.com.br) for resource metadata. Derived from headers if unset. */
|
|
43
|
+
publicUrl?: string;
|
|
44
|
+
/** CORS Access-Control-Allow-Origin. Default '*'. */
|
|
45
|
+
corsOrigin?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Build an API Gateway v2 Lambda handler that serves the MCP endpoint.
|
|
49
|
+
* Routes: `POST /mcp` (MCP), `GET /mcp` (resource metadata), `OPTIONS` (CORS).
|
|
50
|
+
*/
|
|
51
|
+
export declare function createLambdaHandler(options?: LambdaHandlerOptions): LambdaHandler;
|
package/dist/lambda.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { WebStandardStreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js';
|
|
2
|
+
import { createServer as createMcpServer } from './server.js';
|
|
3
|
+
import { extractAuthFromHeaders, environmentFromHeaders, buildContextForAuth, protectedResourceMetadata, wwwAuthenticate, UNAUTHORIZED_BODY, } from './http/shared.js';
|
|
4
|
+
const CORS_ALLOW_HEADERS = 'Content-Type, Authorization, Mcp-Session-Id, Mcp-Protocol-Version, X-SignDocs-Environment';
|
|
5
|
+
function corsHeaders(origin) {
|
|
6
|
+
return {
|
|
7
|
+
'Access-Control-Allow-Origin': origin,
|
|
8
|
+
'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',
|
|
9
|
+
'Access-Control-Allow-Headers': CORS_ALLOW_HEADERS,
|
|
10
|
+
'Access-Control-Expose-Headers': 'Mcp-Session-Id, WWW-Authenticate',
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function lowercaseHeaders(headers) {
|
|
14
|
+
const out = {};
|
|
15
|
+
for (const [k, v] of Object.entries(headers)) {
|
|
16
|
+
if (v !== undefined)
|
|
17
|
+
out[k.toLowerCase()] = v;
|
|
18
|
+
}
|
|
19
|
+
return out;
|
|
20
|
+
}
|
|
21
|
+
function baseOrigin(headers, opts) {
|
|
22
|
+
if (opts.publicUrl)
|
|
23
|
+
return opts.publicUrl.replace(/\/$/, '');
|
|
24
|
+
const proto = headers['x-forwarded-proto']?.split(',')[0] ?? 'https';
|
|
25
|
+
const host = headers['x-forwarded-host'] ?? headers['host'] ?? 'localhost';
|
|
26
|
+
return `${proto}://${host}`;
|
|
27
|
+
}
|
|
28
|
+
function json(statusCode, body, headers = {}) {
|
|
29
|
+
return { statusCode, headers: { 'Content-Type': 'application/json', ...headers }, body: JSON.stringify(body) };
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Build an API Gateway v2 Lambda handler that serves the MCP endpoint.
|
|
33
|
+
* Routes: `POST /mcp` (MCP), `GET /mcp` (resource metadata), `OPTIONS` (CORS).
|
|
34
|
+
*/
|
|
35
|
+
export function createLambdaHandler(options = {}) {
|
|
36
|
+
const defaultEnvironment = options.defaultEnvironment ?? 'hml';
|
|
37
|
+
const corsOrigin = options.corsOrigin ?? '*';
|
|
38
|
+
return async (event) => {
|
|
39
|
+
const headers = lowercaseHeaders(event.headers ?? {});
|
|
40
|
+
const method = (event.requestContext?.http?.method ?? 'POST').toUpperCase();
|
|
41
|
+
const resourceUrl = `${baseOrigin(headers, options)}/mcp`;
|
|
42
|
+
const cors = corsHeaders(corsOrigin);
|
|
43
|
+
if (method === 'OPTIONS')
|
|
44
|
+
return { statusCode: 204, headers: cors };
|
|
45
|
+
if (method === 'GET')
|
|
46
|
+
return json(200, protectedResourceMetadata(resourceUrl, defaultEnvironment), cors);
|
|
47
|
+
if (method !== 'POST')
|
|
48
|
+
return json(405, { error: 'method_not_allowed' }, { ...cors, Allow: 'GET, POST, OPTIONS' });
|
|
49
|
+
const auth = extractAuthFromHeaders(headers);
|
|
50
|
+
if (!auth) {
|
|
51
|
+
return json(401, UNAUTHORIZED_BODY, { ...cors, 'WWW-Authenticate': wwwAuthenticate(resourceUrl) });
|
|
52
|
+
}
|
|
53
|
+
const rawBody = event.body ? Buffer.from(event.body, event.isBase64Encoded ? 'base64' : 'utf8') : undefined;
|
|
54
|
+
let parsedBody;
|
|
55
|
+
try {
|
|
56
|
+
parsedBody = rawBody && rawBody.length ? JSON.parse(rawBody.toString('utf8')) : undefined;
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return json(400, { error: 'invalid_json', error_description: 'Request body is not valid JSON.' }, cors);
|
|
60
|
+
}
|
|
61
|
+
const environment = environmentFromHeaders(headers, defaultEnvironment);
|
|
62
|
+
const ctx = buildContextForAuth(auth, environment);
|
|
63
|
+
const server = createMcpServer(ctx);
|
|
64
|
+
const transport = new WebStandardStreamableHTTPServerTransport({
|
|
65
|
+
sessionIdGenerator: undefined,
|
|
66
|
+
enableJsonResponse: true,
|
|
67
|
+
});
|
|
68
|
+
// Build a Web-Standard Request. Ensure Accept satisfies the transport
|
|
69
|
+
// (it requires application/json and/or text/event-stream).
|
|
70
|
+
const requestHeaders = new Headers();
|
|
71
|
+
for (const [k, v] of Object.entries(headers))
|
|
72
|
+
requestHeaders.set(k, v);
|
|
73
|
+
if (!requestHeaders.has('accept'))
|
|
74
|
+
requestHeaders.set('accept', 'application/json, text/event-stream');
|
|
75
|
+
const request = new Request(resourceUrl, {
|
|
76
|
+
method: 'POST',
|
|
77
|
+
headers: requestHeaders,
|
|
78
|
+
body: rawBody ? rawBody.toString('utf8') : undefined,
|
|
79
|
+
});
|
|
80
|
+
try {
|
|
81
|
+
await server.connect(transport);
|
|
82
|
+
const response = await transport.handleRequest(request, { parsedBody });
|
|
83
|
+
const outHeaders = { ...cors };
|
|
84
|
+
response.headers.forEach((value, key) => {
|
|
85
|
+
outHeaders[key] = value;
|
|
86
|
+
});
|
|
87
|
+
const body = await response.text();
|
|
88
|
+
return { statusCode: response.status, headers: outHeaders, body };
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
await transport.close().catch(() => undefined);
|
|
92
|
+
await server.close().catch(() => undefined);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=lambda.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lambda.js","sourceRoot":"","sources":["../src/lambda.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wCAAwC,EAAE,MAAM,+DAA+D,CAAC;AACzH,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,eAAe,EACf,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AA8C1B,MAAM,kBAAkB,GACtB,2FAA2F,CAAC;AAE9F,SAAS,WAAW,CAAC,MAAc;IACjC,OAAO;QACL,6BAA6B,EAAE,MAAM;QACrC,8BAA8B,EAAE,oBAAoB;QACpD,8BAA8B,EAAE,kBAAkB;QAClD,+BAA+B,EAAE,kCAAkC;KACpE,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,OAA2C;IACnE,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,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UAAU,GAA2B,EAAE,GAAG,IAAI,EAAE,CAAC;YACvD,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;gBACtC,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YAC1B,CAAC,CAAC,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;QACpE,CAAC;gBAAS,CAAC;YACT,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;YAC/C,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/schemas.d.ts
CHANGED
|
@@ -41,12 +41,12 @@ export declare const createSigningSessionShape: {
|
|
|
41
41
|
description: z.ZodString;
|
|
42
42
|
reference: z.ZodOptional<z.ZodString>;
|
|
43
43
|
}, "strip", z.ZodTypeAny, {
|
|
44
|
-
description: string;
|
|
45
44
|
type: string;
|
|
45
|
+
description: string;
|
|
46
46
|
reference?: string | undefined;
|
|
47
47
|
}, {
|
|
48
|
-
description: string;
|
|
49
48
|
type: string;
|
|
49
|
+
description: string;
|
|
50
50
|
reference?: string | undefined;
|
|
51
51
|
}>>;
|
|
52
52
|
returnUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -58,11 +58,11 @@ export declare const createSigningSessionShape: {
|
|
|
58
58
|
name: z.ZodOptional<z.ZodString>;
|
|
59
59
|
email: z.ZodOptional<z.ZodString>;
|
|
60
60
|
}, "strip", z.ZodTypeAny, {
|
|
61
|
-
email?: string | undefined;
|
|
62
61
|
name?: string | undefined;
|
|
63
|
-
}, {
|
|
64
62
|
email?: string | undefined;
|
|
63
|
+
}, {
|
|
65
64
|
name?: string | undefined;
|
|
65
|
+
email?: string | undefined;
|
|
66
66
|
}>>;
|
|
67
67
|
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
68
68
|
};
|
|
@@ -92,11 +92,11 @@ export declare const createEnvelopeShape: {
|
|
|
92
92
|
name: z.ZodOptional<z.ZodString>;
|
|
93
93
|
email: z.ZodOptional<z.ZodString>;
|
|
94
94
|
}, "strip", z.ZodTypeAny, {
|
|
95
|
-
email?: string | undefined;
|
|
96
95
|
name?: string | undefined;
|
|
97
|
-
}, {
|
|
98
96
|
email?: string | undefined;
|
|
97
|
+
}, {
|
|
99
98
|
name?: string | undefined;
|
|
99
|
+
email?: string | undefined;
|
|
100
100
|
}>>;
|
|
101
101
|
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
102
102
|
};
|
package/dist/server.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { ToolContext } from './client.js';
|
|
2
3
|
export declare const SERVER_NAME = "signdocs-brasil";
|
|
3
|
-
export declare const SERVER_VERSION = "0.
|
|
4
|
+
export declare const SERVER_VERSION = "0.3.0";
|
|
4
5
|
/**
|
|
5
|
-
* Build a fully-wired MCP server
|
|
6
|
-
*
|
|
7
|
-
* (http/server.ts)
|
|
6
|
+
* Build a fully-wired MCP server bound to a request/session-scoped
|
|
7
|
+
* {@link ToolContext}. Transport-agnostic: stdio (bin/stdio.ts) builds one
|
|
8
|
+
* context from env; the HTTP transport (http/server.ts) builds one per request
|
|
9
|
+
* so tenants stay isolated.
|
|
8
10
|
*/
|
|
9
|
-
export declare function createServer(): McpServer;
|
|
11
|
+
export declare function createServer(ctx: ToolContext): McpServer;
|
package/dist/server.js
CHANGED
|
@@ -8,7 +8,7 @@ import { registerVerifyTools } from './tools/verify.js';
|
|
|
8
8
|
import { registerWebhookTools } from './tools/webhooks.js';
|
|
9
9
|
import { registerResources } from './resources.js';
|
|
10
10
|
export const SERVER_NAME = 'signdocs-brasil';
|
|
11
|
-
export const SERVER_VERSION = '0.
|
|
11
|
+
export const SERVER_VERSION = '0.3.0';
|
|
12
12
|
const INSTRUCTIONS = `SignDocs Brasil electronic-signature API.
|
|
13
13
|
|
|
14
14
|
Use signing sessions for single-signer flows and envelopes for multi-signer
|
|
@@ -19,19 +19,20 @@ Tools whose names start with create_, add_, cancel_, delete_, or verify_document
|
|
|
19
19
|
take real, quota-consuming, and often legally-binding actions — confirm with the
|
|
20
20
|
human before invoking them. All other tools are read-only or non-binding.`;
|
|
21
21
|
/**
|
|
22
|
-
* Build a fully-wired MCP server
|
|
23
|
-
*
|
|
24
|
-
* (http/server.ts)
|
|
22
|
+
* Build a fully-wired MCP server bound to a request/session-scoped
|
|
23
|
+
* {@link ToolContext}. Transport-agnostic: stdio (bin/stdio.ts) builds one
|
|
24
|
+
* context from env; the HTTP transport (http/server.ts) builds one per request
|
|
25
|
+
* so tenants stay isolated.
|
|
25
26
|
*/
|
|
26
|
-
export function createServer() {
|
|
27
|
+
export function createServer(ctx) {
|
|
27
28
|
const server = new McpServer({ name: SERVER_NAME, version: SERVER_VERSION }, { instructions: INSTRUCTIONS });
|
|
28
|
-
registerSigningSessionTools(server);
|
|
29
|
-
registerEnvelopeTools(server);
|
|
30
|
-
registerDocumentTools(server);
|
|
31
|
-
registerTransactionTools(server);
|
|
32
|
-
registerEvidenceTools(server);
|
|
33
|
-
registerVerifyTools(server);
|
|
34
|
-
registerWebhookTools(server);
|
|
29
|
+
registerSigningSessionTools(server, ctx);
|
|
30
|
+
registerEnvelopeTools(server, ctx);
|
|
31
|
+
registerDocumentTools(server, ctx);
|
|
32
|
+
registerTransactionTools(server, ctx);
|
|
33
|
+
registerEvidenceTools(server, ctx);
|
|
34
|
+
registerVerifyTools(server, ctx);
|
|
35
|
+
registerWebhookTools(server, ctx);
|
|
35
36
|
registerResources(server);
|
|
36
37
|
return server;
|
|
37
38
|
}
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAC7C,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAEtC,MAAM,YAAY,GAAG;;;;;;;;0EAQqD,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,GAAgB;IAC3C,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,EAC9C,EAAE,YAAY,EAAE,YAAY,EAAE,CAC/B,CAAC;IAEF,2BAA2B,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACzC,qBAAqB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,qBAAqB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACtC,qBAAqB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAE1B,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
|
|
2
|
+
import type { ToolContext } from '../client.js';
|
|
3
|
+
export declare function registerDocumentTools(server: McpServer, ctx: ToolContext): void;
|
package/dist/tools/documents.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { getClient } from '../client.js';
|
|
2
1
|
import { READ_ONLY, WRITE_SAFE } from '../annotations.js';
|
|
3
2
|
import { run } from './helpers.js';
|
|
4
3
|
import { uploadDocumentShape, transactionIdShape } from '../schemas.js';
|
|
5
|
-
export function registerDocumentTools(server) {
|
|
4
|
+
export function registerDocumentTools(server, ctx) {
|
|
6
5
|
server.registerTool('upload_document', {
|
|
7
6
|
title: 'Upload document',
|
|
8
7
|
description: 'Upload a base64-encoded PDF to an existing transaction (≤10MB inline; use presign for larger).',
|
|
9
8
|
inputSchema: uploadDocumentShape,
|
|
10
9
|
annotations: WRITE_SAFE,
|
|
11
|
-
}, async (args) => run(() =>
|
|
10
|
+
}, async (args) => run(() => ctx.client.documents.upload(args.transactionId, {
|
|
12
11
|
content: args.documentBase64,
|
|
13
12
|
...(args.filename ? { filename: args.filename } : {}),
|
|
14
13
|
})));
|
|
@@ -17,6 +16,6 @@ export function registerDocumentTools(server) {
|
|
|
17
16
|
description: 'Get presigned download URLs for a transaction’s document and signed artifacts.',
|
|
18
17
|
inputSchema: transactionIdShape,
|
|
19
18
|
annotations: READ_ONLY,
|
|
20
|
-
}, async (args) => run(() =>
|
|
19
|
+
}, async (args) => run(() => ctx.client.documents.download(args.transactionId)));
|
|
21
20
|
}
|
|
22
21
|
//# sourceMappingURL=documents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/tools/documents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/tools/documents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExE,MAAM,UAAU,qBAAqB,CAAC,MAAiB,EAAE,GAAgB;IACvE,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;QACE,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,gGAAgG;QAC7G,WAAW,EAAE,mBAAmB;QAChC,WAAW,EAAE,UAAU;KACxB,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CACb,GAAG,CAAC,GAAG,EAAE,CACP,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE;QAC9C,OAAO,EAAE,IAAI,CAAC,cAAc;QAC5B,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtD,CAAC,CACH,CACJ,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;QACE,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,gFAAgF;QAC7F,WAAW,EAAE,kBAAkB;QAC/B,WAAW,EAAE,SAAS;KACvB,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAC7E,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
|
|
2
|
+
import type { ToolContext } from '../client.js';
|
|
3
|
+
export declare function registerEnvelopeTools(server: McpServer, ctx: ToolContext): void;
|
package/dist/tools/envelopes.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildSigningUrl } from '../client.js';
|
|
2
2
|
import { CONFIRM_WARNING, DESTRUCTIVE, READ_ONLY } from '../annotations.js';
|
|
3
3
|
import { run, idempotencyKey } from './helpers.js';
|
|
4
4
|
import { createEnvelopeShape, envelopeIdShape, addEnvelopeSessionShape } from '../schemas.js';
|
|
5
|
-
export function registerEnvelopeTools(server) {
|
|
5
|
+
export function registerEnvelopeTools(server, ctx) {
|
|
6
6
|
server.registerTool('create_envelope', {
|
|
7
7
|
title: 'Create envelope',
|
|
8
8
|
description: CONFIRM_WARNING +
|
|
@@ -22,14 +22,14 @@ export function registerEnvelopeTools(server) {
|
|
|
22
22
|
...(args.expiresInMinutes ? { expiresInMinutes: args.expiresInMinutes } : {}),
|
|
23
23
|
...(args.owner ? { owner: args.owner } : {}),
|
|
24
24
|
};
|
|
25
|
-
return
|
|
25
|
+
return ctx.client.envelopes.create(req, idempotencyKey(args.idempotencyKey));
|
|
26
26
|
}));
|
|
27
27
|
server.registerTool('get_envelope', {
|
|
28
28
|
title: 'Get envelope',
|
|
29
29
|
description: 'Get envelope details including per-signer session summaries and completion counts.',
|
|
30
30
|
inputSchema: envelopeIdShape,
|
|
31
31
|
annotations: READ_ONLY,
|
|
32
|
-
}, async (args) => run(() =>
|
|
32
|
+
}, async (args) => run(() => ctx.client.envelopes.get(args.envelopeId)));
|
|
33
33
|
server.registerTool('add_session_to_envelope', {
|
|
34
34
|
title: 'Add signer to envelope',
|
|
35
35
|
description: CONFIRM_WARNING +
|
|
@@ -46,7 +46,7 @@ export function registerEnvelopeTools(server) {
|
|
|
46
46
|
...(args.cancelUrl ? { cancelUrl: args.cancelUrl } : {}),
|
|
47
47
|
...(args.metadata ? { metadata: args.metadata } : {}),
|
|
48
48
|
};
|
|
49
|
-
const session = await
|
|
49
|
+
const session = await ctx.client.envelopes.addSession(args.envelopeId, req);
|
|
50
50
|
return { ...session, signingUrl: buildSigningUrl(session.url, session.clientSecret) };
|
|
51
51
|
}));
|
|
52
52
|
server.registerTool('get_envelope_combined_stamp', {
|
|
@@ -54,6 +54,6 @@ export function registerEnvelopeTools(server) {
|
|
|
54
54
|
description: 'Generate the combined stamped PDF (all signers) for a COMPLETED envelope and return a download URL.',
|
|
55
55
|
inputSchema: envelopeIdShape,
|
|
56
56
|
annotations: READ_ONLY,
|
|
57
|
-
}, async (args) => run(() =>
|
|
57
|
+
}, async (args) => run(() => ctx.client.envelopes.combinedStamp(args.envelopeId)));
|
|
58
58
|
}
|
|
59
59
|
//# sourceMappingURL=envelopes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envelopes.js","sourceRoot":"","sources":["../../src/tools/envelopes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"envelopes.js","sourceRoot":"","sources":["../../src/tools/envelopes.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE9F,MAAM,UAAU,qBAAqB,CAAC,MAAiB,EAAE,GAAgB;IACvE,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;QAC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AE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACtD,CAAC;QACF,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QAC5E,OAAO,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;IACxF,CAAC,CAAC,CACL,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,6BAA6B,EAC7B;QACE,KAAK,EAAE,6BAA6B;QACpC,WAAW,EACT,qGAAqG;QACvG,WAAW,EAAE,eAAe;QAC5B,WAAW,EAAE,SAAS;KACvB,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAC/E,CAAC;AACJ,CAAC"}
|
package/dist/tools/evidence.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
|
|
2
|
+
import type { ToolContext } from '../client.js';
|
|
3
|
+
export declare function registerEvidenceTools(server: McpServer, ctx: ToolContext): void;
|
package/dist/tools/evidence.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { getClient } from '../client.js';
|
|
2
1
|
import { READ_ONLY } from '../annotations.js';
|
|
3
2
|
import { run } from './helpers.js';
|
|
4
3
|
import { transactionIdShape } from '../schemas.js';
|
|
5
|
-
export function registerEvidenceTools(server) {
|
|
4
|
+
export function registerEvidenceTools(server, ctx) {
|
|
6
5
|
server.registerTool('get_evidence', {
|
|
7
6
|
title: 'Get evidence',
|
|
8
7
|
description: 'Retrieve the cryptographic evidence (hashes, step proofs, evidenceId) for a completed transaction.',
|
|
9
8
|
inputSchema: transactionIdShape,
|
|
10
9
|
annotations: READ_ONLY,
|
|
11
|
-
}, async (args) => run(() =>
|
|
10
|
+
}, async (args) => run(() => ctx.client.evidence.get(args.transactionId)));
|
|
12
11
|
}
|
|
13
12
|
//# sourceMappingURL=evidence.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evidence.js","sourceRoot":"","sources":["../../src/tools/evidence.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"evidence.js","sourceRoot":"","sources":["../../src/tools/evidence.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,UAAU,qBAAqB,CAAC,MAAiB,EAAE,GAAgB;IACvE,MAAM,CAAC,YAAY,CACjB,cAAc,EACd;QACE,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,oGAAoG;QACtG,WAAW,EAAE,kBAAkB;QAC/B,WAAW,EAAE,SAAS;KACvB,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CACvE,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
|
|
2
|
+
import type { ToolContext } from '../client.js';
|
|
3
|
+
export declare function registerSigningSessionTools(server: McpServer, ctx: ToolContext): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildSigningUrl } from '../client.js';
|
|
2
2
|
import { CONFIRM_WARNING, DESTRUCTIVE, READ_ONLY, WRITE_SAFE } from '../annotations.js';
|
|
3
3
|
import { run, idempotencyKey } from './helpers.js';
|
|
4
4
|
import { createSigningSessionShape, sessionIdShape, listSigningSessionsShape, resendOtpShape, } from '../schemas.js';
|
|
5
|
-
export function registerSigningSessionTools(server) {
|
|
5
|
+
export function registerSigningSessionTools(server, ctx) {
|
|
6
6
|
server.registerTool('create_signing_session', {
|
|
7
7
|
title: 'Create signing session',
|
|
8
8
|
description: CONFIRM_WARNING +
|
|
@@ -29,7 +29,7 @@ export function registerSigningSessionTools(server) {
|
|
|
29
29
|
...(args.expiresInMinutes ? { expiresInMinutes: args.expiresInMinutes } : {}),
|
|
30
30
|
...(args.owner ? { owner: args.owner } : {}),
|
|
31
31
|
};
|
|
32
|
-
const session = await
|
|
32
|
+
const session = await ctx.client.signingSessions.create(req, idempotencyKey(args.idempotencyKey));
|
|
33
33
|
return { ...session, signingUrl: buildSigningUrl(session.url, session.clientSecret) };
|
|
34
34
|
}));
|
|
35
35
|
server.registerTool('get_signing_session_status', {
|
|
@@ -37,19 +37,19 @@ export function registerSigningSessionTools(server) {
|
|
|
37
37
|
description: 'Poll the current status of a signing session (ACTIVE/COMPLETED/CANCELLED/EXPIRED/FAILED).',
|
|
38
38
|
inputSchema: sessionIdShape,
|
|
39
39
|
annotations: READ_ONLY,
|
|
40
|
-
}, async (args) => run(() =>
|
|
40
|
+
}, async (args) => run(() => ctx.client.signingSessions.getStatus(args.sessionId)));
|
|
41
41
|
server.registerTool('get_signing_session', {
|
|
42
42
|
title: 'Get signing session details',
|
|
43
43
|
description: 'Get full bootstrap data for a signing session (signer, steps, document, appearance).',
|
|
44
44
|
inputSchema: sessionIdShape,
|
|
45
45
|
annotations: READ_ONLY,
|
|
46
|
-
}, async (args) => run(() =>
|
|
46
|
+
}, async (args) => run(() => ctx.client.signingSessions.get(args.sessionId)));
|
|
47
47
|
server.registerTool('list_signing_sessions', {
|
|
48
48
|
title: 'List signing sessions',
|
|
49
49
|
description: 'List signing sessions filtered by status, with cursor pagination.',
|
|
50
50
|
inputSchema: listSigningSessionsShape,
|
|
51
51
|
annotations: READ_ONLY,
|
|
52
|
-
}, async (args) => run(() =>
|
|
52
|
+
}, async (args) => run(() => ctx.client.signingSessions.list({
|
|
53
53
|
status: args.status,
|
|
54
54
|
...(args.limit !== undefined ? { limit: args.limit } : {}),
|
|
55
55
|
...(args.cursor ? { cursor: args.cursor } : {}),
|
|
@@ -59,12 +59,12 @@ export function registerSigningSessionTools(server) {
|
|
|
59
59
|
description: CONFIRM_WARNING + 'Cancel an active signing session. This cannot be undone.',
|
|
60
60
|
inputSchema: sessionIdShape,
|
|
61
61
|
annotations: DESTRUCTIVE,
|
|
62
|
-
}, async (args) => run(() =>
|
|
62
|
+
}, async (args) => run(() => ctx.client.signingSessions.cancel(args.sessionId)));
|
|
63
63
|
server.registerTool('resend_signing_session_otp', {
|
|
64
64
|
title: 'Resend signing session OTP',
|
|
65
65
|
description: 'Resend the OTP challenge for a signing session, optionally over a specific channel (email/sms).',
|
|
66
66
|
inputSchema: resendOtpShape,
|
|
67
67
|
annotations: WRITE_SAFE,
|
|
68
|
-
}, async (args) => run(() =>
|
|
68
|
+
}, async (args) => run(() => ctx.client.signingSessions.resendOtp(args.sessionId, args.channel ? { channel: args.channel } : undefined)));
|
|
69
69
|
}
|
|
70
70
|
//# sourceMappingURL=signingSessions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signingSessions.js","sourceRoot":"","sources":["../../src/tools/signingSessions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"signingSessions.js","sourceRoot":"","sources":["../../src/tools/signingSessions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EACL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,iGAAiG;QAC9G,WAAW,EAAE,cAAc;QAC3B,WAAW,EAAE,UAAU;KACxB,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CACb,GAAG,CAAC,GAAG,EAAE,CACP,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAC3G,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
|
|
2
|
+
import type { ToolContext } from '../client.js';
|
|
3
|
+
export declare function registerTransactionTools(server: McpServer, ctx: ToolContext): void;
|