create-ampless 0.2.0-alpha.20 → 0.2.0-alpha.21
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/dist/templates/_shared/AGENTS.ja.md +1 -5
- package/dist/templates/_shared/AGENTS.md +1 -5
- package/dist/templates/_shared/README.ja.md +0 -3
- package/dist/templates/_shared/README.md +0 -3
- package/dist/templates/_shared/amplify/backend.ts +2 -0
- package/dist/templates/_shared/amplify/functions/mcp-handler/handler.ts +1 -0
- package/dist/templates/_shared/amplify/functions/mcp-handler/resource.ts +11 -0
- package/dist/templates/_shared/package.json +2 -2
- package/package.json +1 -1
- package/dist/templates/_shared/app/api/admin/mcp-tokens/route.ts +0 -6
- package/dist/templates/_shared/app/api/mcp/route.ts +0 -9
|
@@ -60,9 +60,7 @@
|
|
|
60
60
|
|
|
61
61
|
エージェントが投稿コンテンツを直接クエリ・編集できる。公開ツール: `list_posts`、`get_post`、`create_post`、`update_post`、`delete_post`、`upload_media`、`get_schema`。
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
**ローカル stdio(Claude Code / Cursor 向け、推奨):**
|
|
63
|
+
登録方法:
|
|
66
64
|
|
|
67
65
|
プロジェクトルートの `.mcp.json` に追加する:
|
|
68
66
|
```json
|
|
@@ -80,8 +78,6 @@
|
|
|
80
78
|
}
|
|
81
79
|
```
|
|
82
80
|
|
|
83
|
-
**管理者発行トークンによる HTTP**(ホスト型エージェント向け): `/admin/mcp-tokens` で Bearer トークンを発行し、エージェントクライアントを公開 MCP HTTP エンドポイントに向ける。エンドポイント URL は管理 UI で確認できる。
|
|
84
|
-
|
|
85
81
|
投稿本文は `markdown`、`html`、`tiptap`(JSON ドキュメント)の 3 フォーマットに対応している。
|
|
86
82
|
|
|
87
83
|
## 動作確認の基準
|
|
@@ -60,9 +60,7 @@ This file is written for AI coding agents (Claude Code, Cursor, Codex, etc.). Fo
|
|
|
60
60
|
|
|
61
61
|
Lets agents query and modify post content directly. Tools exposed: `list_posts`, `get_post`, `create_post`, `update_post`, `delete_post`, `upload_media`, `get_schema`.
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
**Local stdio (recommended for Claude Code / Cursor):**
|
|
63
|
+
Registration:
|
|
66
64
|
|
|
67
65
|
Add to `.mcp.json` at the project root:
|
|
68
66
|
```json
|
|
@@ -80,8 +78,6 @@ Add to `.mcp.json` at the project root:
|
|
|
80
78
|
}
|
|
81
79
|
```
|
|
82
80
|
|
|
83
|
-
**HTTP via admin-issued token** (for hosted agents): issue a Bearer token at `/admin/mcp-tokens` and point the agent client at the public MCP HTTP endpoint. See the admin UI for the exact endpoint URL.
|
|
84
|
-
|
|
85
81
|
Post bodies accept three formats: `markdown`, `html`, or `tiptap` (JSON document).
|
|
86
82
|
|
|
87
83
|
## Verification expectations
|
|
@@ -137,8 +137,6 @@ export default defineConfig({
|
|
|
137
137
|
| 変数 | 利用箇所 |
|
|
138
138
|
| --- | --- |
|
|
139
139
|
| `WEBHOOK_SECRET` | `@ampless/plugin-webhook` の HMAC 署名 |
|
|
140
|
-
| `AMPLESS_MCP_SERVICE_EMAIL` | HTTP MCP サービスユーザーのメール — `/api/mcp` を有効化するのに必須 |
|
|
141
|
-
| `AMPLESS_MCP_SERVICE_PASSWORD` | HTTP MCP サービスユーザーのパスワード |
|
|
142
140
|
|
|
143
141
|
env 変数追加 / 変更後は再デプロイをトリガーしてください。
|
|
144
142
|
|
|
@@ -157,7 +155,6 @@ ampless は 1 つの Amplify Hosting デプロイで複数のサイトを配信
|
|
|
157
155
|
ampless は MCP(Model Context Protocol)サーバーを同梱しているので、Claude Desktop / Cursor / Claude Code など MCP に対応した AI クライアントから投稿の読み書きができます。
|
|
158
156
|
|
|
159
157
|
- **ローカル / sandbox** — グローバルに 1 度入れる: `npx -y @ampless/mcp-server@alpha` に `amplify_outputs.json` のパスを渡す
|
|
160
|
-
- **本番(HTTP)** — `/admin/mcp-tokens` で Bearer トークンを発行し、MCP クライアントを `https://<your-domain>/api/mcp` に向ける。フルセットアップ: [docs/mcp-http-setup.ja.md](https://github.com/heavymoons/ampless/blob/main/docs/mcp-http-setup.ja.md) ([English](https://github.com/heavymoons/ampless/blob/main/docs/mcp-http-setup.md))
|
|
161
158
|
|
|
162
159
|
## ampless の更新
|
|
163
160
|
|
|
@@ -137,8 +137,6 @@ Set per-environment values in **Amplify Hosting console → Hosting → Environm
|
|
|
137
137
|
| Variable | Used by |
|
|
138
138
|
| --- | --- |
|
|
139
139
|
| `WEBHOOK_SECRET` | `@ampless/plugin-webhook` HMAC signing |
|
|
140
|
-
| `AMPLESS_MCP_SERVICE_EMAIL` | HTTP MCP service-user email — required to enable `/api/mcp` |
|
|
141
|
-
| `AMPLESS_MCP_SERVICE_PASSWORD` | HTTP MCP service-user password |
|
|
142
140
|
|
|
143
141
|
Trigger a redeploy after adding/changing env vars.
|
|
144
142
|
|
|
@@ -157,7 +155,6 @@ There's a caching trade-off in multi-site mode; details in [RUNBOOK.md → Multi
|
|
|
157
155
|
ampless ships an MCP (Model Context Protocol) server so Claude Desktop / Cursor / Claude Code / anything that speaks MCP can read and write your posts.
|
|
158
156
|
|
|
159
157
|
- **Local / sandbox** — install once globally: `npx -y @ampless/mcp-server@alpha` with the path to your `amplify_outputs.json`.
|
|
160
|
-
- **Production (HTTP)** — issue a Bearer token at `/admin/mcp-tokens` and point your MCP client at `https://<your-domain>/api/mcp`. Full setup: [docs/mcp-http-setup.md](https://github.com/heavymoons/ampless/blob/main/docs/mcp-http-setup.md) ([日本語](https://github.com/heavymoons/ampless/blob/main/docs/mcp-http-setup.ja.md)).
|
|
161
158
|
|
|
162
159
|
## Updating ampless
|
|
163
160
|
|
|
@@ -8,6 +8,7 @@ import { eventDispatcher } from './events/dispatcher/resource.js'
|
|
|
8
8
|
import { processorTrusted } from './events/processor-trusted/resource.js'
|
|
9
9
|
import { processorUntrusted } from './events/processor-untrusted/resource.js'
|
|
10
10
|
import { apiKeyRenewer } from './functions/api-key-renewer/resource.js'
|
|
11
|
+
import { mcpHandler } from './functions/mcp-handler/resource.js'
|
|
11
12
|
import { userAdmin } from './functions/user-admin/resource.js'
|
|
12
13
|
import { customizeBackend } from './backend.custom.js'
|
|
13
14
|
|
|
@@ -27,6 +28,7 @@ const backend = defineAmplessBackend({
|
|
|
27
28
|
processorTrusted,
|
|
28
29
|
processorUntrusted,
|
|
29
30
|
apiKeyRenewer,
|
|
31
|
+
mcpHandler,
|
|
30
32
|
userAdmin,
|
|
31
33
|
})
|
|
32
34
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { handler } from '@ampless/backend/functions/mcp-handler'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineFunction } from '@aws-amplify/backend'
|
|
2
|
+
|
|
3
|
+
export const mcpHandler = defineFunction({
|
|
4
|
+
name: 'mcp-handler',
|
|
5
|
+
entry: './handler.ts',
|
|
6
|
+
// Co-locate with the data stack so the function has the KvStore
|
|
7
|
+
// table ARN available without cross-stack references at synth time.
|
|
8
|
+
resourceGroupName: 'data',
|
|
9
|
+
memoryMB: 512,
|
|
10
|
+
timeoutSeconds: 30,
|
|
11
|
+
})
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@ampless/plugin-rss": "^0.2.0-alpha.6",
|
|
27
27
|
"@ampless/plugin-seo": "^0.2.0-alpha.6",
|
|
28
28
|
"@ampless/plugin-webhook": "^0.2.0-alpha.6",
|
|
29
|
-
"@ampless/admin": "^0.2.0-alpha.
|
|
30
|
-
"@ampless/backend": "^0.2.0-alpha.
|
|
29
|
+
"@ampless/admin": "^0.2.0-alpha.19",
|
|
30
|
+
"@ampless/backend": "^0.2.0-alpha.9",
|
|
31
31
|
"@ampless/runtime": "^0.2.0-alpha.9",
|
|
32
32
|
"@digital-go-jp/tailwind-theme-plugin": "^0.3.4",
|
|
33
33
|
"ampless": "^0.2.0-alpha.6",
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { admin } from '@/lib/admin'
|
|
2
|
-
import { createMcpRoute } from '@ampless/admin/api'
|
|
3
|
-
|
|
4
|
-
// `force-dynamic` keeps CloudFront from caching MCP responses. Each
|
|
5
|
-
// tool call must hit the SSR Lambda — caching would serve stale or
|
|
6
|
-
// cross-token responses.
|
|
7
|
-
export const dynamic = 'force-dynamic'
|
|
8
|
-
export const runtime = 'nodejs'
|
|
9
|
-
export const { POST } = createMcpRoute(admin)
|