@agentic-survey/mcp-server 0.1.0 → 0.1.2
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 +4 -0
- package/dist/cli.js +25 -5
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,6 +47,10 @@ The agent chains the tools for you: `create_survey` → `add_question` → `publ
|
|
|
47
47
|
|
|
48
48
|
> Tip: `npm i -g @agentic-survey/mcp-server` gives you the shorter `agentic-survey init` command.
|
|
49
49
|
|
|
50
|
+
### Do I need to enable RLS / anything in the Supabase dashboard?
|
|
51
|
+
|
|
52
|
+
No. The `init --print-sql` migration enables Row Level Security and the access policies for you, on all four tables. **Don't disable RLS:** it's what fences the publishable key (which travels in the share link) so it can *only* read **published** surveys and **insert** responses. It cannot read anyone's responses or your drafts. Your secret key, stored locally on your machine, bypasses RLS for authoring and analysis.
|
|
53
|
+
|
|
50
54
|
## How it works
|
|
51
55
|
|
|
52
56
|
```
|
package/dist/cli.js
CHANGED
|
@@ -72,13 +72,30 @@ async function runInit(flags) {
|
|
|
72
72
|
existing.secretKey ||
|
|
73
73
|
'';
|
|
74
74
|
const publishableKey = flags['publishable-key'] ||
|
|
75
|
-
(await ask(`Supabase publishable key (sb_publishable_…,
|
|
75
|
+
(await ask(`Supabase publishable key (sb_publishable_…, needed for share links${existing.publishableKey ? ', already set' : ''}): `)) ||
|
|
76
76
|
existing.publishableKey ||
|
|
77
77
|
'';
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
// Page-service: the domain published survey links point at. Default to the
|
|
79
|
+
// hosted instance; let people opt into their own self-hosted/custom domain.
|
|
80
|
+
let pageEndpoint = flags['page-endpoint'] || '';
|
|
81
|
+
if (!pageEndpoint) {
|
|
82
|
+
const current = existing.pageEndpoint ?? DEFAULT_PAGE_ENDPOINT;
|
|
83
|
+
console.log('\nWhich domain do you want your surveys to appear on?');
|
|
84
|
+
console.log(` 1. ${DEFAULT_PAGE_ENDPOINT}/s/your-survey (default, quick start)`);
|
|
85
|
+
console.log(' 2. A custom domain (your own self-hosted page-service)');
|
|
86
|
+
const choice = (await ask(`Choose 1 or 2 [keep ${current}]: `)).trim();
|
|
87
|
+
if (choice === '1') {
|
|
88
|
+
pageEndpoint = DEFAULT_PAGE_ENDPOINT;
|
|
89
|
+
}
|
|
90
|
+
else if (choice === '2') {
|
|
91
|
+
pageEndpoint =
|
|
92
|
+
(await ask('Your page-service base URL (e.g. https://surveys.example.com): ')).trim() ||
|
|
93
|
+
current;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
pageEndpoint = current; // Enter keeps the shown default
|
|
97
|
+
}
|
|
98
|
+
}
|
|
82
99
|
if (!supabaseUrl || !secretKey) {
|
|
83
100
|
console.error('\nA project URL and secret key are required. Aborting.');
|
|
84
101
|
process.exitCode = 1;
|
|
@@ -107,6 +124,9 @@ async function runInit(flags) {
|
|
|
107
124
|
else {
|
|
108
125
|
console.log(`\n✓ Connected. Schema present (${probe.data.length} survey(s)).`);
|
|
109
126
|
}
|
|
127
|
+
if (!publishableKey) {
|
|
128
|
+
console.log("\n⚠ No publishable key set. Share links and response collection won't work until you add one (re-run init).");
|
|
129
|
+
}
|
|
110
130
|
printAgentSnippet();
|
|
111
131
|
}
|
|
112
132
|
async function main() {
|
package/dist/config.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface StoredConfig {
|
|
|
10
10
|
/** Page-service base URL; defaults to the author's hosted instance. */
|
|
11
11
|
pageEndpoint?: string;
|
|
12
12
|
}
|
|
13
|
-
export declare const DEFAULT_PAGE_ENDPOINT = "https://
|
|
13
|
+
export declare const DEFAULT_PAGE_ENDPOINT = "https://www.mcpsurveys.com";
|
|
14
14
|
export declare function configPath(): string;
|
|
15
15
|
/** Derive the Supabase project ref from the project URL. */
|
|
16
16
|
export declare function projectRefFromUrl(url: string): string | undefined;
|
package/dist/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync, writeFileSync, mkdirSync, existsSync, chmodSync } from 'node:fs';
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
3
|
import { dirname, join } from 'node:path';
|
|
4
|
-
export const DEFAULT_PAGE_ENDPOINT = 'https://
|
|
4
|
+
export const DEFAULT_PAGE_ENDPOINT = 'https://www.mcpsurveys.com';
|
|
5
5
|
export function configPath() {
|
|
6
6
|
const base = process.env.AGENTIC_SURVEY_CONFIG ??
|
|
7
7
|
join(process.env.XDG_CONFIG_HOME ?? join(homedir(), '.config'), 'agentic-survey', 'config.json');
|
package/package.json
CHANGED