@voltagent/server-core 1.0.33 → 1.0.35

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/index.js CHANGED
@@ -4077,6 +4077,9 @@ var DEFAULT_PUBLIC_ROUTES = [
4077
4077
  // List all workflows
4078
4078
  "GET /workflows/:id",
4079
4079
  // Get workflow details
4080
+ // Tool management endpoints
4081
+ "GET /tools",
4082
+ // List all tools
4080
4083
  // API documentation
4081
4084
  "GET /doc",
4082
4085
  // OpenAPI spec
@@ -4110,8 +4113,6 @@ var PROTECTED_ROUTES = [
4110
4113
  // ========================================
4111
4114
  // TOOL EXECUTION (User Data)
4112
4115
  // ========================================
4113
- "GET /tools",
4114
- // List tools (protected by default)
4115
4116
  "POST /tools/:name/execute",
4116
4117
  // ========================================
4117
4118
  // WORKFLOW EXECUTION (User Data)
@@ -4510,7 +4511,7 @@ function printServerStartup(port, options = {}) {
4510
4511
  }
4511
4512
  groupMap.get(groupLabel)?.push(endpoint);
4512
4513
  });
4513
- const methodOrder = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"];
4514
+ const methodOrder = ["STDIO", "GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"];
4514
4515
  groupMap.forEach((endpoints, groupLabel) => {
4515
4516
  console.log();
4516
4517
  console.log(
@@ -4528,12 +4529,14 @@ function printServerStartup(port, options = {}) {
4528
4529
  methodOrder.forEach((method) => {
4529
4530
  if (methodGroups[method]) {
4530
4531
  methodGroups[method].forEach((endpoint) => {
4531
- const pathText = `${colors.white}${endpoint.path}${colors.reset}`;
4532
- const nameText = endpoint.name ? `${colors.dim} (${endpoint.name})${colors.reset}` : "";
4532
+ const isMcpStdio = groupLabel === "MCP Transport" && method === "STDIO";
4533
+ const displayPath = isMcpStdio ? 'uses stdin/stdout. Example client: { type: "stdio", command: "node", args: ["dist/index.js"] }' : endpoint.path;
4534
+ const pathText = `${colors.white}${displayPath}${colors.reset}`;
4535
+ const nameText = endpoint.name && !isMcpStdio ? `${colors.dim} (${endpoint.name})${colors.reset}` : "";
4533
4536
  console.log(
4534
4537
  `${colors.dim} ${method.padEnd(6)} ${colors.reset}${pathText}${nameText}`
4535
4538
  );
4536
- if (endpoint.description) {
4539
+ if (endpoint.description && !isMcpStdio) {
4537
4540
  console.log(`${colors.dim} ${endpoint.description}${colors.reset}`);
4538
4541
  }
4539
4542
  });
@@ -5408,9 +5411,59 @@ var BaseServerProvider = class {
5408
5411
  });
5409
5412
  }, "addRoutes");
5410
5413
  const mcpRegistry = this.deps.mcp?.registry;
5411
- const registeredMcpServers = mcpRegistry && typeof mcpRegistry.list === "function" ? mcpRegistry.list() : [];
5414
+ const registeredMcpServers = mcpRegistry && typeof mcpRegistry.listMetadata === "function" ? mcpRegistry.listMetadata() : [];
5412
5415
  if (registeredMcpServers.length > 0) {
5413
5416
  addRoutes(MCP_ROUTES, "MCP Endpoints");
5417
+ registeredMcpServers.forEach((server) => {
5418
+ const protocols = server.protocols ?? {};
5419
+ const httpEnabled = protocols.http ?? true;
5420
+ const sseEnabled = protocols.sse ?? true;
5421
+ const stdioEnabled = protocols.stdio ?? true;
5422
+ const { httpPath, ssePath, messagePath } = buildMcpRoutePaths(server.id);
5423
+ if (httpEnabled) {
5424
+ const key = `POST ${httpPath}`;
5425
+ if (!seen.has(key)) {
5426
+ seen.add(key);
5427
+ endpoints.push({
5428
+ method: "POST",
5429
+ path: httpPath,
5430
+ group: "MCP Transport"
5431
+ });
5432
+ }
5433
+ }
5434
+ if (stdioEnabled) {
5435
+ const stdioPath = `stdio://${server.id}`;
5436
+ const stdioKey = `STDIO ${stdioPath}`;
5437
+ if (!seen.has(stdioKey)) {
5438
+ seen.add(stdioKey);
5439
+ endpoints.push({
5440
+ method: "STDIO",
5441
+ path: stdioPath,
5442
+ group: "MCP Transport"
5443
+ });
5444
+ }
5445
+ }
5446
+ if (sseEnabled) {
5447
+ const sseKey = `GET ${ssePath}`;
5448
+ if (!seen.has(sseKey)) {
5449
+ seen.add(sseKey);
5450
+ endpoints.push({
5451
+ method: "GET",
5452
+ path: ssePath,
5453
+ group: "MCP Transport"
5454
+ });
5455
+ }
5456
+ const messageKey = `POST ${messagePath}`;
5457
+ if (!seen.has(messageKey)) {
5458
+ seen.add(messageKey);
5459
+ endpoints.push({
5460
+ method: "POST",
5461
+ path: messagePath,
5462
+ group: "MCP Transport"
5463
+ });
5464
+ }
5465
+ }
5466
+ });
5414
5467
  }
5415
5468
  const a2aRegistry = this.deps.a2a?.registry;
5416
5469
  const registeredA2AServers = a2aRegistry && typeof a2aRegistry.list === "function" ? a2aRegistry.list() : [];