@pipeworx/mcp-animequotes 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 +36 -0
- package/package.json +10 -0
- package/src/index.ts +141 -0
- package/tsconfig.json +9 -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,36 @@
|
|
|
1
|
+
# @pipeworx/mcp-animequotes
|
|
2
|
+
|
|
3
|
+
MCP server for [Animechan](https://animechan.io) — random anime quotes, search by anime series or character name. Free, no auth required.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Description |
|
|
8
|
+
|------|-------------|
|
|
9
|
+
| `random_quote` | Get a random anime quote |
|
|
10
|
+
| `search_by_anime` | Get quotes from a specific anime series |
|
|
11
|
+
| `search_by_character` | Get quotes from a specific character |
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
Add to your MCP client config:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"animequotes": {
|
|
21
|
+
"type": "url",
|
|
22
|
+
"url": "https://gateway.pipeworx.io/animequotes"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## CLI Usage
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx @anthropic-ai/mcp-client https://gateway.pipeworx.io/animequotes
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## License
|
|
35
|
+
|
|
36
|
+
MIT
|
package/package.json
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AnimeQuotes MCP — wraps animechan.io (free, no auth)
|
|
3
|
+
*
|
|
4
|
+
* Tools:
|
|
5
|
+
* - random_quote: Get a random anime quote
|
|
6
|
+
* - search_by_anime: Get quotes from a specific anime series
|
|
7
|
+
* - search_by_character: Get quotes from a specific character
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
interface McpToolDefinition {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
inputSchema: {
|
|
14
|
+
type: 'object';
|
|
15
|
+
properties: Record<string, unknown>;
|
|
16
|
+
required?: string[];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface McpToolExport {
|
|
21
|
+
tools: McpToolDefinition[];
|
|
22
|
+
callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const BASE_URL = 'https://animechan.io/api/v1';
|
|
26
|
+
|
|
27
|
+
interface RawQuote {
|
|
28
|
+
data?: {
|
|
29
|
+
content: string;
|
|
30
|
+
anime: { name: string };
|
|
31
|
+
character: { name: string };
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface RawQuoteList {
|
|
36
|
+
data?: Array<{
|
|
37
|
+
content: string;
|
|
38
|
+
anime: { name: string };
|
|
39
|
+
character: { name: string };
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function formatQuote(entry: {
|
|
44
|
+
content: string;
|
|
45
|
+
anime: { name: string };
|
|
46
|
+
character: { name: string };
|
|
47
|
+
}) {
|
|
48
|
+
return {
|
|
49
|
+
quote: entry.content,
|
|
50
|
+
character: entry.character.name,
|
|
51
|
+
anime: entry.anime.name,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const tools: McpToolExport['tools'] = [
|
|
56
|
+
{
|
|
57
|
+
name: 'random_quote',
|
|
58
|
+
description: 'Get a single random quote from an anime series.',
|
|
59
|
+
inputSchema: {
|
|
60
|
+
type: 'object',
|
|
61
|
+
properties: {},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'search_by_anime',
|
|
66
|
+
description: 'Get quotes from a specific anime series by name.',
|
|
67
|
+
inputSchema: {
|
|
68
|
+
type: 'object',
|
|
69
|
+
properties: {
|
|
70
|
+
anime: {
|
|
71
|
+
type: 'string',
|
|
72
|
+
description: 'Name of the anime series (e.g., "Naruto", "Attack on Titan")',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
required: ['anime'],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'search_by_character',
|
|
80
|
+
description: 'Get quotes from a specific anime character by name.',
|
|
81
|
+
inputSchema: {
|
|
82
|
+
type: 'object',
|
|
83
|
+
properties: {
|
|
84
|
+
character: {
|
|
85
|
+
type: 'string',
|
|
86
|
+
description: 'Name of the anime character (e.g., "Naruto Uzumaki", "Levi Ackerman")',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
required: ['character'],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
];
|
|
93
|
+
|
|
94
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
95
|
+
switch (name) {
|
|
96
|
+
case 'random_quote':
|
|
97
|
+
return randomQuote();
|
|
98
|
+
case 'search_by_anime':
|
|
99
|
+
return searchByAnime(args.anime as string);
|
|
100
|
+
case 'search_by_character':
|
|
101
|
+
return searchByCharacter(args.character as string);
|
|
102
|
+
default:
|
|
103
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
async function randomQuote() {
|
|
108
|
+
const res = await fetch(`${BASE_URL}/quotes/random`);
|
|
109
|
+
if (!res.ok) throw new Error(`animechan.io error: ${res.status}`);
|
|
110
|
+
const data = (await res.json()) as RawQuote;
|
|
111
|
+
if (!data.data) throw new Error('animechan.io error: empty response');
|
|
112
|
+
return formatQuote(data.data);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
async function searchByAnime(anime: string) {
|
|
116
|
+
const url = `${BASE_URL}/quotes?anime=${encodeURIComponent(anime)}`;
|
|
117
|
+
const res = await fetch(url);
|
|
118
|
+
if (!res.ok) throw new Error(`animechan.io error: ${res.status}`);
|
|
119
|
+
const data = (await res.json()) as RawQuoteList;
|
|
120
|
+
const quotes = data.data ?? [];
|
|
121
|
+
return {
|
|
122
|
+
anime,
|
|
123
|
+
count: quotes.length,
|
|
124
|
+
quotes: quotes.map(formatQuote),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async function searchByCharacter(character: string) {
|
|
129
|
+
const url = `${BASE_URL}/quotes?character=${encodeURIComponent(character)}`;
|
|
130
|
+
const res = await fetch(url);
|
|
131
|
+
if (!res.ok) throw new Error(`animechan.io error: ${res.status}`);
|
|
132
|
+
const data = (await res.json()) as RawQuoteList;
|
|
133
|
+
const quotes = data.data ?? [];
|
|
134
|
+
return {
|
|
135
|
+
character,
|
|
136
|
+
count: quotes.length,
|
|
137
|
+
quotes: quotes.map(formatQuote),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export default { tools, callTool } satisfies McpToolExport;
|