@last9/mcp-server 0.1.1 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +112 -13
  2. package/package.json +9 -5
package/README.md CHANGED
@@ -9,18 +9,77 @@ A [Model Context Protocol](https://modelcontextprotocol.io/) server implementati
9
9
 
10
10
  ## Status
11
11
 
12
- Works with Claude desktop app, or Cursor, Windsurf, and VSCode (Github Copilot) IDEs. Implements two MCP [tools](https://modelcontextprotocol.io/docs/concepts/tools):
12
+ Works with Claude desktop app, or Cursor, Windsurf, and VSCode (Github Copilot) IDEs. Implements the following MCP [tools](https://modelcontextprotocol.io/docs/concepts/tools):
13
13
 
14
- - `get_exceptions`: Get list of execeptions
15
- - `get_servicegraph`: Get Service graph for an endpoint from the exception
16
- - `get_logs`: Get logs filtered by service name and/or severity level
14
+ - `get_exceptions`: Get list of exceptions.
15
+ - `get_service_graph`: Get service graph for an endpoint from the exception.
16
+ - `get_logs`: Get logs filtered by service name and/or severity level.
17
+ - `get_drop_rules`: Get drop rules for logs that determine what logs get filtered out at [Last9 Control Plane](https://last9.io/control-plane)
18
+ - `add_drop_rule`: Create a drop rule for logs at [Last9 Control Plane](https://last9.io/control-plane)
17
19
 
20
+ ## Tools Documentation
21
+
22
+ ### get_exceptions
23
+
24
+ Retrieves server-side exceptions over a specified time range.
25
+
26
+ Parameters:
27
+
28
+ - `limit` (integer, optional): Maximum number of exceptions to return. Default: 20.
29
+ - `lookback_minutes` (integer, recommended): Number of minutes to look back from now. Default: 60. Examples: 60, 30, 15.
30
+ - `start_time_iso` (string, optional): Start time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to use lookback_minutes.
31
+ - `end_time_iso` (string, optional): End time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to default to current time.
32
+ - `span_name` (string, optional): Name of the span to filter by.
33
+
34
+ ### get_service_graph
35
+
36
+ Gets the upstream and downstream services for a given span name, along with the throughput for each service.
37
+
38
+ Parameters:
39
+
40
+ - `span_name` (string, required): Name of the span to get dependencies for.
41
+ - `lookback_minutes` (integer, recommended): Number of minutes to look back from now. Default: 60. Examples: 60, 30, 15.
42
+ - `start_time_iso` (string, optional): Start time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to use lookback_minutes.
43
+
44
+ ### get_logs
45
+
46
+ Gets logs filtered by optional service name and/or severity level within a specified time range.
47
+
48
+ Parameters:
49
+
50
+ - `service` (string, optional): Name of the service to get logs for.
51
+ - `severity` (string, optional): Severity of the logs to get.
52
+ - `lookback_minutes` (integer, recommended): Number of minutes to look back from now. Default: 60. Examples: 60, 30, 15.
53
+ - `start_time_iso` (string, optional): Start time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to use lookback_minutes.
54
+ - `end_time_iso` (string, optional): End time in ISO format (YYYY-MM-DD HH:MM:SS). Leave empty to default to current time.
55
+ - `limit` (integer, optional): Maximum number of logs to return. Default: 20.
56
+
57
+ ### get_drop_rules
58
+
59
+ Gets drop rules for logs, which determine what logs get filtered out from reaching Last9.
60
+
61
+ ### add_drop_rule
62
+
63
+ Adds a new drop rule to filter out specific logs at [Last9 Control Plane](https://last9.io/control-plane)
64
+
65
+ Parameters:
66
+
67
+ - `name` (string, required): Name of the drop rule.
68
+ - `filters` (array, required): List of filter conditions to apply. Each filter has:
69
+ - `key` (string, required): The key to filter on. Only attributes and resource.attributes keys are supported. For resource attributes, use format: resource.attributes[key_name] and for log attributes, use format: attributes[key_name] Double quotes in key names must be escaped.
70
+ - `value` (string, required): The value to filter against.
71
+ - `operator` (string, required): The operator used for filtering. Valid values:
72
+ - "equals"
73
+ - "not_equals"
74
+ - `conjunction` (string, required): The logical conjunction between filters. Valid values:
75
+ - "and"
18
76
 
19
77
  ## Installation
20
78
 
21
79
  You can install the Last9 Observability MCP server using either:
22
80
 
23
81
  ### Homebrew
82
+
24
83
  ```
25
84
  # Add the Last9 tap
26
85
  brew tap last9/tap
@@ -30,6 +89,7 @@ brew install last9-mcp
30
89
  ```
31
90
 
32
91
  ### NPM
92
+
33
93
  ```bash
34
94
  # Install globally
35
95
  npm install -g @last9/mcp-server
@@ -46,8 +106,11 @@ The service requires the following environment variables:
46
106
 
47
107
  - `LAST9_AUTH_TOKEN`: Authentication token for Last9 MCP server (required)
48
108
  - `LAST9_BASE_URL`: Last9 API URL (required)
109
+ - `LAST9_REFRESH_TOKEN`: Refresh Token with Write permissions. Needed for accessing control plane APIs (required).
49
110
 
50
- Signup at [Last9](https://app.last9.io/) and get your env variable keys [here](https://app.last9.io/integrations?integration=OpenTelemetry).
111
+ - Signup at [Last9](https://app.last9.io/) and setup one of the [integrations](https://last9.io/docs/integrations/).
112
+ - Obtain `LAST9_BASE_URL` and `LAST9_AUTH_TOKEN` from [here](https://app.last9.io/integrations?integration=OpenTelemetry).
113
+ - The Write Refresh Token can be obtained from [API Access](https://app.last9.io/settings/api-access) page.
51
114
 
52
115
  ## Usage with Claude Desktop
53
116
 
@@ -69,8 +132,9 @@ code ~/Library/Application\ Support/Claude/claude_desktop_config.json
69
132
  "last9": {
70
133
  "command": "/opt/homebrew/bin/last9-mcp",
71
134
  "env": {
72
- "LAST9_AUTH_TOKEN": "your_auth_token",
73
- "LAST9_BASE_URL": "https://otlp.last9.io"
135
+ "LAST9_AUTH_TOKEN": "<your_auth_token>",
136
+ "LAST9_BASE_URL": "<last9_otlp_host>",
137
+ "LAST9_REFRESH_TOKEN": "<refresh_token_from_last9_dashboard>"
74
138
  }
75
139
  }
76
140
  }
@@ -93,8 +157,9 @@ Configure Cursor to use the MCP server:
93
157
  "last9": {
94
158
  "command": "/opt/homebrew/bin/last9-mcp",
95
159
  "env": {
96
- "LAST9_AUTH_TOKEN": "your_auth_token",
97
- "LAST9_BASE_URL": "https://otlp.last9.io"
160
+ "LAST9_AUTH_TOKEN": "<auth_token>",
161
+ "LAST9_BASE_URL": "<last9_otlp_host>",
162
+ "LAST9_REFRESH_TOKEN": "<write_refresh_token>"
98
163
  }
99
164
  }
100
165
  }
@@ -103,7 +168,7 @@ Configure Cursor to use the MCP server:
103
168
 
104
169
  ## Usage with Windsurf
105
170
 
106
- Configure Cursor to use the MCP server:
171
+ Configure Windsurf to use the MCP server:
107
172
 
108
173
  1. Open Windsurf
109
174
  2. Go to Settings, then Developer
@@ -118,10 +183,44 @@ Configure Cursor to use the MCP server:
118
183
  "last9": {
119
184
  "command": "/opt/homebrew/bin/last9-mcp",
120
185
  "env": {
121
- "LAST9_AUTH_TOKEN": "your_auth_token",
122
- "LAST9_BASE_URL": "https://otlp.last9.io"
186
+ "LAST9_AUTH_TOKEN": "<auth_token>",
187
+ "LAST9_BASE_URL": "<last9_otlp_host>",
188
+ "LAST9_REFRESH_TOKEN": "<refresh_token>"
189
+ }
190
+ }
191
+ }
192
+ }
193
+ ```
194
+
195
+ ## Usage with VS Code
196
+
197
+ Prerequisites:
198
+ - VS Code version 1.99 or later
199
+
200
+ Configure VS Code to use the MCP server:
201
+
202
+ 1. Create `.vscode/mcp.json` in your workspace or add to VS Code user settings with the following configuration:
203
+
204
+ ```json
205
+ {
206
+ "servers": {
207
+ "last9": {
208
+ "type": "stdio",
209
+ "command": "/opt/homebrew/bin/last9-mcp",
210
+ "env": {
211
+ "LAST9_AUTH_TOKEN": "<auth_token>",
212
+ "LAST9_BASE_URL": "<last9_otlp_host>",
213
+ "LAST9_REFRESH_TOKEN": "<write_refresh_token>"
123
214
  }
124
215
  }
125
216
  }
126
217
  }
127
- ```
218
+ ```
219
+
220
+ 2. Open Chat view (⌃⌘I on macOS, Ctrl+Alt+I on Windows/Linux)
221
+ 3. Select "Agent" mode from dropdown
222
+ 4. The Last9 MCP server will now be available in VS Code
223
+
224
+ Note: Replace placeholder values (`<auth_token>`, `<last9_otlp_host>`, and `<write_refresh_token>`) with your actual Last9 credentials.
225
+
226
+ For advanced configuration options and alternative setup methods, see the [official VS Code MCP documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@last9/mcp-server",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Last9 MCP Server - Model Context Protocol server implementation for Last9",
5
5
  "bin": {
6
6
  "last9-mcp": "./bin/cli.js"
@@ -13,8 +13,7 @@
13
13
  ],
14
14
  "scripts": {
15
15
  "postinstall": "node bin/download-binary.js",
16
- "preversion": "go run main.go --version",
17
- "postversion": "git push && git push --tags"
16
+ "preversion": "go run . --version"
18
17
  },
19
18
  "repository": {
20
19
  "type": "git",
@@ -24,7 +23,12 @@
24
23
  "node": ">=14"
25
24
  },
26
25
  "preferGlobal": true,
27
- "keywords": ["last9", "mcp", "ai", "claude"],
26
+ "keywords": [
27
+ "last9",
28
+ "mcp",
29
+ "ai",
30
+ "claude"
31
+ ],
28
32
  "author": "Last9",
29
33
  "license": "MIT",
30
34
  "bugs": {
@@ -34,4 +38,4 @@
34
38
  "publishConfig": {
35
39
  "access": "public"
36
40
  }
37
- }
41
+ }