dank-meme-sounds 0.0.0-stage → 0.3.1
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 +152 -2
- package/index.mjs +171 -0
- package/package.json +48 -4
- package/play.mjs +26 -0
- package/server.json +28 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DankMachine
|
|
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
CHANGED
|
@@ -1,3 +1,153 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dank-meme-sounds
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**A meme soundboard for AI agents.** Give Claude, Cursor, Codex, ChatGPT or any MCP client instant access to **38,000+ meme sound effects** from [DankMachine](https://dankmachine.com): vine boom, bruh, sad violin, airhorn, Windows XP error, anime wow, and every reaction sound the internet runs on.
|
|
4
|
+
|
|
5
|
+
Your agent can **find the right sound for a moment** ("my code finally compiled", "awkward silence", "someone got roasted"), search by name, mood or use case, see what's trending right now, and **play it out loud** on your speakers.
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/dank-meme-sounds)
|
|
8
|
+
[](https://dankmachine.com/developers/)
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
|
|
11
|
+
- 🔊 38k+ sounds, each with an MP3 URL and a sound page; the most popular ones have their own pixel-art icon
|
|
12
|
+
- 🧠 Sounds come with AI-written metadata: what it is, **when to use it**, moods, use cases and alternate names
|
|
13
|
+
- 🎯 `find_reaction_sound`: describe the situation, get the fitting sounds
|
|
14
|
+
- 📈 Live trending from real plays on dankmachine.com (1h / 24h / 7d)
|
|
15
|
+
- ▶️ `play_sound` plays it locally (macOS, Windows, Linux) — great for coding-agent hooks
|
|
16
|
+
- 🌐 Zero setup remote server, or a tiny local npm package. No API key.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Quick start
|
|
21
|
+
|
|
22
|
+
### Remote server (no install)
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
claude mcp add --transport http dank-meme-sounds https://dankmachine.com/mcp
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Any client that supports Streamable HTTP:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcpServers": {
|
|
33
|
+
"dank-meme-sounds": { "url": "https://dankmachine.com/mcp" }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Local server (adds `play_sound` on your speakers)
|
|
39
|
+
|
|
40
|
+
**Claude Code**
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
claude mcp add dankmachine -- npx -y dank-meme-sounds
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Claude Desktop / Cursor / Windsurf / Cline / Zed** (`mcpServers` config)
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"mcpServers": {
|
|
51
|
+
"dankmachine": { "command": "npx", "args": ["-y", "dank-meme-sounds"] }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**VS Code** (`.vscode/mcp.json`)
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"servers": {
|
|
61
|
+
"dankmachine": { "type": "stdio", "command": "npx", "args": ["-y", "dank-meme-sounds"] }
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**OpenAI Codex CLI** (`~/.codex/config.toml`)
|
|
67
|
+
|
|
68
|
+
```toml
|
|
69
|
+
[mcp_servers.dankmachine]
|
|
70
|
+
command = "npx"
|
|
71
|
+
args = ["-y", "dank-meme-sounds"]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Requires Node.js 20+.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Tools
|
|
79
|
+
|
|
80
|
+
| Tool | What it does | Example |
|
|
81
|
+
| --- | --- | --- |
|
|
82
|
+
| `find_reaction_sound` | Describe a moment, get the best-fitting sounds with what each means and when to use it | "my build failed again" → sad trombone, bruh, windows error |
|
|
83
|
+
| `get_trending_sounds` | What people are playing on DankMachine right now (`1h`, `24h`, `7d`) | "what's trending today?" |
|
|
84
|
+
| `search_sounds` | Search by title, tags, category or vibe | "vine boom", "minecraft", "anime" |
|
|
85
|
+
| `random_sound` | Random sound, optionally by category or vibe (funny, hype, cursed, wholesome, scary, sad, epic, dramatic…) | "random cursed sound" |
|
|
86
|
+
| `get_sound` | One sound by slug or best match | `vine-boom-sound-70972` |
|
|
87
|
+
| `list_categories` | All categories with counts (memes, gaming, reactions, anime, brainrot, tiktok…) | |
|
|
88
|
+
| `play_sound` | **Local only.** Plays the sound on your speakers (afplay, Windows MediaPlayer, mpg123/ffplay/paplay) | "play an airhorn when tests pass" |
|
|
89
|
+
|
|
90
|
+
Every result includes the title, category, tags, an `audio` MP3 URL, a pixel-art `image` when available, and the `page` on dankmachine.com.
|
|
91
|
+
|
|
92
|
+
### Prompts to try
|
|
93
|
+
|
|
94
|
+
- *"Play vine boom when the tests pass and sad violin when they fail."*
|
|
95
|
+
- *"Find me a sound for a dramatic reveal in my video."*
|
|
96
|
+
- *"What are the top 5 trending meme sounds today?"*
|
|
97
|
+
- *"Give me three hype sounds for my stream intro, with links."*
|
|
98
|
+
- *"Pick a random cursed sound and play it."*
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Sound effects for your coding agent (Claude Code hooks)
|
|
103
|
+
|
|
104
|
+
`npx dank-meme-sounds play "<query>"` plays a sound from the terminal, so hooks can use it. Add to `~/.claude/settings.json`:
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"hooks": {
|
|
109
|
+
"Stop": [{ "hooks": [{ "type": "command", "command": "npx -y dank-meme-sounds play \"vine boom\"" }] }],
|
|
110
|
+
"Notification": [{ "hooks": [{ "type": "command", "command": "npx -y dank-meme-sounds play \"discord notification\"" }] }],
|
|
111
|
+
"SessionStart": [{ "hooks": [{ "type": "command", "command": "npx -y dank-meme-sounds play \"windows xp startup\"" }] }]
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Sounds are cached in your temp folder after the first play, and the CLI never fails a hook (it exits 0 when offline).
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## REST API
|
|
121
|
+
|
|
122
|
+
The same catalog is a free JSON API with CORS, no key:
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
GET https://dankmachine.com/api/v1/search?q=vine%20boom&limit=5
|
|
126
|
+
GET https://dankmachine.com/api/v1/reaction?situation=my%20code%20compiled
|
|
127
|
+
GET https://dankmachine.com/api/v1/trending?window=24h
|
|
128
|
+
GET https://dankmachine.com/api/v1/sounds/<slug>
|
|
129
|
+
GET https://dankmachine.com/api/v1/sounds.json (full catalog)
|
|
130
|
+
GET https://dankmachine.com/api/v1/categories.json
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Docs: https://dankmachine.com/developers/
|
|
134
|
+
|
|
135
|
+
## Configuration
|
|
136
|
+
|
|
137
|
+
| Env var | Default | Purpose |
|
|
138
|
+
| --- | --- | --- |
|
|
139
|
+
| `DANKMACHINE_API` | `https://dankmachine.com/api/v1` | Point the local server at another catalog |
|
|
140
|
+
|
|
141
|
+
## More from DankMachine
|
|
142
|
+
|
|
143
|
+
- **Live sound chat**: https://dankmachine.com/rooms/ — IRC-style chat where every sound plays for everyone
|
|
144
|
+
- **OBS overlay** for streamers: https://dankmachine.com/obs/?r=lobby
|
|
145
|
+
- **Upload your own sounds**: https://dankmachine.com/upload/
|
|
146
|
+
|
|
147
|
+
## Content and rights
|
|
148
|
+
|
|
149
|
+
Sounds are user-contributed meme clips; `rights_status` is `unverified`. Removal requests: https://dankmachine.com/takedown/
|
|
150
|
+
|
|
151
|
+
## License
|
|
152
|
+
|
|
153
|
+
MIT for this server's code. Sounds belong to their respective owners.
|
package/index.mjs
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// DankMachine MCP server (stdio). Reads the public catalog from DANKMACHINE_API (default https://dankmachine.com/api/v1).
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { playFile } from './play.mjs';
|
|
10
|
+
|
|
11
|
+
const API = (process.env.DANKMACHINE_API ?? 'https://dankmachine.com/api/v1').replace(/\/$/, '');
|
|
12
|
+
const CACHE_DIR = path.join(os.tmpdir(), 'dankmachine-mcp');
|
|
13
|
+
|
|
14
|
+
/** @type {Promise<any[]> | null} */
|
|
15
|
+
let catalog = null;
|
|
16
|
+
function sounds() {
|
|
17
|
+
catalog ??= fetch(`${API}/sounds.json`)
|
|
18
|
+
.then((r) => {
|
|
19
|
+
if (!r.ok) throw new Error(`catalog fetch failed: HTTP ${r.status}`);
|
|
20
|
+
return r.json();
|
|
21
|
+
})
|
|
22
|
+
.then((j) => j.sounds)
|
|
23
|
+
.catch((e) => {
|
|
24
|
+
catalog = null;
|
|
25
|
+
throw e;
|
|
26
|
+
});
|
|
27
|
+
return catalog;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const norm = (s) => s.toLowerCase().normalize('NFKD').replace(/[̀-ͯ]/g, '');
|
|
31
|
+
|
|
32
|
+
function search(list, query, category) {
|
|
33
|
+
const words = norm(query).split(/\s+/).filter(Boolean);
|
|
34
|
+
return list
|
|
35
|
+
.filter((s) => !category || s.category === category)
|
|
36
|
+
.map((s) => {
|
|
37
|
+
const title = norm(s.title);
|
|
38
|
+
const hay = `${title} ${norm(s.tags.join(' '))} ${s.category} ${s.vibe}`;
|
|
39
|
+
if (!words.every((w) => hay.includes(w))) return null;
|
|
40
|
+
return { s, score: words.reduce((n, w) => n + (title.startsWith(w) ? 3 : title.includes(w) ? 2 : 0), 0) };
|
|
41
|
+
})
|
|
42
|
+
.filter(Boolean)
|
|
43
|
+
.sort((a, b) => b.score - a.score || b.s.views - a.s.views)
|
|
44
|
+
.map((x) => x.s);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const brief = (s) => ({ slug: s.slug, title: s.title, category: s.category, tags: s.tags, vibe: s.vibe, audio: s.audio, image: s.image, page: s.page });
|
|
48
|
+
const text = (data) => ({ content: [{ type: 'text', text: typeof data === 'string' ? data : JSON.stringify(data, null, 2) }] });
|
|
49
|
+
|
|
50
|
+
async function findOne(slugOrQuery) {
|
|
51
|
+
const list = await sounds();
|
|
52
|
+
return list.find((s) => s.slug === slugOrQuery) ?? search(list, slugOrQuery)[0] ?? null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Downloads (once) and plays a sound. Shared by the play_sound tool and the `play` CLI used by hooks. */
|
|
56
|
+
async function playSound(query) {
|
|
57
|
+
const s = await findOne(query);
|
|
58
|
+
if (!s) return `No sound found for "${query}".`;
|
|
59
|
+
fs.mkdirSync(CACHE_DIR, { recursive: true });
|
|
60
|
+
const file = path.join(CACHE_DIR, `${s.slug}.mp3`);
|
|
61
|
+
if (!fs.existsSync(file)) {
|
|
62
|
+
const r = await fetch(s.audio);
|
|
63
|
+
if (!r.ok) return `Could not download ${s.audio}: HTTP ${r.status}`;
|
|
64
|
+
fs.writeFileSync(file, Buffer.from(await r.arrayBuffer()));
|
|
65
|
+
}
|
|
66
|
+
const ok = await playFile(file);
|
|
67
|
+
return ok ? `▶ Played "${s.title}" (${s.page})` : `Downloaded "${s.title}" to ${file}, but no audio player was found on this system.`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// CLI mode for hooks and scripts: `npx dank-meme-sounds play "sad violin"`.
|
|
71
|
+
if (process.argv[2] === 'play') {
|
|
72
|
+
// Hooks must never fail loudly: report the problem and exit 0.
|
|
73
|
+
console.log(await playSound(process.argv.slice(3).join(' ') || 'vine boom').catch((e) => `dankmachine: ${e.message}`));
|
|
74
|
+
process.exit(0);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const server = new McpServer({ name: 'dank-meme-sounds', version: '0.3.1' });
|
|
78
|
+
|
|
79
|
+
async function apiJson(p) {
|
|
80
|
+
const r = await fetch(`${API}${p}`);
|
|
81
|
+
if (!r.ok) throw new Error(`DankMachine API ${p}: HTTP ${r.status}`);
|
|
82
|
+
return r.json();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
server.registerTool(
|
|
86
|
+
'find_reaction_sound',
|
|
87
|
+
{
|
|
88
|
+
title: 'Find a reaction sound for a moment',
|
|
89
|
+
description: 'Describe a situation ("my code finally compiled", "awkward silence", "someone got roasted") and get the best-fitting meme sounds, with what each one means and when to use it.',
|
|
90
|
+
inputSchema: {
|
|
91
|
+
situation: z.string().describe('The moment to react to, in plain words'),
|
|
92
|
+
limit: z.number().int().min(1).max(20).optional().describe('Max results (default 5)'),
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
async ({ situation, limit = 5 }) => text(await apiJson(`/reaction?situation=${encodeURIComponent(situation)}&limit=${limit}`)),
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
server.registerTool(
|
|
99
|
+
'get_trending_sounds',
|
|
100
|
+
{
|
|
101
|
+
title: 'Trending meme sounds',
|
|
102
|
+
description: 'Sounds people are playing most on DankMachine right now.',
|
|
103
|
+
inputSchema: {
|
|
104
|
+
window: z.enum(['1h', '24h', '7d']).optional().describe('Time window (default 24h)'),
|
|
105
|
+
limit: z.number().int().min(1).max(50).optional().describe('Max results (default 10)'),
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
async ({ window = '24h', limit = 10 }) => text(await apiJson(`/trending?window=${window}&limit=${limit}`)),
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
server.registerTool(
|
|
112
|
+
'search_sounds',
|
|
113
|
+
{
|
|
114
|
+
title: 'Search meme sounds',
|
|
115
|
+
description: 'Search DankMachine meme sound buttons by words in the title, tags, category or vibe. Returns audio URLs, pixel-art images and pages.',
|
|
116
|
+
inputSchema: {
|
|
117
|
+
query: z.string().describe('Words to match, e.g. "vine boom", "sad violin", "minecraft"'),
|
|
118
|
+
category: z.string().optional().describe('Optional category slug from list_categories'),
|
|
119
|
+
limit: z.number().int().min(1).max(50).optional().describe('Max results (default 10)'),
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
async ({ query, category, limit = 10 }) => text(search(await sounds(), query, category).slice(0, limit).map(brief)),
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
server.registerTool(
|
|
126
|
+
'random_sound',
|
|
127
|
+
{
|
|
128
|
+
title: 'Random meme sound',
|
|
129
|
+
description: 'Pick a random sound, optionally from one category or with one vibe (funny, hype, cursed, wholesome, scary, sad, annoying, epic, chill, dramatic).',
|
|
130
|
+
inputSchema: { category: z.string().optional(), vibe: z.string().optional() },
|
|
131
|
+
},
|
|
132
|
+
async ({ category, vibe }) => {
|
|
133
|
+
const pool = (await sounds()).filter((s) => (!category || s.category === category) && (!vibe || s.vibe === vibe));
|
|
134
|
+
if (!pool.length) return text('No sounds match that filter.');
|
|
135
|
+
return text(brief(pool[Math.floor(Math.random() * pool.length)]));
|
|
136
|
+
},
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
server.registerTool(
|
|
140
|
+
'get_sound',
|
|
141
|
+
{
|
|
142
|
+
title: 'Get one sound',
|
|
143
|
+
description: 'Get a sound by slug (or the best match for a query).',
|
|
144
|
+
inputSchema: { sound: z.string().describe('Slug like "vine-boom-sound-70972", or a search query') },
|
|
145
|
+
},
|
|
146
|
+
async ({ sound }) => {
|
|
147
|
+
const s = await findOne(sound);
|
|
148
|
+
return text(s ? { ...brief(s), views: s.views, lang: s.lang } : `No sound found for "${sound}".`);
|
|
149
|
+
},
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
server.registerTool(
|
|
153
|
+
'list_categories',
|
|
154
|
+
{ title: 'List categories', description: 'List DankMachine sound categories with counts.', inputSchema: {} },
|
|
155
|
+
async () => {
|
|
156
|
+
const r = await fetch(`${API}/categories.json`);
|
|
157
|
+
return text((await r.json()).categories);
|
|
158
|
+
},
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
server.registerTool(
|
|
162
|
+
'play_sound',
|
|
163
|
+
{
|
|
164
|
+
title: 'Play a meme sound',
|
|
165
|
+
description: 'Play a sound out loud on the user\'s computer speakers. Use for celebrations, failures or comic timing when the user wants it.',
|
|
166
|
+
inputSchema: { sound: z.string().describe('Slug or search query, e.g. "vine boom", "sad violin", "airhorn"') },
|
|
167
|
+
},
|
|
168
|
+
async ({ sound }) => text(await playSound(sound)),
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
await server.connect(new StdioServerTransport());
|
package/package.json
CHANGED
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dank-meme-sounds",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "MCP server for DankMachine meme sounds: search, find reaction sounds for any moment, trending, and play them on your speakers. Remote version: https://dankmachine.com/mcp",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"dank-meme-sounds": "index.mjs",
|
|
8
|
+
"dankmachine-mcp": "index.mjs"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"index.mjs",
|
|
12
|
+
"play.mjs",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE",
|
|
15
|
+
"server.json"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=20"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"mcp",
|
|
22
|
+
"model-context-protocol",
|
|
23
|
+
"meme",
|
|
24
|
+
"soundboard",
|
|
25
|
+
"sound effects",
|
|
26
|
+
"claude",
|
|
27
|
+
"mcp-server",
|
|
28
|
+
"sound-effects",
|
|
29
|
+
"memes",
|
|
30
|
+
"reaction",
|
|
31
|
+
"claude-code",
|
|
32
|
+
"hooks",
|
|
33
|
+
"cursor",
|
|
34
|
+
"ai-agents"
|
|
35
|
+
],
|
|
36
|
+
"homepage": "https://dankmachine.com",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
40
|
+
"zod": "^3.25.0"
|
|
41
|
+
},
|
|
42
|
+
"mcpName": "io.github.TanKucukhas/dank-meme-sounds",
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "git+https://github.com/TanKucukhas/dank-meme-sounds.git"
|
|
46
|
+
},
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/TanKucukhas/dank-meme-sounds/issues"
|
|
49
|
+
}
|
|
50
|
+
}
|
package/play.mjs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Plays an MP3 file on the local machine with whatever player the OS has. Resolves when playback ends.
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
|
|
4
|
+
function run(cmd, args) {
|
|
5
|
+
return new Promise((resolve) => {
|
|
6
|
+
const child = spawn(cmd, args, { stdio: 'ignore', windowsHide: true });
|
|
7
|
+
child.on('error', () => resolve(false));
|
|
8
|
+
child.on('close', (code) => resolve(code === 0));
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** @param {string} file absolute path to an mp3 */
|
|
13
|
+
export async function playFile(file) {
|
|
14
|
+
if (process.platform === 'darwin') return run('afplay', [file]);
|
|
15
|
+
if (process.platform === 'win32') {
|
|
16
|
+
// WPF MediaPlayer plays MP3 without extra installs; wait until the clip ends (max 30 s).
|
|
17
|
+
const ps = `Add-Type -AssemblyName PresentationCore; $p = New-Object System.Windows.Media.MediaPlayer; $p.Open([uri]'${file.replace(/'/g, "''")}'); `
|
|
18
|
+
+ `$i = 0; while (-not $p.NaturalDuration.HasTimeSpan -and $i -lt 50) { Start-Sleep -Milliseconds 100; $i++ }; $p.Play(); `
|
|
19
|
+
+ `$ms = if ($p.NaturalDuration.HasTimeSpan) { [math]::Min($p.NaturalDuration.TimeSpan.TotalMilliseconds, 30000) } else { 5000 }; Start-Sleep -Milliseconds $ms; $p.Close()`;
|
|
20
|
+
return run('powershell', ['-NoProfile', '-NonInteractive', '-Command', ps]);
|
|
21
|
+
}
|
|
22
|
+
for (const [cmd, args] of [['mpg123', ['-q']], ['ffplay', ['-nodisp', '-autoexit', '-loglevel', 'quiet']], ['paplay', []], ['play', ['-q']]]) {
|
|
23
|
+
if (await run(cmd, [...args, file])) return true;
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.TanKucukhas/dank-meme-sounds",
|
|
4
|
+
"title": "DankMachine meme sounds",
|
|
5
|
+
"description": "Meme soundboard for AI agents: 38k meme sounds. Find reaction sounds, search, trending, play.",
|
|
6
|
+
"version": "0.3.1",
|
|
7
|
+
"websiteUrl": "https://dankmachine.com/developers/",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/TanKucukhas/dank-meme-sounds",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"packages": [
|
|
13
|
+
{
|
|
14
|
+
"registryType": "npm",
|
|
15
|
+
"identifier": "dank-meme-sounds",
|
|
16
|
+
"version": "0.3.1",
|
|
17
|
+
"transport": {
|
|
18
|
+
"type": "stdio"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"remotes": [
|
|
23
|
+
{
|
|
24
|
+
"type": "streamable-http",
|
|
25
|
+
"url": "https://dankmachine.com/mcp"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|