@last9/mcp-server 0.1.15 → 0.2.0

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.
Files changed (2) hide show
  1. package/README.md +55 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -45,6 +45,7 @@ IDEs. Implements the following MCP
45
45
 
46
46
  **Traces Management:**
47
47
 
48
+ - `get_traces`: Retrieve traces by trace ID or service name with time range filtering.
48
49
  - `get_service_traces`: Query traces for a specific service with filtering options for span kinds, status codes, and other trace attributes.
49
50
  - `get_trace_attributes`: Get available trace attributes (series) for a specified time window.
50
51
 
@@ -73,7 +74,9 @@ Parameters:
73
74
  HH:MM:SS). Leave empty to use lookback_minutes.
74
75
  - `end_time_iso` (string, optional): End time in ISO format (YYYY-MM-DD
75
76
  HH:MM:SS). Leave empty to default to current time.
77
+ - `service_name` (string, optional): Filter exceptions by service name (e.g., api-service).
76
78
  - `span_name` (string, optional): Name of the span to filter by.
79
+ - `deployment_environment` (string, optional): Filter exceptions by deployment environment from resource attributes (e.g., production, staging).
77
80
 
78
81
  ### get_service_summary
79
82
 
@@ -290,6 +293,30 @@ Returns:
290
293
  - Log Attributes: Standard log fields like service, severity, body, level, etc.
291
294
  - Resource Attributes: Resource-related fields prefixed with "resource_" like resource_k8s.pod.name, resource_service.name, etc.
292
295
 
296
+ ### get_traces
297
+
298
+ Retrieve traces from Last9 by trace ID or service name. This tool allows you to get specific traces either by providing a trace ID for a single trace, or by providing a service name to get all traces for that service within a time range.
299
+
300
+ Parameters:
301
+
302
+ - `trace_id` (string, optional): Specific trace ID to retrieve. Cannot be used with service_name.
303
+ - `service_name` (string, optional): Name of service to get traces for. Cannot be used with trace_id.
304
+ - `lookback_minutes` (integer, optional): Number of minutes to look back from now. Default: 60 minutes. Examples: 60, 30, 15.
305
+ - `start_time_iso` (string, optional): Start time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to default to now - lookback_minutes.
306
+ - `end_time_iso` (string, optional): End time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to default to current time.
307
+ - `limit` (integer, optional): Maximum number of traces to return. Default: 10. Range: 1-100.
308
+ - `env` (string, optional): Environment to filter by. Use "get_service_environments" tool to get available environments.
309
+
310
+ Usage rules:
311
+ - Exactly one of `trace_id` or `service_name` must be provided (not both, not neither)
312
+ - Time range filtering only applies when using `service_name`
313
+
314
+ Examples:
315
+ - trace_id="abc123def456" - retrieves the specific trace
316
+ - service_name="payment-service" + lookback_minutes=30 - gets all payment service traces from last 30 minutes
317
+
318
+ Returns trace data including trace IDs, spans, duration, timestamps, and status information.
319
+
293
320
  ### get_service_traces
294
321
 
295
322
  Query traces for a specific service with filtering options for span kinds, status codes, and other trace attributes. This tool retrieves distributed tracing data for debugging performance issues, understanding request flows, and analyzing service interactions.
@@ -401,6 +428,8 @@ The Last9 MCP server requires the following environment variables:
401
428
  - `LAST9_REFRESH_TOKEN`: (required) Refresh Token with Write permissions, needed
402
429
  for accessing control plane APIs from
403
430
  [API Access](https://app.last9.io/settings/api-access)
431
+ - `OTEL_EXPORTER_OTLP_ENDPOINT`: (required) OpenTelemetry collector endpoint URL
432
+ - `OTEL_EXPORTER_OTLP_HEADERS`: (required) Headers for OTLP exporter authentication
404
433
 
405
434
  ## Usage
406
435
 
@@ -423,7 +452,9 @@ Configure the Claude app to use the MCP server:
423
452
  "env": {
424
453
  "LAST9_BASE_URL": "<last9_otlp_host>",
425
454
  "LAST9_AUTH_TOKEN": "<last9_otlp_auth_token>",
426
- "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>"
455
+ "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>",
456
+ "OTEL_EXPORTER_OTLP_ENDPOINT": "<otel_endpoint_url>",
457
+ "OTEL_EXPORTER_OTLP_HEADERS": "<otel_headers>"
427
458
  }
428
459
  }
429
460
  }
@@ -440,7 +471,9 @@ Configure the Claude app to use the MCP server:
440
471
  "env": {
441
472
  "LAST9_BASE_URL": "<last9_otlp_host>",
442
473
  "LAST9_AUTH_TOKEN": "<last9_otlp_auth_token>",
443
- "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>"
474
+ "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>",
475
+ "OTEL_EXPORTER_OTLP_ENDPOINT": "<otel_endpoint_url>",
476
+ "OTEL_EXPORTER_OTLP_HEADERS": "<otel_headers>"
444
477
  }
