@ampless/mcp-server 0.2.0-alpha.6 → 0.2.0-alpha.7
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/tools/post-mapping.ts
|
|
4
|
+
import { decodeAwsJson } from "ampless";
|
|
4
5
|
var POST_FIELDS = (
|
|
5
6
|
/* GraphQL */
|
|
6
7
|
`
|
|
@@ -18,18 +19,6 @@ var POST_FIELDS = (
|
|
|
18
19
|
}
|
|
19
20
|
`
|
|
20
21
|
);
|
|
21
|
-
function decodeBody(value) {
|
|
22
|
-
if (typeof value !== "string") return value;
|
|
23
|
-
try {
|
|
24
|
-
return JSON.parse(value);
|
|
25
|
-
} catch {
|
|
26
|
-
return value;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function encodeBody(value) {
|
|
30
|
-
if (typeof value === "string") return value;
|
|
31
|
-
return JSON.stringify(value ?? null);
|
|
32
|
-
}
|
|
33
22
|
function toCorePost(p) {
|
|
34
23
|
return {
|
|
35
24
|
siteId: p.siteId,
|
|
@@ -38,7 +27,7 @@ function toCorePost(p) {
|
|
|
38
27
|
title: p.title,
|
|
39
28
|
excerpt: p.excerpt ?? void 0,
|
|
40
29
|
format: p.format ?? "markdown",
|
|
41
|
-
body:
|
|
30
|
+
body: decodeAwsJson(p.body),
|
|
42
31
|
status: p.status ?? "draft",
|
|
43
32
|
publishedAt: p.publishedAt ?? void 0,
|
|
44
33
|
tags: (p.tags ?? []).filter((t) => typeof t === "string")
|
|
@@ -135,7 +124,7 @@ async function getPost(client, defaultSiteId, args) {
|
|
|
135
124
|
}
|
|
136
125
|
|
|
137
126
|
// src/tools/create-post.ts
|
|
138
|
-
import { composeSiteIdStatus, composeSiteIdSlug } from "ampless";
|
|
127
|
+
import { composeSiteIdStatus, composeSiteIdSlug, encodeAwsJson } from "ampless";
|
|
139
128
|
|
|
140
129
|
// src/posttag.ts
|
|
141
130
|
function entries(post) {
|
|
@@ -270,7 +259,7 @@ async function createPost(client, defaultSiteId, args) {
|
|
|
270
259
|
title: args.title,
|
|
271
260
|
excerpt: args.excerpt,
|
|
272
261
|
format: args.format,
|
|
273
|
-
body:
|
|
262
|
+
body: encodeAwsJson(args.body),
|
|
274
263
|
status,
|
|
275
264
|
publishedAt,
|
|
276
265
|
tags: args.tags,
|
|
@@ -285,7 +274,7 @@ async function createPost(client, defaultSiteId, args) {
|
|
|
285
274
|
}
|
|
286
275
|
|
|
287
276
|
// src/tools/update-post.ts
|
|
288
|
-
import { composeSiteIdStatus as composeSiteIdStatus2, composeSiteIdSlug as composeSiteIdSlug2 } from "ampless";
|
|
277
|
+
import { composeSiteIdStatus as composeSiteIdStatus2, composeSiteIdSlug as composeSiteIdSlug2, encodeAwsJson as encodeAwsJson2 } from "ampless";
|
|
289
278
|
var MUTATION2 = (
|
|
290
279
|
/* GraphQL */
|
|
291
280
|
`
|
|
@@ -321,7 +310,7 @@ async function updatePost(client, defaultSiteId, args) {
|
|
|
321
310
|
if (args.title !== void 0) input.title = args.title;
|
|
322
311
|
if (args.excerpt !== void 0) input.excerpt = args.excerpt;
|
|
323
312
|
if (args.format !== void 0) input.format = args.format;
|
|
324
|
-
if (args.body !== void 0) input.body =
|
|
313
|
+
if (args.body !== void 0) input.body = encodeAwsJson2(args.body);
|
|
325
314
|
if (args.status !== void 0) input.status = args.status;
|
|
326
315
|
if (args.publishedAt !== void 0) input.publishedAt = args.publishedAt;
|
|
327
316
|
if (args.tags !== void 0) input.tags = args.tags;
|
package/dist/index.js
CHANGED
package/dist/tools/index.d.ts
CHANGED
|
@@ -40,10 +40,6 @@ declare const tools: ToolDefinition[];
|
|
|
40
40
|
* Look up a tool definition by name and invoke its handler. Returns
|
|
41
41
|
* `null` when no tool with that name is registered — callers should
|
|
42
42
|
* surface that as a JSON-RPC "method not found" error.
|
|
43
|
-
*
|
|
44
|
-
* Shared between the stdio CLI (`src/index.ts`) and the HTTP transport
|
|
45
|
-
* factory (`@ampless/admin/api/mcp` → `createMcpRoute`) so both routes
|
|
46
|
-
* dispatch through the same code path.
|
|
47
43
|
*/
|
|
48
44
|
declare function dispatchToolCall(name: string, args: Record<string, unknown>, ctx: ToolContext): Promise<unknown>;
|
|
49
45
|
/**
|
package/dist/tools/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ampless/mcp-server",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.7",
|
|
4
4
|
"description": "MCP server for ampless — lets AI agents (Claude Desktop, Cursor, Claude Code) read and write posts and media via AppSync",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
36
36
|
"@aws-sdk/client-s3": "^3.1048.0",
|
|
37
37
|
"amazon-cognito-identity-js": "^6.3.12",
|
|
38
|
-
"ampless": "0.2.0-alpha.
|
|
38
|
+
"ampless": "0.2.0-alpha.7"
|
|
39
39
|
},
|
|
40
40
|
"keywords": [
|
|
41
41
|
"ampless",
|