@pipeworx/mcp-greynoise 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pipeworx
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,55 @@
1
+ # mcp-greynoise
2
+
3
+ GreyNoise Community MCP — internet scanner classification (free tier with key)
4
+
5
+ Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 250+ live data sources.
6
+
7
+ ## Tools
8
+
9
+ | Tool | Description |
10
+ |------|-------------|
11
+
12
+ ## Quick Start
13
+
14
+ Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
15
+
16
+ ```json
17
+ {
18
+ "mcpServers": {
19
+ "greynoise": {
20
+ "url": "https://gateway.pipeworx.io/greynoise/mcp"
21
+ }
22
+ }
23
+ }
24
+ ```
25
+
26
+ Or connect to the full Pipeworx gateway for access to all 250+ data sources:
27
+
28
+ ```json
29
+ {
30
+ "mcpServers": {
31
+ "pipeworx": {
32
+ "url": "https://gateway.pipeworx.io/mcp"
33
+ }
34
+ }
35
+ }
36
+ ```
37
+
38
+ ## Using with ask_pipeworx
39
+
40
+ Instead of calling tools directly, you can ask questions in plain English:
41
+
42
+ ```
43
+ ask_pipeworx({ question: "your question about Greynoise data" })
44
+ ```
45
+
46
+ The gateway picks the right tool and fills the arguments automatically.
47
+
48
+ ## More
49
+
50
+ - [All tools and guides](https://github.com/pipeworx-io/examples)
51
+ - [pipeworx.io](https://pipeworx.io)
52
+
53
+ ## License
54
+
55
+ MIT
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@pipeworx/mcp-greynoise",
3
+ "version": "0.1.0",
4
+ "description": "GreyNoise Community MCP — internet scanner classification (free tier with key)",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "greynoise"],
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/pipeworx-io/mcp-greynoise"
13
+ },
14
+ "scripts": {
15
+ "typecheck": "tsc --noEmit"
16
+ },
17
+ "devDependencies": {
18
+ "typescript": "^5.7.0"
19
+ }
20
+ }
package/server.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.pipeworx-io/greynoise",
4
+ "title": "Greynoise",
5
+ "description": "GreyNoise Community MCP — internet scanner classification (free tier with key)",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/greynoise",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-greynoise",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/greynoise/mcp"
16
+ }
17
+ ]
18
+ }
package/src/index.ts ADDED
@@ -0,0 +1,115 @@
1
+ interface McpToolDefinition {
2
+ name: string;
3
+ description: string;
4
+ inputSchema: {
5
+ type: 'object';
6
+ properties: Record<string, unknown>;
7
+ required?: string[];
8
+ };
9
+ }
10
+
11
+ interface McpToolExport {
12
+ tools: McpToolDefinition[];
13
+ callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
14
+ meter?: { credits: number };
15
+ cost?: Record<string, unknown>;
16
+ provider?: string;
17
+ }
18
+
19
+ /**
20
+ * GreyNoise Community MCP — internet scanner classification (free tier with key)
21
+ *
22
+ * GreyNoise separates "internet background noise" (mass scanners, search
23
+ * engines, benign crawlers) from targeted activity. When triaging an alert,
24
+ * checking the source IP against GreyNoise tells you whether you're seeing
25
+ * targeted intent or one of the billions of daily opportunistic probes.
26
+ *
27
+ * Pairs with: shodan-internetdb (what the IP is running), abuseipdb (community
28
+ * abuse reports), nvd (vulns related to surfaced services).
29
+ *
30
+ * API: https://docs.greynoise.io/reference/community-api
31
+ * Tools:
32
+ * - ip_context: noise/RIOT classification, name, last seen, link
33
+ */
34
+
35
+
36
+ const BASE_URL = 'https://api.greynoise.io/v3/community';
37
+
38
+ const tools: McpToolExport['tools'] = [
39
+ {
40
+ name: 'ip_context',
41
+ description:
42
+ 'Look up an IPv4 against the GreyNoise Community dataset. Returns noise (is the IP scanning the internet?), riot (is it a known good service like Google/Microsoft?), classification (malicious | benign | unknown), name, last-seen date, and a deep link. Useful for noise-suppression in SOC alerts.',
43
+ inputSchema: {
44
+ type: 'object',
45
+ properties: {
46
+ ip: { type: 'string', description: 'IPv4 address' },
47
+ },
48
+ required: ['ip'],
49
+ },
50
+ },
51
+ ];
52
+
53
+ async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
54
+ const apiKey = (args._apiKey as string | undefined)?.trim();
55
+ if (!apiKey) {
56
+ throw new Error(
57
+ 'GreyNoise requires an API key. Contact the operator about platform credentials, or BYO via ?_apiKey=<key> after registering a free Community account at https://viz.greynoise.io',
58
+ );
59
+ }
60
+ switch (name) {
61
+ case 'ip_context':
62
+ return ipContext(apiKey, String(args.ip).trim());
63
+ default:
64
+ throw new Error(`Unknown tool: ${name}`);
65
+ }
66
+ }
67
+
68
+ interface CommunityResponse {
69
+ ip?: string;
70
+ noise?: boolean;
71
+ riot?: boolean;
72
+ classification?: string;
73
+ name?: string;
74
+ link?: string;
75
+ last_seen?: string;
76
+ message?: string;
77
+ }
78
+
79
+ async function ipContext(apiKey: string, ip: string) {
80
+ if (!ip) throw new Error('ip is required');
81
+ const res = await fetch(`${BASE_URL}/${encodeURIComponent(ip)}`, {
82
+ headers: { key: apiKey, Accept: 'application/json' },
83
+ });
84
+ if (res.status === 401 || res.status === 403) throw new Error('GreyNoise: unauthorized — check the API key');
85
+ if (res.status === 429) throw new Error('GreyNoise: rate-limit hit (HTTP 429)');
86
+ if (res.status === 404) {
87
+ // GreyNoise returns 404 for IPs they have no observation of — surface as a structured result
88
+ return {
89
+ ip,
90
+ observed: false,
91
+ noise: false,
92
+ riot: false,
93
+ classification: 'unknown',
94
+ message: 'IP not observed in GreyNoise (no scanner activity recorded)',
95
+ };
96
+ }
97
+ if (!res.ok) {
98
+ const body = await res.text();
99
+ throw new Error(`GreyNoise error: ${res.status} ${body.slice(0, 200)}`);
100
+ }
101
+ const data = (await res.json()) as CommunityResponse;
102
+ return {
103
+ ip: data.ip ?? ip,
104
+ observed: true,
105
+ noise: data.noise ?? false,
106
+ riot: data.riot ?? false,
107
+ classification: data.classification ?? 'unknown',
108
+ name: data.name ?? null,
109
+ last_seen: data.last_seen ?? null,
110
+ link: data.link ?? `https://viz.greynoise.io/ip/${ip}`,
111
+ message: data.message ?? null,
112
+ };
113
+ }
114
+
115
+ export default { tools, callTool, meter: { credits: 1 } } satisfies McpToolExport;
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "strict": true,
7
+ "esModuleInterop": true,
8
+ "skipLibCheck": true,
9
+ "outDir": "dist",
10
+ "rootDir": "src",
11
+ "declaration": true
12
+ },
13
+ "include": ["src"]
14
+ }