445
478
  }
446
479
  }
@@ -466,7 +499,9 @@ Configure Cursor to use the MCP server:
466
499
  "env": {
467
500
  "LAST9_BASE_URL": "<last9_otlp_host>",
468
501
  "LAST9_AUTH_TOKEN": "<last9_otlp_auth_token>",
469
- "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>"
502
+ "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>",
503
+ "OTEL_EXPORTER_OTLP_ENDPOINT": "<otel_endpoint_url>",
504
+ "OTEL_EXPORTER_OTLP_HEADERS": "<otel_headers>"
470
505
  }
471
506
  }
472
507
  }
@@ -483,7 +518,9 @@ Configure Cursor to use the MCP server:
483
518
  "env": {
484
519
  "LAST9_BASE_URL": "<last9_otlp_host>",
485
520
  "LAST9_AUTH_TOKEN": "<last9_otlp_auth_token>",
486
- "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>"
521
+ "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>",
522
+ "OTEL_EXPORTER_OTLP_ENDPOINT": "<otel_endpoint_url>",
523
+ "OTEL_EXPORTER_OTLP_HEADERS": "<otel_headers>"
487
524
  }
488
525
  }
489
526
  }
@@ -509,7 +546,9 @@ Configure Windsurf to use the MCP server:
509
546
  "env": {
510
547
  "LAST9_BASE_URL": "<last9_otlp_host>",
511
548
  "LAST9_AUTH_TOKEN": "<last9_otlp_auth_token>",
512
- "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>"
549
+ "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>",
550
+ "OTEL_EXPORTER_OTLP_ENDPOINT": "<otel_endpoint_url>",
551
+ "OTEL_EXPORTER_OTLP_HEADERS": "<otel_headers>"
513
552
  }
514
553
  }
515
554
  }
@@ -526,7 +565,9 @@ Configure Windsurf to use the MCP server:
526
565
  "env": {
527
566
  "LAST9_BASE_URL": "<last9_otlp_host>",
528
567
  "LAST9_AUTH_TOKEN": "<last9_otlp_auth_token>",
529
- "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>"
568
+ "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>",
569
+ "OTEL_EXPORTER_OTLP_ENDPOINT": "<otel_endpoint_url>",
570
+ "OTEL_EXPORTER_OTLP_HEADERS": "<otel_headers>"
530
571
  }
531
572
  }
532
573
  }
@@ -555,7 +596,9 @@ Configure Windsurf to use the MCP server:
555
596
  "env": {
556
597
  "LAST9_BASE_URL": "<last9_otlp_host>",
557
598
  "LAST9_AUTH_TOKEN": "<last9_otlp_auth_token>",
558
- "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>"
599
+ "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>",
600
+ "OTEL_EXPORTER_OTLP_ENDPOINT": "<otel_endpoint_url>",
601
+ "OTEL_EXPORTER_OTLP_HEADERS": "<otel_headers>"
559
602
  }
560
603
  }
561
604
  }
@@ -575,7 +618,9 @@ Configure Windsurf to use the MCP server:
575
618
  "env": {
576
619
  "LAST9_BASE_URL": "<last9_otlp_host>",
577
620
  "LAST9_AUTH_TOKEN": "<last9_otlp_auth_token>",
578
- "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>"
621
+ "LAST9_REFRESH_TOKEN": "<last9_write_refresh_token>",
622
+ "OTEL_EXPORTER_OTLP_ENDPOINT": "<otel_endpoint_url>",
623
+ "OTEL_EXPORTER_OTLP_HEADERS": "<otel_headers>"
579
624
  }
580
625
  }
581
626
  }
@@ -595,6 +640,8 @@ Set the `HTTP_MODE` environment variable to enable HTTP server mode:
595
640
  # Export required environment variables
596
641
  export LAST9_API_TOKEN="your_api_token"
597
642
  export LAST9_BASE_URL="https://your-last9-endpoint" # Your Last9 endpoint
643
+ export OTEL_EXPORTER_OTLP_ENDPOINT="<otel_endpoint_url>"
644
+ export OTEL_EXPORTER_OTLP_HEADERS="<otel_headers>"
598
645
  export HTTP_MODE=true
599
646
  export HTTP_PORT=8080 # Optional, defaults to 8080
600
647
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@last9/mcp-server",
3
- "version": "0.1.15",
3
+ "version": "0.2.0",
4
4
  "description": "Last9 MCP Server - Model Context Protocol server implementation for Last9",
5
5
  "bin": {
6
6
  "last9-mcp": "./bin/cli.js"