@daylight-labs/sharedb-mcp 0.1.5 → 0.1.6
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/tools/auth.js +8 -6
- package/dist/tools/schema.js +9 -0
- package/package.json +1 -1
package/dist/tools/auth.js
CHANGED
|
@@ -23,13 +23,13 @@ async function getEmailIntegrationInfo(appId) {
|
|
|
23
23
|
export const authTools = [
|
|
24
24
|
{
|
|
25
25
|
name: 'get_api_endpoints',
|
|
26
|
-
description: 'Get all ShareDB API endpoints (Auth, PostgREST, Admin).
|
|
26
|
+
description: 'Get all ShareDB API endpoints (Auth, PostgREST, Admin, Email). IMPORTANT: Always pass database_id when working with an existing app - use the staging database ID. This returns table-specific endpoints and integration info (like email). Without database_id, only generic auth endpoints are shown.',
|
|
27
27
|
inputSchema: {
|
|
28
28
|
type: 'object',
|
|
29
29
|
properties: {
|
|
30
30
|
database_id: {
|
|
31
31
|
type: 'string',
|
|
32
|
-
description: '
|
|
32
|
+
description: 'The staging database ID for the app. Always pass this when working with an existing app to get table endpoints and integration info.',
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
required: [],
|
|
@@ -100,30 +100,32 @@ export async function handleAuthTool(name, args) {
|
|
|
100
100
|
emailSection = {
|
|
101
101
|
description: 'Send transactional emails via AWS SES',
|
|
102
102
|
status: enabled ? 'enabled' : 'disabled',
|
|
103
|
-
endpoint: `POST
|
|
103
|
+
endpoint: `POST <API_BASE_URL>/admin/apps/<app_id>/integrations/email/send`,
|
|
104
104
|
authentication: 'Include admin API token: Authorization: Bearer <token>',
|
|
105
105
|
fromAddress: emailInfo.fromAddress,
|
|
106
106
|
rateLimit: `1 email per ${emailInfo.rateLimitSeconds} seconds per app`,
|
|
107
|
+
currentAppId: appId,
|
|
107
108
|
requestBody: {
|
|
108
109
|
to: 'string (required) - recipient email address',
|
|
109
110
|
subject: 'string (required) - email subject line',
|
|
110
111
|
body: 'string (required) - plain text email body',
|
|
111
112
|
html: 'string (optional) - HTML email body',
|
|
112
113
|
},
|
|
113
|
-
example: `fetch(
|
|
114
|
+
example: `fetch(\`\${API_BASE_URL}/admin/apps/\${APP_ID}/integrations/email/send\`, {
|
|
114
115
|
method: 'POST',
|
|
115
116
|
headers: {
|
|
116
117
|
'Content-Type': 'application/json',
|
|
117
|
-
'Authorization':
|
|
118
|
+
'Authorization': \`Bearer \${API_TOKEN}\`
|
|
118
119
|
},
|
|
119
120
|
body: JSON.stringify({
|
|
120
121
|
to: 'user@example.com',
|
|
121
|
-
subject: 'Welcome
|
|
122
|
+
subject: 'Welcome!',
|
|
122
123
|
body: 'Thanks for signing up.',
|
|
123
124
|
html: '<h1>Welcome!</h1><p>Thanks for signing up.</p>'
|
|
124
125
|
})
|
|
125
126
|
})`,
|
|
126
127
|
importantNotes: [
|
|
128
|
+
'Store API_BASE_URL, APP_ID, and API_TOKEN in environment variables or config - never hardcode',
|
|
127
129
|
enabled
|
|
128
130
|
? 'Email integration is ENABLED for this app'
|
|
129
131
|
: 'Email integration is DISABLED - enable it in the Admin UI before sending',
|
package/dist/tools/schema.js
CHANGED
|
@@ -227,12 +227,17 @@ fetch(\`\${API_URL}/todos\`, { headers: { Authorization: \`Bearer \${token}\` }
|
|
|
227
227
|
5. When ready, use the Admin UI to promote schema to production
|
|
228
228
|
6. Use preview_promotion to see what will be promoted
|
|
229
229
|
|
|
230
|
+
## Available Integrations
|
|
231
|
+
|
|
232
|
+
- **Email** - Send transactional emails via AWS SES (supports custom domains)
|
|
233
|
+
|
|
230
234
|
## Next steps
|
|
231
235
|
1. Use stage_change to add tables
|
|
232
236
|
2. Use apply_changes to create them
|
|
233
237
|
3. Use start_postgrest to start the REST API
|
|
234
238
|
4. Implement auth in your app using the Auth API
|
|
235
239
|
5. Query data using the REST API
|
|
240
|
+
6. Enable integrations as needed (email, etc.)
|
|
236
241
|
|
|
237
242
|
---
|
|
238
243
|
**NOTE FOR ASSISTANT:** ShareDB users are often non-technical builders who need guidance through technical steps. When helping them:
|
|
@@ -292,6 +297,10 @@ ${standaloneDbList ? `### Standalone Databases\n${standaloneDbList}` : ''}
|
|
|
292
297
|
|
|
293
298
|
Use get_api_endpoints with database_id for full endpoint documentation.
|
|
294
299
|
|
|
300
|
+
## Available Integrations
|
|
301
|
+
|
|
302
|
+
- **Email** - Send transactional emails via AWS SES (supports custom domains)
|
|
303
|
+
|
|
295
304
|
---
|
|
296
305
|
**NOTE FOR ASSISTANT:** ShareDB users are often non-technical builders. Proactively help them with technical tasks like running commands, starting dev servers, and debugging. Explain things in simple terms.`,
|
|
297
306
|
},
|