emoji-mcp 1.0.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/README.md +21 -0
- package/dist/api.js +66 -0
- package/dist/index.js +4 -0
- package/dist/server.js +38 -0
- package/package.json +48 -0
- package/server.json +20 -0
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Emoji MCP
|
|
2
|
+
|
|
3
|
+
Search emoji by name or keyword from a bundled catalog. No network, no key.
|
|
4
|
+
|
|
5
|
+
This file is self contained. It reads public data only and never writes to the machine. All output is bounded and honest about what could not be fetched.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
* `search` Find emoji by keyword.
|
|
11
|
+
* `categories` List categories.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install
|
|
17
|
+
npm run build
|
|
18
|
+
node dist/index.js
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The emoji catalog is bundled with the server and searched locally.
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const UA = "mrfentmen-emoji-mcp/1.0";
|
|
2
|
+
export class EmojiError extends Error {
|
|
3
|
+
}
|
|
4
|
+
// Compact catalog: keyword groups -> emoji characters.
|
|
5
|
+
const CATALOG = {
|
|
6
|
+
smile: ["๐", "๐", "๐", "๐คฃ", "๐", "๐", "๐", "๐", "๐", "๐", "๐ฅฐ", "๐"],
|
|
7
|
+
heart: ["โค๏ธ", "๐งก", "๐", "๐", "๐", "๐", "๐ค", "๐ค", "๐", "๐", "๐", "๐"],
|
|
8
|
+
sad: ["๐ข", "๐ญ", "๐", "๐", "๐", "๐ฉ", "๐ซ", "๐ฅบ", "๐ฃ", "๐"],
|
|
9
|
+
angry: ["๐ก", "๐ ", "๐คฌ", "๐ค", "๐พ"],
|
|
10
|
+
animal: ["๐ถ", "๐ฑ", "๐ญ", "๐น", "๐ฐ", "๐ฆ", "๐ป", "๐ผ", "๐จ", "๐ฏ", "๐ฆ", "๐ฎ", "๐ท", "๐ธ", "๐ต", "๐", "๐ง", "๐ฆ", "๐", "๐ฆ"],
|
|
11
|
+
dog: ["๐ถ", "๐ฆฎ", "๐", "๐ฉ"],
|
|
12
|
+
cat: ["๐ฑ", "๐", "๐โโฌ"],
|
|
13
|
+
food: ["๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ฅญ", "๐", "๐ฅฅ", "๐ฅ", "๐
", "๐ฅ", "๐", "๐ง", "๐", "๐", "๐", "๐ญ", "๐ฟ", "๐ฉ", "๐ช", "๐", "๐ฐ", "๐ซ", "๐ฌ"],
|
|
14
|
+
fruit: ["๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ฅญ", "๐", "๐ฅฅ", "๐ฅ"],
|
|
15
|
+
drink: ["โ", "๐ต", "๐ง", "๐ง", "๐ฅค", "๐ง", "๐บ", "๐ป", "๐ฅ", "๐ท", "๐ฅ", "๐ธ", "๐น"],
|
|
16
|
+
coffee: ["โ", "๐ซ"],
|
|
17
|
+
weather: ["โ๏ธ", "๐ค๏ธ", "โ
", "๐ฅ๏ธ", "โ๏ธ", "๐ฆ๏ธ", "๐ง๏ธ", "โ๏ธ", "๐ฉ๏ธ", "๐จ๏ธ", "โ๏ธ", "โ๏ธ", "๐จ", "๐ช๏ธ", "๐", "โ", "โก"],
|
|
18
|
+
sun: ["โ๏ธ", "๐", "๐
", "๐"],
|
|
19
|
+
moon: ["๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐"],
|
|
20
|
+
star: ["โญ", "๐", "โจ", "๐ซ"],
|
|
21
|
+
travel: ["โ๏ธ", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ฒ", "๐ต", "๐๏ธ", "๐", "๐ธ", "โต", "๐ณ๏ธ"],
|
|
22
|
+
rocket: ["๐", "๐ธ", "๐ฐ๏ธ"],
|
|
23
|
+
car: ["๐", "๐", "๐", "๐", "๐๏ธ", "๐", "๐", "๐"],
|
|
24
|
+
sport: ["โฝ", "๐", "๐", "โพ", "๐พ", "๐", "๐", "๐ฑ", "๐", "๐ธ", "๐ฅ", "๐ฅ", "โณ", "๐น", "๐ณ", "๐", "๐ฅ", "๐ฅ", "๐ฅ"],
|
|
25
|
+
music: ["๐ต", "๐ถ", "๐ผ", "๐ค", "๐ง", "๐ท", "๐บ", "๐ธ", "๐ป", "๐ฅ", "๐น"],
|
|
26
|
+
phone: ["๐ฑ", "๐ฒ", "โ๏ธ", "๐", "๐"],
|
|
27
|
+
computer: ["๐ป", "๐ฅ๏ธ", "โจ๏ธ", "๐ฑ๏ธ", "๐จ๏ธ", "๐พ", "๐ฟ", "๐"],
|
|
28
|
+
money: ["๐ฐ", "๐ต", "๐ถ", "๐ท", "๐ด", "๐ช", "๐ณ", "๐งพ"],
|
|
29
|
+
fire: ["๐ฅ", "๐งจ"],
|
|
30
|
+
love: ["โค๏ธ", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ฅฐ", "๐"],
|
|
31
|
+
party: ["๐", "๐", "๐", "๐", "๐ฅณ", "๐", "๐ช
"],
|
|
32
|
+
sleep: ["๐ด", "๐ค", "๐", "๐"],
|
|
33
|
+
thinking: ["๐ค", "๐ง", "๐คจ", "๐ญ"],
|
|
34
|
+
cool: ["๐", "๐ถ๏ธ", "๐", "๐ค"],
|
|
35
|
+
hand: ["๐", "๐", "๐", "โ๏ธ", "๐ค", "๐ค", "๐ค", "๐", "๐", "๐", "๐ค", "๐ช"],
|
|
36
|
+
flag: ["๐", "๐ฉ", "๐", "๐ณ๏ธ", "๐ด"],
|
|
37
|
+
christmas: ["๐", "๐
", "๐คถ", "๐งโ๐", "โ๏ธ", "โ"],
|
|
38
|
+
halloween: ["๐", "๐ป", "๐", "โ ๏ธ", "๐ง", "๐ง"],
|
|
39
|
+
};
|
|
40
|
+
export async function search(args) {
|
|
41
|
+
const q = (args.query ?? "").trim().toLowerCase();
|
|
42
|
+
if (!q)
|
|
43
|
+
throw new EmojiError("Provide a keyword like smile or heart");
|
|
44
|
+
const limit = Math.min(args.limit ?? 20, 60);
|
|
45
|
+
const keys = Object.keys(CATALOG).filter((k) => k.includes(q) || q.includes(k));
|
|
46
|
+
if (!keys.length)
|
|
47
|
+
return `No emoji found for "${q}"`;
|
|
48
|
+
const seen = new Set();
|
|
49
|
+
const out = [];
|
|
50
|
+
for (const key of keys) {
|
|
51
|
+
for (const e of CATALOG[key]) {
|
|
52
|
+
if (!seen.has(e)) {
|
|
53
|
+
seen.add(e);
|
|
54
|
+
out.push(e);
|
|
55
|
+
}
|
|
56
|
+
if (out.length >= limit)
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
if (out.length >= limit)
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
return `Emoji for "${q}" (${out.length}):\n${out.join(" ")}`;
|
|
63
|
+
}
|
|
64
|
+
export async function categories(args) {
|
|
65
|
+
return `Emoji categories (${Object.keys(CATALOG).length}):\n${Object.keys(CATALOG).sort().join(", ")}`;
|
|
66
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
2
|
+
import { createServer } from "./server.js";
|
|
3
|
+
const main = async () => { const server = createServer(); await server.connect(new StdioServerTransport()); };
|
|
4
|
+
main().catch((error) => { console.error("Fatal error:", error); process.exit(1); });
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { categories } from "./api.js";
|
|
4
|
+
import { search } from "./api.js";
|
|
5
|
+
const text = (value) => ({ content: [{ type: "text", text: value }] });
|
|
6
|
+
const textError = (t) => ({ content: [{ type: "text", text: t }], isError: true });
|
|
7
|
+
const READ_ONLY = { readOnlyHint: true, openWorldHint: true };
|
|
8
|
+
const error = (e) => `Error: ${e instanceof Error ? e.message : String(e)}`;
|
|
9
|
+
export function createServer() {
|
|
10
|
+
const server = new McpServer({ name: "emoji-mcp", version: "1.0.0" });
|
|
11
|
+
server.registerTool("search", {
|
|
12
|
+
title: "Search",
|
|
13
|
+
description: "Find emoji matching a keyword.",
|
|
14
|
+
inputSchema: z.object({ query: z.string().describe("Keyword like smile or heart."), limit: z.number().describe("Max results.").optional() }),
|
|
15
|
+
annotations: READ_ONLY,
|
|
16
|
+
}, async (args) => {
|
|
17
|
+
try {
|
|
18
|
+
return text(await search(args));
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
|
+
return textError(error(e));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
server.registerTool("categories", {
|
|
25
|
+
title: "Categories",
|
|
26
|
+
description: "List emoji categories.",
|
|
27
|
+
inputSchema: z.object({}),
|
|
28
|
+
annotations: READ_ONLY,
|
|
29
|
+
}, async (args) => {
|
|
30
|
+
try {
|
|
31
|
+
return text(await categories(args));
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
return textError(error(e));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return server;
|
|
38
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/mrfentmen/emoji-mcp.git"
|
|
7
|
+
},
|
|
8
|
+
"bin": {
|
|
9
|
+
"emoji-mcp": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"server.json",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc -p tsconfig.json",
|
|
19
|
+
"start": "node dist/index.js",
|
|
20
|
+
"dev": "npm run build && node dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@modelcontextprotocol/sdk": "^1.0.4",
|
|
25
|
+
"zod": "^3.23.8",
|
|
26
|
+
"jose": "^5.9.0",
|
|
27
|
+
"iban": "^0.0.14",
|
|
28
|
+
"sql-formatter": "^15.4.0",
|
|
29
|
+
"docx": "^9.0.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^22.0.0",
|
|
33
|
+
"typescript": "^5.6.0"
|
|
34
|
+
},
|
|
35
|
+
"name": "emoji-mcp",
|
|
36
|
+
"description": "Search emoji by name or keyword locally. No network and no key.",
|
|
37
|
+
"mcpName": "io.github.mrfentmen/emoji-mcp",
|
|
38
|
+
"keywords": [
|
|
39
|
+
"mcp",
|
|
40
|
+
"emoji",
|
|
41
|
+
"symbols",
|
|
42
|
+
"search",
|
|
43
|
+
"unicode"
|
|
44
|
+
],
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=20"
|
|
47
|
+
}
|
|
48
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.mrfentmen/emoji-mcp",
|
|
4
|
+
"description": "Search emoji by name or keyword locally. No network and no key.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"url": "https://github.com/mrfentmen/emoji-mcp",
|
|
7
|
+
"source": "github"
|
|
8
|
+
},
|
|
9
|
+
"version": "1.0.0",
|
|
10
|
+
"packages": [
|
|
11
|
+
{
|
|
12
|
+
"registryType": "npm",
|
|
13
|
+
"identifier": "emoji-mcp",
|
|
14
|
+
"version": "1.0.0",
|
|
15
|
+
"transport": {
|
|
16
|
+
"type": "stdio"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|