@pipeworx/mcp-ecosystems 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-ecosystems
2
+
3
+ ecosyste.ms Packages MCP.
4
+
5
+ Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 839+ 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
+ "ecosystems": {
20
+ "url": "https://gateway.pipeworx.io/ecosystems/mcp"
21
+ }
22
+ }
23
+ }
24
+ ```
25
+
26
+ Or connect to the full Pipeworx gateway for access to all 839+ 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 Ecosystems 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-ecosystems",
3
+ "version": "0.1.0",
4
+ "description": "ecosyste.ms Packages MCP.",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "ecosystems"],
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/pipeworx-io/mcp-ecosystems"
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/ecosystems",
4
+ "title": "Ecosystems",
5
+ "description": "ecosyste.ms Packages MCP.",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/ecosystems",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-ecosystems",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/ecosystems/mcp"
16
+ }
17
+ ]
18
+ }
package/src/index.ts ADDED
@@ -0,0 +1,169 @@
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
+ * ecosyste.ms Packages MCP.
21
+ *
22
+ * Open metadata for open-source packages across 100+ registries (npm, PyPI,
23
+ * crates.io, Go, NuGet, Maven, RubyGems, Packagist, Docker Hub, etc.) with
24
+ * cross-registry dependency and usage data. Keyless. A cross-registry
25
+ * complement to deps.dev and individual registry packs.
26
+ */
27
+
28
+
29
+ const BASE = 'https://packages.ecosyste.ms/api/v1';
30
+ const UA = 'pipeworx/1.0 (+https://pipeworx.io)';
31
+
32
+ const tools: McpToolExport['tools'] = [
33
+ {
34
+ name: 'get_package',
35
+ description:
36
+ "Get a package's open metadata from ecosyste.ms — description, homepage, repository, license, latest version, monthly downloads, and dependent/usage counts. Works across 100+ registries. Keyless.",
37
+ inputSchema: {
38
+ type: 'object',
39
+ properties: {
40
+ name: {
41
+ type: 'string',
42
+ description: 'Package name, e.g. "react", "@vue/cli", "django". Scopes/slashes are handled automatically.',
43
+ },
44
+ registry: {
45
+ type: 'string',
46
+ description:
47
+ 'Registry name (default "npmjs.org"). e.g. "pypi.org", "crates.io", "rubygems.org", "nuget.org". Use list_registries to discover names.',
48
+ },
49
+ },
50
+ required: ['name'],
51
+ },
52
+ },
53
+ {
54
+ name: 'lookup_package',
55
+ description:
56
+ 'Look up every registry a package or repository is published to, via package URL (purl) or repository URL. Returns matching package records across all registries. Keyless.',
57
+ inputSchema: {
58
+ type: 'object',
59
+ properties: {
60
+ purl: { type: 'string', description: 'A package URL, e.g. "pkg:npm/lodash" or "pkg:pypi/django".' },
61
+ repository_url: {
62
+ type: 'string',
63
+ description: 'A source repository URL, e.g. "https://github.com/facebook/react".',
64
+ },
65
+ },
66
+ },
67
+ },
68
+ {
69
+ name: 'list_registries',
70
+ description:
71
+ 'List the package registries ecosyste.ms supports (npm, PyPI, crates.io, Go, NuGet, Maven, RubyGems, Packagist, Docker Hub, and 100+ more) with their ecosystem and package counts. Keyless.',
72
+ inputSchema: { type: 'object', properties: {} },
73
+ },
74
+ ];
75
+
76
+ async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
77
+ try {
78
+ switch (name) {
79
+ case 'get_package':
80
+ return getPackage(args);
81
+ case 'lookup_package':
82
+ return lookupPackage(args);
83
+ case 'list_registries':
84
+ return listRegistries();
85
+ default:
86
+ return { error: `Unknown tool: ${name}` };
87
+ }
88
+ } catch (e) {
89
+ return { error: e instanceof Error ? e.message : String(e) };
90
+ }
91
+ }
92
+
93
+ async function getPackage(args: Record<string, unknown>): Promise<unknown> {
94
+ const name = typeof args.name === 'string' ? args.name.trim() : '';
95
+ if (!name) return { error: 'provide a package name', name: args.name ?? null };
96
+ const registry = (typeof args.registry === 'string' && args.registry.trim()) || 'npmjs.org';
97
+
98
+ const url = `${BASE}/registries/${encodeURIComponent(registry)}/packages/${encodeURIComponent(name)}`;
99
+ const res = await fetch(url, { headers: { Accept: 'application/json', 'User-Agent': UA } });
100
+ if (res.status === 404) return { error: 'package not found', name, registry };
101
+ if (!res.ok) return { error: `ecosyste.ms: ${res.status} ${(await res.text()).slice(0, 200)}` };
102
+
103
+ const p = (await res.json()) as Record<string, unknown>;
104
+ return {
105
+ name: p.name,
106
+ ecosystem: p.ecosystem,
107
+ registry,
108
+ description: p.description,
109
+ homepage: p.homepage,
110
+ repository_url: p.repository_url,
111
+ licenses: p.normalized_licenses ?? p.licenses,
112
+ latest_version: p.latest_release_number,
113
+ latest_published: p.latest_release_published_at,
114
+ downloads: p.downloads,
115
+ dependent_packages: p.dependent_packages_count,
116
+ dependent_repos: p.dependent_repos_count,
117
+ versions_count: p.versions_count,
118
+ keywords: p.keywords ?? p.keywords_array,
119
+ status: p.status,
120
+ };
121
+ }
122
+
123
+ async function lookupPackage(args: Record<string, unknown>): Promise<unknown> {
124
+ const purl = typeof args.purl === 'string' ? args.purl.trim() : '';
125
+ const repositoryUrl = typeof args.repository_url === 'string' ? args.repository_url.trim() : '';
126
+ if (!purl && !repositoryUrl) return { error: 'provide purl or repository_url' };
127
+
128
+ const qs = purl
129
+ ? `purl=${encodeURIComponent(purl)}`
130
+ : `repository_url=${encodeURIComponent(repositoryUrl)}`;
131
+ const res = await fetch(`${BASE}/packages/lookup?${qs}`, {
132
+ headers: { Accept: 'application/json', 'User-Agent': UA },
133
+ });
134
+ if (!res.ok) return { error: `ecosyste.ms: ${res.status} ${(await res.text()).slice(0, 200)}` };
135
+
136
+ const arr = (await res.json()) as Array<Record<string, unknown>>;
137
+ const list = Array.isArray(arr) ? arr : [];
138
+ return {
139
+ count: list.length,
140
+ packages: list.map((p) => ({
141
+ name: p.name,
142
+ ecosystem: p.ecosystem,
143
+ registry: (p.registry as Record<string, unknown> | undefined)?.name,
144
+ description: p.description,
145
+ latest_version: p.latest_release_number,
146
+ dependent_packages: p.dependent_packages_count,
147
+ })),
148
+ };
149
+ }
150
+
151
+ async function listRegistries(): Promise<unknown> {
152
+ const res = await fetch(`${BASE}/registries`, {
153
+ headers: { Accept: 'application/json', 'User-Agent': UA },
154
+ });
155
+ if (!res.ok) return { error: `ecosyste.ms: ${res.status} ${(await res.text()).slice(0, 200)}` };
156
+
157
+ const arr = (await res.json()) as Array<Record<string, unknown>>;
158
+ const list = Array.isArray(arr) ? arr : [];
159
+ return {
160
+ count: list.length,
161
+ registries: list.map((r) => ({
162
+ name: r.name,
163
+ ecosystem: r.ecosystem,
164
+ packages_count: r.packages_count,
165
+ })),
166
+ };
167
+ }
168
+
169
+ 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
+ }