@mpurdon/mcp-sumologic 0.1.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.
- package/LICENSE +21 -0
- package/README.md +64 -0
- package/dist/index.js +783 -0
- package/dist/index.js.map +1 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matthew Purdon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# @mpurdon/mcp-sumologic
|
|
2
|
+
|
|
3
|
+
A local **stdio** MCP server for the [Sumo Logic](https://www.sumologic.com/)
|
|
4
|
+
search API. Start search jobs, poll for results, and (optionally) use a
|
|
5
|
+
context-config file that maps friendly application/infrastructure names to source
|
|
6
|
+
categories and canned query shortcuts.
|
|
7
|
+
|
|
8
|
+
- Runs the Sumo Logic search-job lifecycle (create → poll → fetch records/messages)
|
|
9
|
+
- Optional `sumologic-context.json` adds environment-aware source discovery and query shortcuts
|
|
10
|
+
- stdio only; credentials come from environment variables and are never returned over the wire
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx -y @mpurdon/mcp-sumologic
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or register it interactively with `npx @mpurdon/mcp-servers configure`.
|
|
19
|
+
|
|
20
|
+
## Configuration
|
|
21
|
+
|
|
22
|
+
Set these in the `env` block of your host's MCP config (see below):
|
|
23
|
+
|
|
24
|
+
| Variable | Required | Default | Description |
|
|
25
|
+
| -------------------------- | -------- | ------------------------------- | ----------------------------------------------------------------------------------------------- |
|
|
26
|
+
| `SUMOLOGIC_ACCESS_ID` | yes | — | Sumo Logic access ID. |
|
|
27
|
+
| `SUMOLOGIC_ACCESS_KEY` | yes | — | Sumo Logic access key. |
|
|
28
|
+
| `SUMOLOGIC_API_ENDPOINT` | no | `https://api.sumologic.com/api` | Your deployment's API endpoint ([list](https://help.sumologic.com/docs/reuse/api-endpoints/)). |
|
|
29
|
+
| `SUMOLOGIC_CONTEXT_CONFIG` | no | `./sumologic-context.json` | Path to an optional context-config JSON. Missing file is fine — the server degrades gracefully. |
|
|
30
|
+
| `SUMOLOGIC_DEFAULT_ENV` | no | `production` | Default environment key used by context-aware tools. |
|
|
31
|
+
|
|
32
|
+
> Create access keys in Sumo Logic under **Administration → Security → Access Keys**.
|
|
33
|
+
|
|
34
|
+
## Register with your Claude host
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"mcpServers": {
|
|
39
|
+
"sumologic": {
|
|
40
|
+
"command": "npx",
|
|
41
|
+
"args": ["-y", "@mpurdon/mcp-sumologic"],
|
|
42
|
+
"env": {
|
|
43
|
+
"SUMOLOGIC_ACCESS_ID": "...",
|
|
44
|
+
"SUMOLOGIC_ACCESS_KEY": "...",
|
|
45
|
+
"SUMOLOGIC_API_ENDPOINT": "https://api.us2.sumologic.com/api"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Config file location per host:
|
|
53
|
+
|
|
54
|
+
- **Claude Desktop** — `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
|
|
55
|
+
- **Claude Code** — `~/.claude.json` (user) or a project `.mcp.json`
|
|
56
|
+
- **Claude Cowork** — the workspace's `.mcp.json`
|
|
57
|
+
|
|
58
|
+
Restart the host.
|
|
59
|
+
|
|
60
|
+
## Security notes
|
|
61
|
+
|
|
62
|
+
- Credentials are read from env only and are sent to Sumo Logic via HTTP Basic auth — they are never echoed in tool results or errors.
|
|
63
|
+
- stdio only: no network listener is opened by the server itself.
|
|
64
|
+
- All tool inputs are validated with zod before any API call.
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,783 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SumoLogic MCP Server with Context Awareness
|
|
3
|
+
*
|
|
4
|
+
* Enhanced implementation with configurable source mappings and contextual
|
|
5
|
+
* awareness. stdio transport only.
|
|
6
|
+
*/
|
|
7
|
+
import { McpServer, ResourceTemplate, } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import axios, { AxiosError } from "axios";
|
|
11
|
+
import dotenv from "dotenv";
|
|
12
|
+
import fs from "fs/promises";
|
|
13
|
+
import path from "path";
|
|
14
|
+
// Load environment variables
|
|
15
|
+
dotenv.config();
|
|
16
|
+
// API constants
|
|
17
|
+
const SUMOLOGIC_ACCESS_ID = process.env.SUMOLOGIC_ACCESS_ID || "";
|
|
18
|
+
const SUMOLOGIC_ACCESS_KEY = process.env.SUMOLOGIC_ACCESS_KEY || "";
|
|
19
|
+
const SUMOLOGIC_API_ENDPOINT = process.env.SUMOLOGIC_API_ENDPOINT || "https://api.sumologic.com/api";
|
|
20
|
+
const CONTEXT_CONFIG_PATH = process.env.SUMOLOGIC_CONTEXT_CONFIG || "./sumologic-context.json";
|
|
21
|
+
const DEFAULT_ENVIRONMENT = process.env.SUMOLOGIC_DEFAULT_ENV || "production";
|
|
22
|
+
// Validate credentials
|
|
23
|
+
if (!SUMOLOGIC_ACCESS_ID || !SUMOLOGIC_ACCESS_KEY) {
|
|
24
|
+
console.error('[sumologic] SUMOLOGIC_ACCESS_ID and SUMOLOGIC_ACCESS_KEY environment variables are required. Set them in your MCP server config\'s "env" block.');
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
// Create axios instance
|
|
28
|
+
const sumoLogicClient = axios.create({
|
|
29
|
+
baseURL: SUMOLOGIC_API_ENDPOINT,
|
|
30
|
+
auth: {
|
|
31
|
+
username: SUMOLOGIC_ACCESS_ID,
|
|
32
|
+
password: SUMOLOGIC_ACCESS_KEY,
|
|
33
|
+
},
|
|
34
|
+
headers: {
|
|
35
|
+
"Content-Type": "application/json",
|
|
36
|
+
Accept: "application/json",
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
// Global context storage
|
|
40
|
+
let contextConfig = null;
|
|
41
|
+
// Load context configuration
|
|
42
|
+
async function loadContextConfig() {
|
|
43
|
+
try {
|
|
44
|
+
const configPath = path.resolve(CONTEXT_CONFIG_PATH);
|
|
45
|
+
const configData = await fs.readFile(configPath, "utf-8");
|
|
46
|
+
const config = JSON.parse(configData);
|
|
47
|
+
console.error(`[sumologic] loaded context configuration from ${configPath}`);
|
|
48
|
+
return config;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
console.error(`[sumologic] warning: could not load context configuration from ${CONTEXT_CONFIG_PATH}:`, error instanceof Error ? error.message : "Unknown error");
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Helper functions
|
|
56
|
+
const handleApiError = (error) => {
|
|
57
|
+
if (error instanceof AxiosError && error.response) {
|
|
58
|
+
return `API Error: ${error.response.status} - ${JSON.stringify(error.response.data)}`;
|
|
59
|
+
}
|
|
60
|
+
if (error instanceof Error) {
|
|
61
|
+
return `Error: ${error.message}`;
|
|
62
|
+
}
|
|
63
|
+
return "Unknown error occurred";
|
|
64
|
+
};
|
|
65
|
+
function buildQueryFromMapping(mapping, additionalQuery) {
|
|
66
|
+
let query = `_sourceCategory="${mapping.sourceCategory}"`;
|
|
67
|
+
if (mapping.sourceName) {
|
|
68
|
+
query += ` _sourceName="${mapping.sourceName}"`;
|
|
69
|
+
}
|
|
70
|
+
if (mapping.commonFilters && mapping.commonFilters.length > 0) {
|
|
71
|
+
query += ` ${mapping.commonFilters.join(" ")}`;
|
|
72
|
+
}
|
|
73
|
+
if (additionalQuery) {
|
|
74
|
+
query += ` ${additionalQuery}`;
|
|
75
|
+
}
|
|
76
|
+
return query;
|
|
77
|
+
}
|
|
78
|
+
function findSourceMapping(environment, resourceType, resourceName) {
|
|
79
|
+
if (!contextConfig)
|
|
80
|
+
return null;
|
|
81
|
+
const env = contextConfig.environments[environment];
|
|
82
|
+
if (!env)
|
|
83
|
+
return null;
|
|
84
|
+
return env[resourceType][resourceName] || null;
|
|
85
|
+
}
|
|
86
|
+
// Create MCP server
|
|
87
|
+
const server = new McpServer({
|
|
88
|
+
name: "sumologic",
|
|
89
|
+
version: "0.1.0",
|
|
90
|
+
});
|
|
91
|
+
// Add resources to expose context configuration using new ResourceTemplate pattern
|
|
92
|
+
//'Complete SumoLogic context configuration including environments, applications, and shortcuts'
|
|
93
|
+
server.resource("config", "sumologic://context/config", async (uri) => {
|
|
94
|
+
if (!contextConfig) {
|
|
95
|
+
return {
|
|
96
|
+
contents: [
|
|
97
|
+
{
|
|
98
|
+
uri: uri.href,
|
|
99
|
+
mimeType: "application/json",
|
|
100
|
+
text: JSON.stringify({ error: "No context configuration loaded" }),
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
contents: [
|
|
107
|
+
{
|
|
108
|
+
uri: uri.href,
|
|
109
|
+
mimeType: "application/json",
|
|
110
|
+
text: JSON.stringify(contextConfig, null, 2),
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
// Available applications and their SumoLogic source mappings, optionally filtered by environment
|
|
116
|
+
server.resource("applications", new ResourceTemplate("sumologic://context/applications/{environment}", {
|
|
117
|
+
list: undefined,
|
|
118
|
+
}), async (uri, { environment }) => {
|
|
119
|
+
if (!contextConfig) {
|
|
120
|
+
return {
|
|
121
|
+
contents: [
|
|
122
|
+
{
|
|
123
|
+
uri: uri.href,
|
|
124
|
+
mimeType: "application/json",
|
|
125
|
+
text: JSON.stringify({ error: "No context configuration loaded" }),
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
if (environment) {
|
|
131
|
+
const env = contextConfig.environments[Array.isArray(environment) ? environment[0] : environment];
|
|
132
|
+
if (!env) {
|
|
133
|
+
return {
|
|
134
|
+
contents: [
|
|
135
|
+
{
|
|
136
|
+
uri: uri.href,
|
|
137
|
+
mimeType: "application/json",
|
|
138
|
+
text: JSON.stringify({
|
|
139
|
+
error: `Environment '${environment}' not found`,
|
|
140
|
+
availableEnvironments: Object.keys(contextConfig.environments),
|
|
141
|
+
}),
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
contents: [
|
|
148
|
+
{
|
|
149
|
+
uri: uri.href,
|
|
150
|
+
mimeType: "application/json",
|
|
151
|
+
text: JSON.stringify(env.applications, null, 2),
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
// List all environments
|
|
158
|
+
const environmentList = Object.keys(contextConfig.environments).map((envName) => ({
|
|
159
|
+
name: envName,
|
|
160
|
+
uri: `sumologic://context/applications/${envName}`,
|
|
161
|
+
}));
|
|
162
|
+
return {
|
|
163
|
+
contents: [
|
|
164
|
+
{
|
|
165
|
+
uri: uri.href,
|
|
166
|
+
mimeType: "application/json",
|
|
167
|
+
text: JSON.stringify(environmentList, null, 2),
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
// Predefined query shortcuts and templates for common operations
|
|
174
|
+
server.resource("shortcuts", "sumologic://context/shortcuts", async (uri) => {
|
|
175
|
+
if (!contextConfig) {
|
|
176
|
+
return {
|
|
177
|
+
contents: [
|
|
178
|
+
{
|
|
179
|
+
uri: uri.href,
|
|
180
|
+
mimeType: "application/json",
|
|
181
|
+
text: JSON.stringify({ error: "No context configuration loaded" }),
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
contents: [
|
|
188
|
+
{
|
|
189
|
+
uri: uri.href,
|
|
190
|
+
mimeType: "application/json",
|
|
191
|
+
text: JSON.stringify(contextConfig.shortcuts, null, 2),
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
};
|
|
195
|
+
});
|
|
196
|
+
// Add prompts for common SumoLogic operations
|
|
197
|
+
server.prompt("troubleshoot-application", {
|
|
198
|
+
application: z.string().describe("Name of the application to troubleshoot"),
|
|
199
|
+
environment: z
|
|
200
|
+
.string()
|
|
201
|
+
.optional()
|
|
202
|
+
.describe("Environment (defaults to production)"),
|
|
203
|
+
time_range: z
|
|
204
|
+
.string()
|
|
205
|
+
.optional()
|
|
206
|
+
.describe("Time range to search (defaults to -15m)"),
|
|
207
|
+
}, ({ application, environment = DEFAULT_ENVIRONMENT, time_range = "-15m", }) => ({
|
|
208
|
+
messages: [
|
|
209
|
+
{
|
|
210
|
+
role: "user",
|
|
211
|
+
content: {
|
|
212
|
+
type: "text",
|
|
213
|
+
text: `Help me troubleshoot issues with the ${application} application in the ${environment} environment.
|
|
214
|
+
|
|
215
|
+
Please:
|
|
216
|
+
1. First, discover what sources are available for this application
|
|
217
|
+
2. Search for recent errors and exceptions in the last ${time_range}
|
|
218
|
+
3. Look for any performance issues or slow responses
|
|
219
|
+
4. Check if there are any unusual patterns in the logs
|
|
220
|
+
5. Summarize your findings and suggest next steps
|
|
221
|
+
|
|
222
|
+
Use the contextual search tools to make this efficient.`,
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
}));
|
|
227
|
+
server.prompt("performance-analysis", {
|
|
228
|
+
resource_name: z
|
|
229
|
+
.string()
|
|
230
|
+
.describe("Name of the application or infrastructure component"),
|
|
231
|
+
resource_type: z
|
|
232
|
+
.enum(["applications", "infrastructure"])
|
|
233
|
+
.describe("Type of resource"),
|
|
234
|
+
environment: z
|
|
235
|
+
.string()
|
|
236
|
+
.optional()
|
|
237
|
+
.describe("Environment (defaults to production)"),
|
|
238
|
+
threshold: z
|
|
239
|
+
.string()
|
|
240
|
+
.optional()
|
|
241
|
+
.describe("Performance threshold to check (e.g., 1000ms)"),
|
|
242
|
+
}, ({ resource_name, resource_type, environment = DEFAULT_ENVIRONMENT, threshold = "1000", }) => ({
|
|
243
|
+
messages: [
|
|
244
|
+
{
|
|
245
|
+
role: "user",
|
|
246
|
+
content: {
|
|
247
|
+
type: "text",
|
|
248
|
+
text: `Analyze the performance of ${resource_name} (${resource_type}) in ${environment}.
|
|
249
|
+
|
|
250
|
+
Please:
|
|
251
|
+
1. Search for performance-related metrics using the "performance" shortcut with threshold ${threshold}
|
|
252
|
+
2. Look for response time patterns over the last hour
|
|
253
|
+
3. Identify any slow queries or high-latency operations
|
|
254
|
+
4. Check for resource utilization issues
|
|
255
|
+
5. Provide recommendations for optimization
|
|
256
|
+
|
|
257
|
+
Use the search_with_shortcut tool with the performance shortcut.`,
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
}));
|
|
262
|
+
server.prompt("security-audit", {
|
|
263
|
+
environment: z
|
|
264
|
+
.string()
|
|
265
|
+
.optional()
|
|
266
|
+
.describe("Environment to audit (defaults to production)"),
|
|
267
|
+
time_range: z
|
|
268
|
+
.string()
|
|
269
|
+
.optional()
|
|
270
|
+
.describe("Time range for audit (defaults to -24h)"),
|
|
271
|
+
}, ({ environment = DEFAULT_ENVIRONMENT, time_range = "-24h" }) => ({
|
|
272
|
+
messages: [
|
|
273
|
+
{
|
|
274
|
+
role: "user",
|
|
275
|
+
content: {
|
|
276
|
+
type: "text",
|
|
277
|
+
text: `Perform a security audit across the ${environment} environment for the last ${time_range}.
|
|
278
|
+
|
|
279
|
+
Please:
|
|
280
|
+
1. Discover all available applications and infrastructure in ${environment}
|
|
281
|
+
2. Search for authentication failures and unauthorized access attempts
|
|
282
|
+
3. Look for suspicious activity patterns or unusual traffic
|
|
283
|
+
4. Check for any security-related errors or warnings
|
|
284
|
+
5. Review access logs for anomalies
|
|
285
|
+
6. Summarize security findings and recommend actions
|
|
286
|
+
|
|
287
|
+
Use contextual searches to examine each application and infrastructure component systematically.`,
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
],
|
|
291
|
+
}));
|
|
292
|
+
// Enhanced tools with context awareness
|
|
293
|
+
// Tool for discovering available applications and infrastructure
|
|
294
|
+
server.tool("discover_sources", "Discover available applications, infrastructure, and query shortcuts for a given environment", {
|
|
295
|
+
environment: z
|
|
296
|
+
.string()
|
|
297
|
+
.optional()
|
|
298
|
+
.describe("Environment to discover sources for (defaults to production)"),
|
|
299
|
+
}, async ({ environment = DEFAULT_ENVIRONMENT }) => {
|
|
300
|
+
if (!contextConfig) {
|
|
301
|
+
return {
|
|
302
|
+
content: [
|
|
303
|
+
{
|
|
304
|
+
type: "text",
|
|
305
|
+
text: JSON.stringify({
|
|
306
|
+
error: "No context configuration available",
|
|
307
|
+
suggestion: "Load a sumologic-context.json file to enable contextual awareness",
|
|
308
|
+
}),
|
|
309
|
+
},
|
|
310
|
+
],
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
const env = contextConfig.environments[environment];
|
|
314
|
+
if (!env) {
|
|
315
|
+
return {
|
|
316
|
+
content: [
|
|
317
|
+
{
|
|
318
|
+
type: "text",
|
|
319
|
+
text: JSON.stringify({
|
|
320
|
+
error: `Environment '${environment}' not found`,
|
|
321
|
+
availableEnvironments: Object.keys(contextConfig.environments),
|
|
322
|
+
}),
|
|
323
|
+
},
|
|
324
|
+
],
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
const discovery = {
|
|
328
|
+
environment,
|
|
329
|
+
applications: Object.entries(env.applications).map(([name, mapping]) => ({
|
|
330
|
+
name,
|
|
331
|
+
description: mapping.description,
|
|
332
|
+
sourceCategory: mapping.sourceCategory,
|
|
333
|
+
sourceName: mapping.sourceName,
|
|
334
|
+
sampleQueries: mapping.sampleQueries?.slice(0, 2), // Limit to first 2 samples
|
|
335
|
+
})),
|
|
336
|
+
infrastructure: Object.entries(env.infrastructure).map(([name, mapping]) => ({
|
|
337
|
+
name,
|
|
338
|
+
description: mapping.description,
|
|
339
|
+
sourceCategory: mapping.sourceCategory,
|
|
340
|
+
sourceName: mapping.sourceName,
|
|
341
|
+
})),
|
|
342
|
+
shortcuts: Object.entries(contextConfig.shortcuts).map(([name, shortcut]) => ({
|
|
343
|
+
name,
|
|
344
|
+
description: shortcut.description,
|
|
345
|
+
queryTemplate: shortcut.queryTemplate,
|
|
346
|
+
})),
|
|
347
|
+
};
|
|
348
|
+
return {
|
|
349
|
+
content: [
|
|
350
|
+
{
|
|
351
|
+
type: "text",
|
|
352
|
+
text: JSON.stringify(discovery, null, 2),
|
|
353
|
+
},
|
|
354
|
+
],
|
|
355
|
+
};
|
|
356
|
+
});
|
|
357
|
+
// Enhanced search tool with contextual awareness
|
|
358
|
+
server.tool("search_by_context", "Start a search job using contextual resource mappings (applications or infrastructure)", {
|
|
359
|
+
resource_type: z
|
|
360
|
+
.enum(["applications", "infrastructure"])
|
|
361
|
+
.describe("Type of resource to search"),
|
|
362
|
+
resource_name: z
|
|
363
|
+
.string()
|
|
364
|
+
.describe("Name of the application or infrastructure component"),
|
|
365
|
+
query: z
|
|
366
|
+
.string()
|
|
367
|
+
.optional()
|
|
368
|
+
.describe("Additional query to append to the base source query"),
|
|
369
|
+
environment: z
|
|
370
|
+
.string()
|
|
371
|
+
.optional()
|
|
372
|
+
.describe("Environment to search in (defaults to production)"),
|
|
373
|
+
from_time: z
|
|
374
|
+
.string()
|
|
375
|
+
.describe('Start time for the search (e.g. "2023-04-01T00:00:00Z" or "-15m")'),
|
|
376
|
+
to_time: z
|
|
377
|
+
.string()
|
|
378
|
+
.describe('End time for the search (e.g. "2023-04-01T01:00:00Z" or "now")'),
|
|
379
|
+
time_zone: z
|
|
380
|
+
.string()
|
|
381
|
+
.optional()
|
|
382
|
+
.describe("Timezone for the search (defaults to UTC)"),
|
|
383
|
+
}, async ({ resource_type, resource_name, query, environment = DEFAULT_ENVIRONMENT, from_time, to_time, time_zone, }) => {
|
|
384
|
+
const mapping = findSourceMapping(environment, resource_type, resource_name);
|
|
385
|
+
if (!mapping) {
|
|
386
|
+
return {
|
|
387
|
+
content: [
|
|
388
|
+
{
|
|
389
|
+
type: "text",
|
|
390
|
+
text: JSON.stringify({
|
|
391
|
+
error: `Resource '${resource_name}' not found in ${resource_type} for environment '${environment}'`,
|
|
392
|
+
suggestion: "Use discover_sources tool to see available resources",
|
|
393
|
+
}),
|
|
394
|
+
},
|
|
395
|
+
],
|
|
396
|
+
isError: true,
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
const finalQuery = buildQueryFromMapping(mapping, query);
|
|
400
|
+
try {
|
|
401
|
+
const searchJobData = {
|
|
402
|
+
query: finalQuery,
|
|
403
|
+
from: from_time,
|
|
404
|
+
to: to_time,
|
|
405
|
+
timeZone: time_zone || "UTC",
|
|
406
|
+
};
|
|
407
|
+
const response = await sumoLogicClient.post("/v1/search/jobs", searchJobData);
|
|
408
|
+
return {
|
|
409
|
+
content: [
|
|
410
|
+
{
|
|
411
|
+
type: "text",
|
|
412
|
+
text: JSON.stringify({
|
|
413
|
+
searchJob: response.data,
|
|
414
|
+
contextUsed: {
|
|
415
|
+
resource: `${environment}.${resource_type}.${resource_name}`,
|
|
416
|
+
mapping: {
|
|
417
|
+
description: mapping.description,
|
|
418
|
+
sourceCategory: mapping.sourceCategory,
|
|
419
|
+
sourceName: mapping.sourceName,
|
|
420
|
+
},
|
|
421
|
+
finalQuery,
|
|
422
|
+
},
|
|
423
|
+
}, null, 2),
|
|
424
|
+
},
|
|
425
|
+
],
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
catch (error) {
|
|
429
|
+
return {
|
|
430
|
+
content: [
|
|
431
|
+
{
|
|
432
|
+
type: "text",
|
|
433
|
+
text: handleApiError(error),
|
|
434
|
+
},
|
|
435
|
+
],
|
|
436
|
+
isError: true,
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
// Tool for using predefined shortcuts
|
|
441
|
+
server.tool("search_with_shortcut", "Execute a search using a predefined shortcut template applied to a specific resource", {
|
|
442
|
+
shortcut_name: z
|
|
443
|
+
.string()
|
|
444
|
+
.describe("Name of the predefined shortcut to use"),
|
|
445
|
+
resource_type: z
|
|
446
|
+
.enum(["applications", "infrastructure"])
|
|
447
|
+
.describe("Type of resource to apply shortcut to"),
|
|
448
|
+
resource_name: z
|
|
449
|
+
.string()
|
|
450
|
+
.describe("Name of the application or infrastructure component"),
|
|
451
|
+
parameters: z
|
|
452
|
+
.record(z.string())
|
|
453
|
+
.optional()
|
|
454
|
+
.describe("Parameters to substitute in the shortcut template"),
|
|
455
|
+
environment: z
|
|
456
|
+
.string()
|
|
457
|
+
.optional()
|
|
458
|
+
.describe("Environment to search in (defaults to production)"),
|
|
459
|
+
from_time: z
|
|
460
|
+
.string()
|
|
461
|
+
.optional()
|
|
462
|
+
.describe("Start time (uses shortcut default if not provided)"),
|
|
463
|
+
to_time: z
|
|
464
|
+
.string()
|
|
465
|
+
.optional()
|
|
466
|
+
.describe('End time (uses "now" if not provided)'),
|
|
467
|
+
time_zone: z
|
|
468
|
+
.string()
|
|
469
|
+
.optional()
|
|
470
|
+
.describe("Timezone for the search (defaults to UTC)"),
|
|
471
|
+
}, async ({ shortcut_name, resource_type, resource_name, parameters, environment = DEFAULT_ENVIRONMENT, from_time, to_time, time_zone, }) => {
|
|
472
|
+
if (!contextConfig) {
|
|
473
|
+
return {
|
|
474
|
+
content: [
|
|
475
|
+
{
|
|
476
|
+
type: "text",
|
|
477
|
+
text: JSON.stringify({
|
|
478
|
+
error: "No context configuration available",
|
|
479
|
+
}),
|
|
480
|
+
},
|
|
481
|
+
],
|
|
482
|
+
isError: true,
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
const shortcut = contextConfig.shortcuts[shortcut_name];
|
|
486
|
+
if (!shortcut) {
|
|
487
|
+
return {
|
|
488
|
+
content: [
|
|
489
|
+
{
|
|
490
|
+
type: "text",
|
|
491
|
+
text: JSON.stringify({
|
|
492
|
+
error: `Shortcut '${shortcut_name}' not found`,
|
|
493
|
+
availableShortcuts: Object.keys(contextConfig.shortcuts),
|
|
494
|
+
}),
|
|
495
|
+
},
|
|
496
|
+
],
|
|
497
|
+
isError: true,
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
const mapping = findSourceMapping(environment, resource_type, resource_name);
|
|
501
|
+
if (!mapping) {
|
|
502
|
+
return {
|
|
503
|
+
content: [
|
|
504
|
+
{
|
|
505
|
+
type: "text",
|
|
506
|
+
text: JSON.stringify({
|
|
507
|
+
error: `Resource '${resource_name}' not found in ${resource_type} for environment '${environment}'`,
|
|
508
|
+
}),
|
|
509
|
+
},
|
|
510
|
+
],
|
|
511
|
+
isError: true,
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
// Build the query with shortcut template
|
|
515
|
+
let shortcutQuery = shortcut.queryTemplate;
|
|
516
|
+
const allParams = { ...shortcut.defaultParams, ...parameters };
|
|
517
|
+
// Substitute parameters in template
|
|
518
|
+
Object.entries(allParams).forEach(([key, value]) => {
|
|
519
|
+
shortcutQuery = shortcutQuery.replace(new RegExp(`\\$\\{${key}\\}`, "g"), value);
|
|
520
|
+
});
|
|
521
|
+
const finalQuery = buildQueryFromMapping(mapping, shortcutQuery);
|
|
522
|
+
try {
|
|
523
|
+
const searchJobData = {
|
|
524
|
+
query: finalQuery,
|
|
525
|
+
from: from_time || shortcut.timeRange || "-15m",
|
|
526
|
+
to: to_time || "now",
|
|
527
|
+
timeZone: time_zone || "UTC",
|
|
528
|
+
};
|
|
529
|
+
const response = await sumoLogicClient.post("/v1/search/jobs", searchJobData);
|
|
530
|
+
return {
|
|
531
|
+
content: [
|
|
532
|
+
{
|
|
533
|
+
type: "text",
|
|
534
|
+
text: JSON.stringify({
|
|
535
|
+
searchJob: response.data,
|
|
536
|
+
contextUsed: {
|
|
537
|
+
shortcut: shortcut_name,
|
|
538
|
+
resource: `${environment}.${resource_type}.${resource_name}`,
|
|
539
|
+
finalQuery,
|
|
540
|
+
parametersUsed: allParams,
|
|
541
|
+
},
|
|
542
|
+
}, null, 2),
|
|
543
|
+
},
|
|
544
|
+
],
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
catch (error) {
|
|
548
|
+
return {
|
|
549
|
+
content: [
|
|
550
|
+
{
|
|
551
|
+
type: "text",
|
|
552
|
+
text: handleApiError(error),
|
|
553
|
+
},
|
|
554
|
+
],
|
|
555
|
+
isError: true,
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
// Keep all original tools for backward compatibility
|
|
560
|
+
server.tool("check_connection", "Check if the SumoLogic API connection is working and context is loaded", {}, async () => {
|
|
561
|
+
try {
|
|
562
|
+
await sumoLogicClient.get("/v1/collectors");
|
|
563
|
+
return {
|
|
564
|
+
content: [
|
|
565
|
+
{
|
|
566
|
+
type: "text",
|
|
567
|
+
text: JSON.stringify({
|
|
568
|
+
status: "success",
|
|
569
|
+
message: "Connection to SumoLogic API successful",
|
|
570
|
+
contextConfigLoaded: contextConfig !== null,
|
|
571
|
+
}),
|
|
572
|
+
},
|
|
573
|
+
],
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
catch (error) {
|
|
577
|
+
return {
|
|
578
|
+
content: [
|
|
579
|
+
{
|
|
580
|
+
type: "text",
|
|
581
|
+
text: JSON.stringify({
|
|
582
|
+
status: "error",
|
|
583
|
+
message: handleApiError(error),
|
|
584
|
+
}),
|
|
585
|
+
},
|
|
586
|
+
],
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
// Tool for listing collectors
|
|
591
|
+
server.tool("list_collectors", "List all SumoLogic collectors", async () => {
|
|
592
|
+
try {
|
|
593
|
+
const response = await sumoLogicClient.get("/v1/collectors");
|
|
594
|
+
return {
|
|
595
|
+
content: [
|
|
596
|
+
{
|
|
597
|
+
type: "text",
|
|
598
|
+
text: JSON.stringify(response.data, null, 2),
|
|
599
|
+
},
|
|
600
|
+
],
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
catch (error) {
|
|
604
|
+
return {
|
|
605
|
+
content: [
|
|
606
|
+
{
|
|
607
|
+
type: "text",
|
|
608
|
+
text: handleApiError(error),
|
|
609
|
+
},
|
|
610
|
+
],
|
|
611
|
+
isError: true,
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
// Tool for getting collector by ID
|
|
616
|
+
server.tool("get_collector", "Get a specific SumoLogic collector by ID", {
|
|
617
|
+
collector_id: z.string().describe("The ID of the collector to retrieve"),
|
|
618
|
+
}, async ({ collector_id }) => {
|
|
619
|
+
try {
|
|
620
|
+
const response = await sumoLogicClient.get(`/v1/collectors/${collector_id}`);
|
|
621
|
+
return {
|
|
622
|
+
content: [
|
|
623
|
+
{
|
|
624
|
+
type: "text",
|
|
625
|
+
text: JSON.stringify(response.data, null, 2),
|
|
626
|
+
},
|
|
627
|
+
],
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
catch (error) {
|
|
631
|
+
return {
|
|
632
|
+
content: [
|
|
633
|
+
{
|
|
634
|
+
type: "text",
|
|
635
|
+
text: handleApiError(error),
|
|
636
|
+
},
|
|
637
|
+
],
|
|
638
|
+
isError: true,
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
});
|
|
642
|
+
// Tool for executing a search query
|
|
643
|
+
server.tool("start_search_job", "Start a search job in SumoLogic", {
|
|
644
|
+
query: z.string().describe("The search query to execute"),
|
|
645
|
+
from_time: z
|
|
646
|
+
.string()
|
|
647
|
+
.describe('Start time for the search (e.g. "2023-04-01T00:00:00Z" or "-15m" for relative time)'),
|
|
648
|
+
to_time: z
|
|
649
|
+
.string()
|
|
650
|
+
.describe('End time for the search (e.g. "2023-04-01T01:00:00Z" or "now" for relative time)'),
|
|
651
|
+
time_zone: z
|
|
652
|
+
.string()
|
|
653
|
+
.optional()
|
|
654
|
+
.describe('Timezone for the search (e.g. "UTC")'),
|
|
655
|
+
}, async ({ query, from_time, to_time, time_zone }) => {
|
|
656
|
+
try {
|
|
657
|
+
const searchJobData = {
|
|
658
|
+
query,
|
|
659
|
+
from: from_time,
|
|
660
|
+
to: to_time,
|
|
661
|
+
timeZone: time_zone || "UTC",
|
|
662
|
+
};
|
|
663
|
+
const response = await sumoLogicClient.post("/v1/search/jobs", searchJobData);
|
|
664
|
+
return {
|
|
665
|
+
content: [
|
|
666
|
+
{
|
|
667
|
+
type: "text",
|
|
668
|
+
text: JSON.stringify(response.data, null, 2),
|
|
669
|
+
},
|
|
670
|
+
],
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
catch (error) {
|
|
674
|
+
return {
|
|
675
|
+
content: [
|
|
676
|
+
{
|
|
677
|
+
type: "text",
|
|
678
|
+
text: handleApiError(error),
|
|
679
|
+
},
|
|
680
|
+
],
|
|
681
|
+
isError: true,
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
});
|
|
685
|
+
// Tool for checking search job status
|
|
686
|
+
server.tool("check_search_job_status", "Check the status of a search job", {
|
|
687
|
+
job_id: z.string().describe("The ID of the search job to check"),
|
|
688
|
+
}, async ({ job_id }) => {
|
|
689
|
+
try {
|
|
690
|
+
const response = await sumoLogicClient.get(`/v1/search/jobs/${job_id}`);
|
|
691
|
+
return {
|
|
692
|
+
content: [
|
|
693
|
+
{
|
|
694
|
+
type: "text",
|
|
695
|
+
text: JSON.stringify(response.data, null, 2),
|
|
696
|
+
},
|
|
697
|
+
],
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
catch (error) {
|
|
701
|
+
return {
|
|
702
|
+
content: [
|
|
703
|
+
{
|
|
704
|
+
type: "text",
|
|
705
|
+
text: handleApiError(error),
|
|
706
|
+
},
|
|
707
|
+
],
|
|
708
|
+
isError: true,
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
// Tool for getting search job results
|
|
713
|
+
server.tool("get_search_job_results", "Get the results of a search job", {
|
|
714
|
+
job_id: z.string().describe("The ID of the search job to get results for"),
|
|
715
|
+
limit: z
|
|
716
|
+
.number()
|
|
717
|
+
.optional()
|
|
718
|
+
.describe("The maximum number of results to return"),
|
|
719
|
+
offset: z.number().optional().describe("The offset into the result set"),
|
|
720
|
+
}, async ({ job_id, limit, offset }) => {
|
|
721
|
+
try {
|
|
722
|
+
const url = `/v1/search/jobs/${job_id}/messages`;
|
|
723
|
+
const params = {};
|
|
724
|
+
if (limit !== undefined) {
|
|
725
|
+
params.limit = limit.toString();
|
|
726
|
+
}
|
|
727
|
+
if (offset !== undefined) {
|
|
728
|
+
params.offset = offset.toString();
|
|
729
|
+
}
|
|
730
|
+
const response = await sumoLogicClient.get(url, { params });
|
|
731
|
+
return {
|
|
732
|
+
content: [
|
|
733
|
+
{
|
|
734
|
+
type: "text",
|
|
735
|
+
text: JSON.stringify(response.data, null, 2),
|
|
736
|
+
},
|
|
737
|
+
],
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
catch (error) {
|
|
741
|
+
return {
|
|
742
|
+
content: [
|
|
743
|
+
{
|
|
744
|
+
type: "text",
|
|
745
|
+
text: handleApiError(error),
|
|
746
|
+
},
|
|
747
|
+
],
|
|
748
|
+
isError: true,
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
});
|
|
752
|
+
// Main function
|
|
753
|
+
async function main() {
|
|
754
|
+
// Load context configuration at startup
|
|
755
|
+
contextConfig = await loadContextConfig();
|
|
756
|
+
console.error("[sumologic] starting (stdio)...");
|
|
757
|
+
const transport = new StdioServerTransport();
|
|
758
|
+
try {
|
|
759
|
+
await server.connect(transport);
|
|
760
|
+
console.error("[sumologic] connected and ready");
|
|
761
|
+
if (contextConfig) {
|
|
762
|
+
console.error(`[sumologic] context loaded for organization: ${contextConfig.organization}`);
|
|
763
|
+
console.error(`[sumologic] available environments: ${Object.keys(contextConfig.environments).join(", ")}`);
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
catch (error) {
|
|
767
|
+
console.error("[sumologic] error connecting MCP server:", error);
|
|
768
|
+
process.exit(1);
|
|
769
|
+
}
|
|
770
|
+
const shutdown = () => process.exit(0);
|
|
771
|
+
process.on("SIGINT", shutdown);
|
|
772
|
+
process.on("SIGTERM", shutdown);
|
|
773
|
+
}
|
|
774
|
+
// Guard late rejections so they can't crash the process and reset state.
|
|
775
|
+
process.on("unhandledRejection", (reason) => {
|
|
776
|
+
console.error(`[sumologic] unhandled rejection (ignored): ${reason}`);
|
|
777
|
+
});
|
|
778
|
+
// Start the server
|
|
779
|
+
main().catch((error) => {
|
|
780
|
+
console.error("[sumologic] fatal:", error);
|
|
781
|
+
process.exit(1);
|
|
782
|
+
});
|
|
783
|
+
//# source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jD,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO,CAAC,KAAK,CACX,gDAAgD,aAAa,CAAC,YAAY,EAAE,CAC7E,CAAC;YACF,OAAO,CAAC,KAAK,CACX,uCAAuC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC5F,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0CAA0C,EAAE,KAAK,CAAC,CAAC;QACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAClC,CAAC;AAED,yEAAyE;AACzE,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,EAAE;IAC1C,OAAO,CAAC,KAAK,CAAC,8CAA8C,MAAM,EAAE,CAAC,CAAC;AACxE,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;IAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mpurdon/mcp-sumologic",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Local stdio MCP server for the Sumo Logic search API.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"sumologic": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"mcp",
|
|
18
|
+
"model-context-protocol",
|
|
19
|
+
"sumologic",
|
|
20
|
+
"logs",
|
|
21
|
+
"claude"
|
|
22
|
+
],
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"author": "Matthew Purdon",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/mpurdon/mcp-servers.git",
|
|
28
|
+
"directory": "packages/sumologic"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@modelcontextprotocol/sdk": "^1.18.1",
|
|
32
|
+
"axios": "^1.7.9",
|
|
33
|
+
"dotenv": "^16.4.7",
|
|
34
|
+
"zod": "^3.23.8"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^22.10.2",
|
|
38
|
+
"eslint": "^9.17.0",
|
|
39
|
+
"tsx": "^4.19.2",
|
|
40
|
+
"typescript": "^5.7.2",
|
|
41
|
+
"@mpurdon/eslint-config": "0.0.0",
|
|
42
|
+
"@mpurdon/tsconfig": "0.0.0"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=20"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsc",
|
|
49
|
+
"dev": "tsx src/index.ts",
|
|
50
|
+
"start": "node dist/index.js",
|
|
51
|
+
"typecheck": "tsc --noEmit",
|
|
52
|
+
"lint": "eslint ."
|
|
53
|
+
}
|
|
54
|
+
}
|