@last9/mcp-server 0.1.0 → 0.1.2

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 +117 -14
  2. package/package.json +9 -5
package/README.md CHANGED
@@ -1,20 +1,83 @@
1
1
  # Last9 MCP Server
2
2
 
3
- A [Model Context Protocol](https://modelcontextprotocol.io/) server implementation for [Last9](https://last9.io) that enables AI agents to query your data using Last9.
3
+ ![last9 mcp demo](mcp-demo.gif)
4
+
5
+ A [Model Context Protocol](https://modelcontextprotocol.io/) server implementation for [Last9](https://last9.io/mcp/) that enables AI agents to seamlessly bring real-time production context — logs, metrics, and traces — into your local environment to auto-fix code faster.
6
+
7
+ - [View demo](https://www.youtube.com/watch?v=AQH5xq6qzjI)
8
+ - Read our [announcement blog post](https://last9.io/blog/launching-last9-mcp-server/)
4
9
 
5
10
  ## Status
6
11
 
7
- Works with Claude desktop app. 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
+
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)
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
+ - `start_time_iso` (string, optional): Start time in ISO format (YYYY-MM-DD HH:MM:SS).
30
+ - `end_time_iso` (string, optional): End time in ISO format (YYYY-MM-DD HH:MM:SS).
31
+ - `span_name` (string, optional): Name of the span to filter by.
32
+
33
+ ### get_service_graph
34
+
35
+ Gets the upstream and downstream services for a given span name, along with the throughput for each service.
36
+
37
+ Parameters:
38
+
39
+ - `span_name` (string, required): Name of the span to get dependencies for.
40
+ - `lookback_minutes` (integer, optional): Number of minutes to look back. Default: 60.
41
+ - `start_time_iso` (string, optional): Start time in ISO format (YYYY-MM-DD HH:MM:SS).
42
+
43
+ ### get_logs
44
+
45
+ Gets logs filtered by optional service name and/or severity level within a specified time range.
46
+
47
+ Parameters:
48
+
49
+ - `service` (string, optional): Name of the service to get logs for.
50
+ - `severity` (string, optional): Severity of the logs to get.
51
+ - `start_time_iso` (string, optional): Start time in ISO format (YYYY-MM-DD HH:MM:SS).
52
+ - `end_time_iso` (string, optional): End time in ISO format (YYYY-MM-DD HH:MM:SS).
53
+ - `limit` (integer, optional): Maximum number of logs to return. Default: 20.
54
+
55
+ ### get_drop_rules
56
+
57
+ Gets drop rules for logs, which determine what logs get filtered out from reaching Last9.
58
+
59
+ ### add_drop_rule
60
+
61
+ Adds a new drop rule to filter out specific logs at [Last9 Control Plane](https://last9.io/control-plane)
8
62
 
9
- - get_exceptions: Get list of execeptions
10
- - get_servicegraph: Get Service graph for an endpoint from the exception
63
+ Parameters:
11
64
 
65
+ - `name` (string, required): Name of the drop rule.
66
+ - `filters` (array, required): List of filter conditions to apply. Each filter has:
67
+ - `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.
68
+ - `value` (string, required): The value to filter against.
69
+ - `operator` (string, required): The operator used for filtering. Valid values:
70
+ - "equals"
71
+ - "not_equals"
72
+ - `conjunction` (string, required): The logical conjunction between filters. Valid values:
73
+ - "and"
12
74
 
13
75
  ## Installation
14
76
 
15
- You can install the Last9 MCP server using either
77
+ You can install the Last9 Observability MCP server using either:
16
78
 
17
79
  ### Homebrew
80
+
18
81
  ```
19
82
  # Add the Last9 tap
20
83
  brew tap last9/tap
@@ -41,11 +104,22 @@ The service requires the following environment variables:
41
104
 
42
105
  - `LAST9_AUTH_TOKEN`: Authentication token for Last9 MCP server (required)
43
106
  - `LAST9_BASE_URL`: Last9 API URL (required)
107
+ - `LAST9_REFRESH_TOKEN`: Refresh Token with Write permissions. Needed for accessing control plane APIs (required).
108
+
109
+ - Signup at [Last9](https://app.last9.io/) and setup one of the [integrations](https://last9.io/docs/integrations/).
110
+ - Obtain `LAST9_BASE_URL` and `LAST9_AUTH_TOKEN` from [here](https://app.last9.io/integrations?integration=OpenTelemetry).
111
+ - The Write Refresh Token can be obtained from [API Access](https://app.last9.io/settings/api-access) page.
44
112
 
45
113
  ## Usage with Claude Desktop
46
114
 
47
115
  Configure the Claude app to use the MCP server:
48
116
 
117
+ 1. Open the Claude Desktop app
118
+ 2. Go to Settings, then Developer, click Edit Config
119
+ 3. Open the `claude_desktop_config.json` file
120
+ 4. Copy and paste the server config to your existing file, then save
121
+ 5. Restart Claude
122
+
49
123
  ```bash
50
124
  code ~/Library/Application\ Support/Claude/claude_desktop_config.json
51
125
  ```
@@ -56,8 +130,9 @@ code ~/Library/Application\ Support/Claude/claude_desktop_config.json
56
130
  "last9": {
57
131
  "command": "/opt/homebrew/bin/last9-mcp",
58
132
  "env": {
59
- "LAST9_AUTH_TOKEN": "your_auth_token",
60
- "LAST9_BASE_URL": "https://otlp.last9.io"
133
+ "LAST9_AUTH_TOKEN": "<your_auth_token>",
134
+ "LAST9_BASE_URL": "<last9_otlp_host>",
135
+ "LAST9_REFRESH_TOKEN": "<refresh_token_from_last9_dashboard>"
61
136
  }
62
137
  }
63
138
  }
@@ -68,10 +143,37 @@ code ~/Library/Application\ Support/Claude/claude_desktop_config.json
68
143
 
69
144
  Configure Cursor to use the MCP server:
70
145
 
71
- 1. Open Cursor settings
72
- 2. Navigate to MCP
73
- 3. Click Add New Global Configuration
74
- 4. Add following stanza. If you already have a MCP server configured, only add the last9 stanza.
146
+ 1. Navigate to Settings, then Cursor Settings
147
+ 2. Select MCP on the left
148
+ 3. Click Add new global MCP server at the top right
149
+ 4. Copy and paste the server config to your existing file, then save
150
+ 5. Restart Cursor
151
+
152
+ ```json
153
+ {
154
+ "mcpServers": {
155
+ "last9": {
156
+ "command": "/opt/homebrew/bin/last9-mcp",
157
+ "env": {
158
+ "LAST9_AUTH_TOKEN": "<auth_token>",
159
+ "LAST9_BASE_URL": "<last9_otlp_host>",
160
+ "LAST9_REFRESH_TOKEN": "<write_refresh_token>"
161
+ }
162
+ }
163
+ }
164
+ }
165
+ ```
166
+
167
+ ## Usage with Windsurf
168
+
169
+ Configure Cursor to use the MCP server:
170
+
171
+ 1. Open Windsurf
172
+ 2. Go to Settings, then Developer
173
+ 3. Click Edit Config
174
+ 4. Open the `windsurf_config.json` file
175
+ 5. Copy and paste the server config to your existing file, then save
176
+ 6. Restart Windsurf
75
177
 
76
178
  ```json
77
179
  {
@@ -79,10 +181,11 @@ Configure Cursor to use the MCP server:
79
181
  "last9": {
80
182
  "command": "/opt/homebrew/bin/last9-mcp",
81
183
  "env": {
82
- "LAST9_AUTH_TOKEN": "your_auth_token",
83
- "LAST9_BASE_URL": "https://otlp.last9.io"
184
+ "LAST9_AUTH_TOKEN": "<auth_token>",
185
+ "LAST9_BASE_URL": "<last9_otlp_host>",
186
+ "LAST9_REFRESH_TOKEN": "<refresh_token>"
84
187
  }
85
188
  }
86
189
  }
87
190
  }
88
- ```
191
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@last9/mcp-server",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
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
+ }