@pipeworx/mcp-cataas 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 +34 -0
- package/package.json +20 -0
- package/server.json +18 -0
- package/src/index.ts +137 -0
- package/tsconfig.json +14 -0
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,34 @@
|
|
|
1
|
+
# mcp-cataas
|
|
2
|
+
|
|
3
|
+
CATAAS MCP — Cat as a Service (free, no auth)
|
|
4
|
+
|
|
5
|
+
Part of the [Pipeworx](https://pipeworx.io) open MCP gateway.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
|
|
12
|
+
## Quick Start
|
|
13
|
+
|
|
14
|
+
Add to your MCP client config:
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"mcpServers": {
|
|
19
|
+
"cataas": {
|
|
20
|
+
"url": "https://gateway.pipeworx.io/cataas/mcp"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or use the CLI:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx pipeworx use cataas
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## License
|
|
33
|
+
|
|
34
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-cataas",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CATAAS MCP — Cat as a Service (free, no auth)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "cataas"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/pipeworx-io/mcp-cataas"
|
|
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/cataas",
|
|
4
|
+
"title": "cataas",
|
|
5
|
+
"description": "CATAAS MCP — Cat as a Service (free, no auth)",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/cataas",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-cataas",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/cataas/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
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
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* CATAAS MCP — Cat as a Service (free, no auth)
|
|
18
|
+
*
|
|
19
|
+
* Returns cat image URLs and metadata from cataas.com.
|
|
20
|
+
* Base: https://cataas.com
|
|
21
|
+
*
|
|
22
|
+
* Tools:
|
|
23
|
+
* - random_cat: Get a random cat image URL and metadata
|
|
24
|
+
* - cat_by_tag: Get a cat image URL filtered by a specific tag
|
|
25
|
+
* - list_tags: List all available cat tags
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const BASE_URL = 'https://cataas.com';
|
|
30
|
+
|
|
31
|
+
type RawCatJson = {
|
|
32
|
+
id: string;
|
|
33
|
+
tags: string[];
|
|
34
|
+
url?: string;
|
|
35
|
+
createdAt?: string;
|
|
36
|
+
updatedAt?: string;
|
|
37
|
+
mimetype?: string;
|
|
38
|
+
size?: number;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
type RawTagsResponse = string[];
|
|
42
|
+
|
|
43
|
+
const tools: McpToolExport['tools'] = [
|
|
44
|
+
{
|
|
45
|
+
name: 'random_cat',
|
|
46
|
+
description:
|
|
47
|
+
'Get a random cat image from CATAAS (Cat as a Service). Returns the image URL, cat ID, and associated tags.',
|
|
48
|
+
inputSchema: {
|
|
49
|
+
type: 'object',
|
|
50
|
+
properties: {},
|
|
51
|
+
required: [],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'cat_by_tag',
|
|
56
|
+
description:
|
|
57
|
+
'Get a random cat image matching a specific tag from CATAAS. Use list_tags first to discover available tags. Returns the image URL, cat ID, and tags.',
|
|
58
|
+
inputSchema: {
|
|
59
|
+
type: 'object',
|
|
60
|
+
properties: {
|
|
61
|
+
tag: {
|
|
62
|
+
type: 'string',
|
|
63
|
+
description:
|
|
64
|
+
'Tag to filter cats by (e.g. "cute", "orange", "grumpy"). Use list_tags to see available tags.',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
required: ['tag'],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'list_tags',
|
|
72
|
+
description:
|
|
73
|
+
'List all available cat tags on CATAAS. Use these tags with cat_by_tag to find cats of a specific type or appearance.',
|
|
74
|
+
inputSchema: {
|
|
75
|
+
type: 'object',
|
|
76
|
+
properties: {},
|
|
77
|
+
required: [],
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
83
|
+
switch (name) {
|
|
84
|
+
case 'random_cat':
|
|
85
|
+
return randomCat();
|
|
86
|
+
case 'cat_by_tag':
|
|
87
|
+
return catByTag(args.tag as string);
|
|
88
|
+
case 'list_tags':
|
|
89
|
+
return listTags();
|
|
90
|
+
default:
|
|
91
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function buildCatUrl(id: string): string {
|
|
96
|
+
return `${BASE_URL}/cat/${id}`;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async function randomCat() {
|
|
100
|
+
const res = await fetch(`${BASE_URL}/cat?json=true`);
|
|
101
|
+
if (!res.ok) throw new Error(`CATAAS API error: ${res.status}`);
|
|
102
|
+
const data = (await res.json()) as RawCatJson;
|
|
103
|
+
return {
|
|
104
|
+
id: data.id,
|
|
105
|
+
url: buildCatUrl(data.id),
|
|
106
|
+
tags: data.tags ?? [],
|
|
107
|
+
mimetype: data.mimetype ?? null,
|
|
108
|
+
created_at: data.createdAt ?? null,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
async function catByTag(tag: string) {
|
|
113
|
+
const encodedTag = encodeURIComponent(tag);
|
|
114
|
+
const res = await fetch(`${BASE_URL}/cat/${encodedTag}?json=true`);
|
|
115
|
+
if (!res.ok) throw new Error(`CATAAS API error: ${res.status}`);
|
|
116
|
+
const data = (await res.json()) as RawCatJson;
|
|
117
|
+
return {
|
|
118
|
+
id: data.id,
|
|
119
|
+
url: buildCatUrl(data.id),
|
|
120
|
+
tags: data.tags ?? [],
|
|
121
|
+
mimetype: data.mimetype ?? null,
|
|
122
|
+
created_at: data.createdAt ?? null,
|
|
123
|
+
searched_tag: tag,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
async function listTags() {
|
|
128
|
+
const res = await fetch(`${BASE_URL}/api/tags`);
|
|
129
|
+
if (!res.ok) throw new Error(`CATAAS API error: ${res.status}`);
|
|
130
|
+
const data = (await res.json()) as RawTagsResponse;
|
|
131
|
+
return {
|
|
132
|
+
count: data.length,
|
|
133
|
+
tags: data,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
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
|
+
}
|