create-multicast 0.4.2 → 0.4.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-multicast",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Create a Multicast MCP gateway — one command to scaffold, configure, and deploy your parallel MCP server.",
5
5
  "type": "module",
6
6
  "bin": "./dist/cli.js",
@@ -1024,6 +1024,86 @@ export default {
1024
1024
  );
1025
1025
  }
1026
1026
 
1027
+ // Status endpoint — full server + tool listing
1028
+ // Use: curl https://your-multicast.workers.dev/status
1029
+ // Or: curl https://your-multicast.workers.dev/status | jq .
1030
+ if (url.pathname === "/status") {
1031
+ try {
1032
+ const registry = getRegisteredServers(env);
1033
+ const db = env.DB;
1034
+
1035
+ const servers = await db
1036
+ .prepare(
1037
+ "SELECT name, url, status, tool_count, last_error, last_discovered_at FROM servers ORDER BY name"
1038
+ )
1039
+ .all<{
1040
+ name: string;
1041
+ url: string;
1042
+ status: string;
1043
+ tool_count: number;
1044
+ last_error: string | null;
1045
+ last_discovered_at: string | null;
1046
+ }>();
1047
+
1048
+ const serverDetails = [];
1049
+ for (const server of servers.results) {
1050
+ // Only include servers that are in the current registry
1051
+ if (!registry.has(server.name)) continue;
1052
+
1053
+ const regServer = registry.get(server.name)!;
1054
+ const tools = await db
1055
+ .prepare(
1056
+ "SELECT tool_name, description FROM tools WHERE server_name = ? ORDER BY tool_name"
1057
+ )
1058
+ .bind(server.name)
1059
+ .all<{ tool_name: string; description: string }>();
1060
+
1061
+ serverDetails.push({
1062
+ name: server.name,
1063
+ url: server.url,
1064
+ status: server.status,
1065
+ auth: regServer.isOAuth ? "oauth" : regServer.auth ? "static" : "none",
1066
+ tool_count: server.tool_count,
1067
+ last_error: server.last_error,
1068
+ last_discovered: server.last_discovered_at,
1069
+ tools: tools.results.map((t) => ({
1070
+ name: t.tool_name,
1071
+ description: t.description.slice(0, 120) + (t.description.length > 120 ? "..." : ""),
1072
+ })),
1073
+ });
1074
+ }
1075
+
1076
+ const totalTools = serverDetails.reduce((sum, s) => sum + s.tool_count, 0);
1077
+
1078
+ return new Response(
1079
+ JSON.stringify(
1080
+ {
1081
+ name: "Multicast",
1082
+ version: "0.4.2",
1083
+ description: "MCP gateway — one integration, all your servers, parallel execution",
1084
+ total_servers: serverDetails.length,
1085
+ total_tools: totalTools,
1086
+ servers: serverDetails,
1087
+ },
1088
+ null,
1089
+ 2
1090
+ ),
1091
+ {
1092
+ headers: {
1093
+ "Content-Type": "application/json",
1094
+ "Access-Control-Allow-Origin": "*",
1095
+ },
1096
+ }
1097
+ );
1098
+ } catch (err: unknown) {
1099
+ const message = err instanceof Error ? err.message : "unknown error";
1100
+ return new Response(
1101
+ JSON.stringify({ error: message }),
1102
+ { status: 500, headers: { "Content-Type": "application/json" } }
1103
+ );
1104
+ }
1105
+ }
1106
+
1027
1107
  // Return clean 404 for OAuth discovery and other non-MCP paths
1028
1108
  // Claude Code's HTTP transport probes /.well-known/oauth-authorization-server
1029
1109
  // If this returns a JSON-RPC error, Claude Code's OAuth parser breaks.