convex-mcp-visual 1.0.7 → 1.0.9
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 +51 -931
- package/dist/apps/apps/realtime-dashboard/index.html +1 -1
- package/dist/apps/apps/schema-browser/index.html +1 -1
- package/dist/apps/assets/{realtime-dashboard-BPA99DZn.js → realtime-dashboard-BKgb9FSM.js} +13 -13
- package/dist/apps/assets/{schema-browser-BEcF8hRP.js → schema-browser-DIJDjZTI.js} +18 -5
- package/dist/convex-client.d.ts +36 -8
- package/dist/convex-client.d.ts.map +1 -1
- package/dist/convex-client.js +268 -88
- package/dist/convex-client.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +157 -23
- package/dist/index.js.map +1 -1
- package/dist/resources/schema-browser.js +7 -6
- package/dist/resources/schema-browser.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +38 -38
- package/dist/server.js.map +1 -1
- package/dist/tools/dashboard.d.ts +2 -2
- package/dist/tools/dashboard.d.ts.map +1 -1
- package/dist/tools/dashboard.js +109 -87
- package/dist/tools/dashboard.js.map +1 -1
- package/dist/tools/schema-browser.d.ts +2 -2
- package/dist/tools/schema-browser.d.ts.map +1 -1
- package/dist/tools/schema-browser.js +93 -68
- package/dist/tools/schema-browser.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,41 +1,49 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Convex MCP
|
|
3
|
+
* Convex MCP Visual Server
|
|
4
4
|
*
|
|
5
5
|
* An MCP server that provides interactive UI components for exploring Convex databases.
|
|
6
6
|
* Supports stdio (default) and HTTP transports.
|
|
7
7
|
*/
|
|
8
|
-
import { createServer } from
|
|
9
|
-
import { parseArgs } from
|
|
8
|
+
import { createServer } from "./server.js";
|
|
9
|
+
import { parseArgs } from "util";
|
|
10
|
+
import { writeFileSync, existsSync, readFileSync } from "fs";
|
|
11
|
+
import { join } from "path";
|
|
12
|
+
import { homedir } from "os";
|
|
13
|
+
import { createInterface } from "readline";
|
|
14
|
+
const CONFIG_FILE = join(homedir(), ".convex-mcp-visual.json");
|
|
10
15
|
async function main() {
|
|
11
16
|
const { values } = parseArgs({
|
|
12
17
|
options: {
|
|
13
|
-
stdio: { type:
|
|
14
|
-
http: { type:
|
|
15
|
-
port: { type:
|
|
16
|
-
test: { type:
|
|
17
|
-
|
|
18
|
+
stdio: { type: "boolean", default: false },
|
|
19
|
+
http: { type: "boolean", default: false },
|
|
20
|
+
port: { type: "string", default: "3001" },
|
|
21
|
+
test: { type: "boolean", default: false },
|
|
22
|
+
setup: { type: "boolean", default: false },
|
|
23
|
+
help: { type: "boolean", short: "h", default: false },
|
|
18
24
|
},
|
|
19
25
|
allowPositionals: false,
|
|
20
26
|
});
|
|
21
27
|
if (values.help) {
|
|
22
28
|
console.log(`
|
|
23
|
-
Convex MCP
|
|
29
|
+
Convex MCP Visual Server
|
|
24
30
|
|
|
25
31
|
Usage:
|
|
26
|
-
convex-mcp-
|
|
32
|
+
convex-mcp-visual [options]
|
|
27
33
|
|
|
28
34
|
Options:
|
|
29
35
|
--stdio Run in stdio mode (default if no mode specified)
|
|
30
36
|
--http Run in HTTP mode
|
|
31
37
|
--port <num> Port for HTTP mode (default: 3001)
|
|
32
38
|
--test Run connection test and exit
|
|
39
|
+
--setup Interactive setup wizard for deploy key
|
|
33
40
|
-h, --help Show this help message
|
|
34
41
|
|
|
35
42
|
Examples:
|
|
36
|
-
convex-mcp-
|
|
37
|
-
convex-mcp-
|
|
38
|
-
convex-mcp-
|
|
43
|
+
convex-mcp-visual --stdio # For Claude Code/Desktop
|
|
44
|
+
convex-mcp-visual --http --port 3001 # For team deployments
|
|
45
|
+
convex-mcp-visual --test # Test Convex connection
|
|
46
|
+
convex-mcp-visual --setup # Setup deploy key
|
|
39
47
|
|
|
40
48
|
Environment Variables:
|
|
41
49
|
CONVEX_URL Override deployment URL
|
|
@@ -44,50 +52,176 @@ Environment Variables:
|
|
|
44
52
|
`);
|
|
45
53
|
process.exit(0);
|
|
46
54
|
}
|
|
55
|
+
if (values.setup) {
|
|
56
|
+
await runSetupWizard();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
47
59
|
if (values.test) {
|
|
48
60
|
await runConnectionTest();
|
|
49
61
|
return;
|
|
50
62
|
}
|
|
51
63
|
const server = await createServer();
|
|
52
64
|
if (values.http) {
|
|
53
|
-
const port = parseInt(values.port ||
|
|
65
|
+
const port = parseInt(values.port || "3001", 10);
|
|
54
66
|
await server.startHttp(port);
|
|
55
|
-
console.error(`Convex MCP
|
|
67
|
+
console.error(`Convex MCP Visual server running on http://localhost:${port}/mcp`);
|
|
56
68
|
}
|
|
57
69
|
else {
|
|
58
70
|
// Default to stdio mode
|
|
59
71
|
await server.startStdio();
|
|
60
|
-
console.error(
|
|
72
|
+
console.error("Convex MCP Visual server running in stdio mode");
|
|
61
73
|
}
|
|
62
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Interactive setup wizard for deploy key configuration
|
|
77
|
+
*/
|
|
78
|
+
async function runSetupWizard() {
|
|
79
|
+
console.log("\nConvex MCP Visual Setup\n");
|
|
80
|
+
console.log("This wizard will help you configure your Convex deploy key.\n");
|
|
81
|
+
// Check existing config
|
|
82
|
+
let existingConfig = {};
|
|
83
|
+
if (existsSync(CONFIG_FILE)) {
|
|
84
|
+
try {
|
|
85
|
+
existingConfig = JSON.parse(readFileSync(CONFIG_FILE, "utf-8"));
|
|
86
|
+
console.log(`Found existing config at ${CONFIG_FILE}`);
|
|
87
|
+
if (existingConfig.deploymentUrl) {
|
|
88
|
+
console.log(` Current deployment: ${existingConfig.deploymentUrl}\n`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
// Ignore parse errors
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const rl = createInterface({
|
|
96
|
+
input: process.stdin,
|
|
97
|
+
output: process.stdout,
|
|
98
|
+
});
|
|
99
|
+
const question = (prompt) => {
|
|
100
|
+
return new Promise((resolve) => {
|
|
101
|
+
rl.question(prompt, resolve);
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
console.log("Steps to get your deploy key:");
|
|
105
|
+
console.log("1. Go to https://dashboard.convex.dev");
|
|
106
|
+
console.log("2. Select your project");
|
|
107
|
+
console.log("3. Go to Settings > Deploy Keys");
|
|
108
|
+
console.log('4. Click "Generate Deploy Key"');
|
|
109
|
+
console.log("5. Copy the full key (format: prod:deployment-name|key...)\n");
|
|
110
|
+
// Ask if user wants to open the dashboard
|
|
111
|
+
const openDashboard = await question("Open Convex dashboard in browser? (y/n): ");
|
|
112
|
+
if (openDashboard.toLowerCase() === "y") {
|
|
113
|
+
const { exec } = await import("child_process");
|
|
114
|
+
const platform = process.platform;
|
|
115
|
+
const url = "https://dashboard.convex.dev";
|
|
116
|
+
if (platform === "darwin") {
|
|
117
|
+
exec(`open "${url}"`);
|
|
118
|
+
}
|
|
119
|
+
else if (platform === "win32") {
|
|
120
|
+
exec(`start "" "${url}"`);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
exec(`xdg-open "${url}"`);
|
|
124
|
+
}
|
|
125
|
+
console.log("\nOpened dashboard in browser.\n");
|
|
126
|
+
}
|
|
127
|
+
// Prompt for deploy key
|
|
128
|
+
const deployKey = await question("Paste your deploy key: ");
|
|
129
|
+
rl.close();
|
|
130
|
+
if (!deployKey || deployKey.trim().length === 0) {
|
|
131
|
+
console.log("\nNo deploy key provided. Setup cancelled.");
|
|
132
|
+
process.exit(1);
|
|
133
|
+
}
|
|
134
|
+
// Parse the deploy key
|
|
135
|
+
const trimmedKey = deployKey.trim();
|
|
136
|
+
let deploymentUrl = "";
|
|
137
|
+
let adminKey = "";
|
|
138
|
+
if (trimmedKey.includes("|")) {
|
|
139
|
+
const pipeIndex = trimmedKey.indexOf("|");
|
|
140
|
+
const prefix = trimmedKey.substring(0, pipeIndex);
|
|
141
|
+
adminKey = trimmedKey.substring(pipeIndex + 1);
|
|
142
|
+
if (prefix.includes(":")) {
|
|
143
|
+
const colonIndex = prefix.indexOf(":");
|
|
144
|
+
const deploymentName = prefix.substring(colonIndex + 1);
|
|
145
|
+
if (deploymentName) {
|
|
146
|
+
deploymentUrl = `https://${deploymentName}.convex.cloud`;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
adminKey = trimmedKey;
|
|
152
|
+
console.log("\nWarning: Deploy key format not recognized. Expected format: prod:name|key");
|
|
153
|
+
console.log("Saving key as-is, but you may need to set CONVEX_URL separately.\n");
|
|
154
|
+
}
|
|
155
|
+
// Save config
|
|
156
|
+
const config = {
|
|
157
|
+
deploymentUrl: deploymentUrl || existingConfig.deploymentUrl || "",
|
|
158
|
+
adminKey,
|
|
159
|
+
savedAt: new Date().toISOString(),
|
|
160
|
+
};
|
|
161
|
+
try {
|
|
162
|
+
writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
|
|
163
|
+
console.log(`\nConfig saved to ${CONFIG_FILE}`);
|
|
164
|
+
if (deploymentUrl) {
|
|
165
|
+
console.log(` Deployment: ${deploymentUrl}`);
|
|
166
|
+
}
|
|
167
|
+
console.log(" Admin key: ***" + adminKey.slice(-8));
|
|
168
|
+
// Test the connection
|
|
169
|
+
console.log("\nTesting connection...");
|
|
170
|
+
process.env.CONVEX_DEPLOY_KEY = trimmedKey;
|
|
171
|
+
if (deploymentUrl) {
|
|
172
|
+
process.env.CONVEX_URL = deploymentUrl;
|
|
173
|
+
}
|
|
174
|
+
const { ConvexClient } = await import("./convex-client.js");
|
|
175
|
+
const client = new ConvexClient();
|
|
176
|
+
const result = await client.testConnection();
|
|
177
|
+
if (result.success) {
|
|
178
|
+
console.log("[OK] Connection successful!");
|
|
179
|
+
console.log(` Tables found: ${result.tableCount}`);
|
|
180
|
+
console.log("\nSetup complete. You can now use convex-mcp-visual.");
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
console.log("[WARN] Connection test failed:", result.error);
|
|
184
|
+
console.log("Config saved, but you may need to verify your deploy key.");
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
console.error("Failed to save config:", error instanceof Error ? error.message : String(error));
|
|
189
|
+
process.exit(1);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Test connection to Convex deployment
|
|
194
|
+
*/
|
|
63
195
|
async function runConnectionTest() {
|
|
64
|
-
console.log(
|
|
65
|
-
const { ConvexClient } = await import(
|
|
196
|
+
console.log("Testing Convex connection...\n");
|
|
197
|
+
const { ConvexClient } = await import("./convex-client.js");
|
|
66
198
|
const client = new ConvexClient();
|
|
67
199
|
try {
|
|
68
200
|
const result = await client.testConnection();
|
|
69
201
|
if (result.success) {
|
|
70
|
-
console.log(
|
|
202
|
+
console.log("[OK] Connection successful!");
|
|
71
203
|
console.log(` Deployment: ${result.deploymentUrl}`);
|
|
72
204
|
console.log(` Tables found: ${result.tableCount}`);
|
|
73
205
|
if (result.tables && result.tables.length > 0) {
|
|
74
|
-
console.log(` Tables: ${result.tables.slice(0, 5).join(
|
|
206
|
+
console.log(` Tables: ${result.tables.slice(0, 5).join(", ")}${result.tables.length > 5 ? "..." : ""}`);
|
|
75
207
|
}
|
|
208
|
+
console.log(` Admin access: ${client.hasAdminAccess() ? "Yes" : "No (limited functionality)"}`);
|
|
76
209
|
}
|
|
77
210
|
else {
|
|
78
|
-
console.log(
|
|
211
|
+
console.log("[FAIL] Connection failed");
|
|
79
212
|
console.log(` Error: ${result.error}`);
|
|
213
|
+
console.log("\nTry running: convex-mcp-visual --setup");
|
|
80
214
|
process.exit(1);
|
|
81
215
|
}
|
|
82
216
|
}
|
|
83
217
|
catch (error) {
|
|
84
|
-
console.log(
|
|
218
|
+
console.log("[FAIL] Connection failed");
|
|
85
219
|
console.log(` Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
86
220
|
process.exit(1);
|
|
87
221
|
}
|
|
88
222
|
}
|
|
89
223
|
main().catch((error) => {
|
|
90
|
-
console.error(
|
|
224
|
+
console.error("Fatal error:", error);
|
|
91
225
|
process.exit(1);
|
|
92
226
|
});
|
|
93
227
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,yBAAyB,CAAC,CAAC;AAE/D,KAAK,UAAU,IAAI;IACjB,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QAC3B,OAAO,EAAE;YACP,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE;YAC1C,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE;YACzC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE;YACzC,IAAI,EAAE,EAAE,IAAI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,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Serves the bundled Schema Browser HTML UI.
|
|
5
5
|
*/
|
|
6
|
-
import { readFileSync, existsSync } from
|
|
7
|
-
import { join, dirname } from
|
|
8
|
-
import { fileURLToPath } from
|
|
6
|
+
import { readFileSync, existsSync } from "fs";
|
|
7
|
+
import { join, dirname } from "path";
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
9
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
10
|
export async function getSchemaResourceContent() {
|
|
11
11
|
// Try to load the bundled HTML file
|
|
12
|
-
const bundledPath = join(__dirname,
|
|
12
|
+
const bundledPath = join(__dirname, "..", "apps", "schema-browser.html");
|
|
13
13
|
if (existsSync(bundledPath)) {
|
|
14
|
-
return readFileSync(bundledPath,
|
|
14
|
+
return readFileSync(bundledPath, "utf-8");
|
|
15
15
|
}
|
|
16
16
|
// Fallback: return inline HTML for development/testing
|
|
17
17
|
return getInlineSchemaUI();
|
|
@@ -641,7 +641,8 @@ function getInlineSchemaUI() {
|
|
|
641
641
|
},
|
|
642
642
|
|
|
643
643
|
openQueryBuilder() {
|
|
644
|
-
|
|
644
|
+
// Query builder not yet implemented
|
|
645
|
+
console.log('Query builder coming soon');
|
|
645
646
|
}
|
|
646
647
|
};
|
|
647
648
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-browser.js","sourceRoot":"","sources":["../../src/resources/schema-browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAynBD,CAAC;AACT,CAAC"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAsBH,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED,wBAAsB,YAAY,IAAI,OAAO,CAAC,eAAe,CAAC,CA8I7D"}
|
package/dist/server.js
CHANGED
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
* Creates and configures the MCP server with tools and resources
|
|
5
5
|
* for Convex database exploration.
|
|
6
6
|
*/
|
|
7
|
-
import { Server } from
|
|
8
|
-
import { StdioServerTransport } from
|
|
9
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from
|
|
10
|
-
import { createServer as createHttpServer } from
|
|
11
|
-
import { schemaBrowserTool, handleSchemaBrowser } from
|
|
12
|
-
import { dashboardTool, handleDashboard } from
|
|
13
|
-
import { getSchemaResourceContent } from
|
|
14
|
-
import { getDashboardResourceContent } from
|
|
15
|
-
import { ConvexClient } from
|
|
7
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
8
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
9
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
10
|
+
import { createServer as createHttpServer } from "http";
|
|
11
|
+
import { schemaBrowserTool, handleSchemaBrowser, } from "./tools/schema-browser.js";
|
|
12
|
+
import { dashboardTool, handleDashboard } from "./tools/dashboard.js";
|
|
13
|
+
import { getSchemaResourceContent } from "./resources/schema-browser.js";
|
|
14
|
+
import { getDashboardResourceContent } from "./resources/dashboard.js";
|
|
15
|
+
import { ConvexClient } from "./convex-client.js";
|
|
16
16
|
export async function createServer() {
|
|
17
17
|
const convexClient = new ConvexClient();
|
|
18
18
|
const server = new Server({
|
|
19
|
-
name:
|
|
20
|
-
version:
|
|
19
|
+
name: "convex-mcp-visual",
|
|
20
|
+
version: "1.0.8",
|
|
21
21
|
}, {
|
|
22
22
|
capabilities: {
|
|
23
23
|
tools: {},
|
|
@@ -35,10 +35,10 @@ export async function createServer() {
|
|
|
35
35
|
const { name, arguments: args } = request.params;
|
|
36
36
|
let result;
|
|
37
37
|
switch (name) {
|
|
38
|
-
case
|
|
38
|
+
case "schema_browser":
|
|
39
39
|
result = await handleSchemaBrowser(convexClient, args);
|
|
40
40
|
break;
|
|
41
|
-
case
|
|
41
|
+
case "dashboard_view":
|
|
42
42
|
result = await handleDashboard(convexClient, args);
|
|
43
43
|
break;
|
|
44
44
|
default:
|
|
@@ -47,7 +47,7 @@ export async function createServer() {
|
|
|
47
47
|
// Return properly typed response
|
|
48
48
|
return {
|
|
49
49
|
content: result.content.map((c) => ({
|
|
50
|
-
type:
|
|
50
|
+
type: "text",
|
|
51
51
|
text: c.text,
|
|
52
52
|
})),
|
|
53
53
|
isError: result.isError,
|
|
@@ -58,16 +58,16 @@ export async function createServer() {
|
|
|
58
58
|
return {
|
|
59
59
|
resources: [
|
|
60
60
|
{
|
|
61
|
-
uri:
|
|
62
|
-
name:
|
|
63
|
-
description:
|
|
64
|
-
mimeType:
|
|
61
|
+
uri: "ui://schema-browser",
|
|
62
|
+
name: "Schema Browser",
|
|
63
|
+
description: "Interactive UI for browsing Convex database schemas",
|
|
64
|
+
mimeType: "text/html",
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
|
-
uri:
|
|
68
|
-
name:
|
|
69
|
-
description:
|
|
70
|
-
mimeType:
|
|
67
|
+
uri: "ui://dashboard",
|
|
68
|
+
name: "Realtime Dashboard",
|
|
69
|
+
description: "Live charts and metrics for Convex data",
|
|
70
|
+
mimeType: "text/html",
|
|
71
71
|
},
|
|
72
72
|
],
|
|
73
73
|
};
|
|
@@ -75,23 +75,23 @@ export async function createServer() {
|
|
|
75
75
|
// Handle resource reads
|
|
76
76
|
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
77
77
|
const { uri } = request.params;
|
|
78
|
-
if (uri.startsWith(
|
|
78
|
+
if (uri.startsWith("ui://schema-browser")) {
|
|
79
79
|
return {
|
|
80
80
|
contents: [
|
|
81
81
|
{
|
|
82
82
|
uri,
|
|
83
|
-
mimeType:
|
|
83
|
+
mimeType: "text/html",
|
|
84
84
|
text: await getSchemaResourceContent(),
|
|
85
85
|
},
|
|
86
86
|
],
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
if (uri.startsWith(
|
|
89
|
+
if (uri.startsWith("ui://dashboard")) {
|
|
90
90
|
return {
|
|
91
91
|
contents: [
|
|
92
92
|
{
|
|
93
93
|
uri,
|
|
94
|
-
mimeType:
|
|
94
|
+
mimeType: "text/html",
|
|
95
95
|
text: await getDashboardResourceContent(),
|
|
96
96
|
},
|
|
97
97
|
],
|
|
@@ -107,30 +107,30 @@ export async function createServer() {
|
|
|
107
107
|
async startHttp(port) {
|
|
108
108
|
// Simple HTTP transport for MCP
|
|
109
109
|
const httpServer = createHttpServer(async (req, res) => {
|
|
110
|
-
if (req.url ===
|
|
111
|
-
let body =
|
|
112
|
-
req.on(
|
|
113
|
-
req.on(
|
|
110
|
+
if (req.url === "/mcp" && req.method === "POST") {
|
|
111
|
+
let body = "";
|
|
112
|
+
req.on("data", (chunk) => (body += chunk));
|
|
113
|
+
req.on("end", async () => {
|
|
114
114
|
try {
|
|
115
115
|
const request = JSON.parse(body);
|
|
116
116
|
// Process MCP request through server
|
|
117
117
|
// This is a simplified implementation
|
|
118
|
-
res.writeHead(200, {
|
|
119
|
-
res.end(JSON.stringify({ jsonrpc:
|
|
118
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
119
|
+
res.end(JSON.stringify({ jsonrpc: "2.0", id: request.id, result: {} }));
|
|
120
120
|
}
|
|
121
121
|
catch (error) {
|
|
122
|
-
res.writeHead(400, {
|
|
123
|
-
res.end(JSON.stringify({ error:
|
|
122
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
123
|
+
res.end(JSON.stringify({ error: "Invalid request" }));
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
else if (req.url ===
|
|
128
|
-
res.writeHead(200, {
|
|
129
|
-
res.end(JSON.stringify({ status:
|
|
127
|
+
else if (req.url === "/health") {
|
|
128
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
129
|
+
res.end(JSON.stringify({ status: "ok" }));
|
|
130
130
|
}
|
|
131
131
|
else {
|
|
132
132
|
res.writeHead(404);
|
|
133
|
-
res.end(
|
|
133
|
+
res.end("Not found");
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
136
|
return new Promise((resolve) => {
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,GAE1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAExD,OAAO,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,GAE1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAExD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,YAAY,EAA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CAAC;oBAC3D,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBAC5C,CAAC;qBAAM,CAAC;oBACN,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;oBACnB,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;gBAC7B,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YAC3C,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* MCP tool that creates real-time dashboard visualizations
|
|
5
5
|
* for Convex data - both in terminal AND in browser.
|
|
6
6
|
*/
|
|
7
|
-
import type { Tool } from
|
|
8
|
-
import type { ConvexClient } from
|
|
7
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
import type { ConvexClient } from "../convex-client.js";
|
|
9
9
|
export declare const dashboardTool: Tool;
|
|
10
10
|
interface ToolResponse {
|
|
11
11
|
content: Array<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/tools/dashboard.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/tools/dashboard.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD,eAAO,MAAM,aAAa,EAAE,IA0E3B,CAAC;AAEF,UAAU,YAAY;IACpB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAmBD,wBAAsB,eAAe,CACnC,MAAM,EAAE,YAAY,EACpB,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACjC,OAAO,CAAC,YAAY,CAAC,CAgIvB"}
|