@mrfentmen/cs2-stickers-mcp 0.0.0-stage → 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 CHANGED
@@ -1,3 +1,22 @@
1
- # Temporary Holding Version
1
+ # cs2-stickers-mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ MCP server for CS2 stickers. Keyless: it reads the public ByMykel CS2 item list.
4
+
5
+ ## Tools
6
+
7
+ | Tool | What it returns |
8
+ | --- | --- |
9
+ | `get_stickers` | Stickers with rarity, type and effect |
10
+
11
+ ## Run
12
+
13
+ ```bash
14
+ npx -y @mrfentmen/cs2-stickers-mcp
15
+ ```
16
+
17
+ ## Build and test
18
+
19
+ ```bash
20
+ npm install
21
+ npm test
22
+ ```
package/dist/api.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ export declare class Cs2StickersError extends Error {
2
+ }
3
+ export interface Sticker {
4
+ id: string;
5
+ name: string;
6
+ rarity: string;
7
+ type: string;
8
+ effect: string;
9
+ }
10
+ export declare function stickers(limit: number): Promise<Sticker[]>;
11
+ export declare function formatStickers(list: Sticker[]): string;
package/dist/api.js ADDED
@@ -0,0 +1,38 @@
1
+ const API = "https://raw.githubusercontent.com/ByMykel/CSGO-API/main/public/api/en/stickers.json";
2
+ export class Cs2StickersError extends Error {
3
+ }
4
+ export async function stickers(limit) {
5
+ let json;
6
+ try {
7
+ const response = await fetch(API, { signal: AbortSignal.timeout(60000) });
8
+ if (!response.ok)
9
+ throw new Cs2StickersError(`ByMykel answered ${response.status}`);
10
+ json = (await response.json());
11
+ }
12
+ catch (error) {
13
+ if (error instanceof Cs2StickersError)
14
+ throw error;
15
+ throw new Cs2StickersError(`ByMykel unreachable: ${error instanceof Error ? error.message : String(error)}`);
16
+ }
17
+ if (!Array.isArray(json))
18
+ throw new Cs2StickersError("ByMykel returned no stickers");
19
+ const list = json
20
+ .filter((sticker) => sticker.name)
21
+ .map((sticker) => ({
22
+ id: sticker.id ?? "unknown",
23
+ name: sticker.name,
24
+ rarity: sticker.rarity?.name ?? "unknown",
25
+ type: sticker.type ?? "unknown",
26
+ effect: sticker.effect ?? "none",
27
+ }))
28
+ .sort((a, b) => a.name.localeCompare(b.name));
29
+ if (list.length === 0)
30
+ throw new Cs2StickersError("ByMykel returned no stickers");
31
+ return list.slice(0, limit);
32
+ }
33
+ export function formatStickers(list) {
34
+ const lines = list.map((sticker, index) => {
35
+ return `${index + 1}. ${sticker.name} — ${sticker.rarity} — ${sticker.type} — effect ${sticker.effect}`;
36
+ });
37
+ return `# CS2 stickers\n\n${lines.join("\n")}`;
38
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
+ import { createServer } from "./server.js";
4
+ async function main() {
5
+ const server = createServer();
6
+ const transport = new StdioServerTransport();
7
+ await server.connect(transport);
8
+ console.error("cs2-stickers-mcp running on stdio");
9
+ }
10
+ main().catch((error) => {
11
+ console.error("Fatal error:", error);
12
+ process.exit(1);
13
+ });
@@ -0,0 +1,2 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function createServer(): McpServer;
package/dist/server.js ADDED
@@ -0,0 +1,17 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { z } from "zod";
3
+ import { formatStickers, stickers } from "./api.js";
4
+ const text = (value) => ({ content: [{ type: "text", text: value }] });
5
+ const failed = (error) => text(`Error: ${error instanceof Error ? error.message : String(error)}`);
6
+ export function createServer() {
7
+ const server = new McpServer({ name: "cs2-stickers-mcp", version: "1.0.0" });
8
+ server.tool("get_stickers", "CS2 stickers with rarity and effect.", { limit: z.number().int().min(1).max(500).default(50) }, async ({ limit }) => {
9
+ try {
10
+ return text(formatStickers(await stickers(limit)));
11
+ }
12
+ catch (error) {
13
+ return failed(error);
14
+ }
15
+ });
16
+ return server;
17
+ }
package/package.json CHANGED
@@ -1,6 +1,41 @@
1
1
  {
2
2
  "name": "@mrfentmen/cs2-stickers-mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "CS2 stickers MCP: rarity, type and effect. Keyless.",
5
+ "type": "module",
6
+ "mcpName": "io.github.mrfentmen/cs2-stickers-mcp",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/mrfentmen/awesome-servers.git"
10
+ },
11
+ "bin": {
12
+ "cs2-stickers-mcp": "./dist/index.js"
13
+ },
14
+ "main": "./dist/index.js",
15
+ "files": [
16
+ "dist",
17
+ "server.json",
18
+ "README.md"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsc -p tsconfig.json",
22
+ "start": "node dist/index.js",
23
+ "test": "npm run build && node --test tests/tools.test.mjs"
24
+ },
25
+ "keywords": [
26
+ "mcp",
27
+ "cs2",
28
+ "counter-strike",
29
+ "stickers",
30
+ "skins"
31
+ ],
32
+ "license": "MIT",
33
+ "dependencies": {
34
+ "@modelcontextprotocol/sdk": "^1.0.4",
35
+ "zod": "^3.23.8"
36
+ },
37
+ "devDependencies": {
38
+ "@types/node": "^22.0.0",
39
+ "typescript": "^5.6.0"
40
+ }
41
+ }
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/cs2-stickers-mcp",
4
+ "description": "CS2 stickers MCP: rarity, type and effect. Keyless.",
5
+ "repository": {
6
+ "url": "https://github.com/mrfentmen/awesome-servers",
7
+ "source": "github"
8
+ },
9
+ "version": "1.0.0",
10
+ "packages": [
11
+ {
12
+ "registryType": "npm",
13
+ "identifier": "@mrfentmen/cs2-stickers-mcp",
14
+ "version": "1.0.0",
15
+ "transport": {
16
+ "type": "stdio"
17
+ }
18
+ }
19
+ ]
20
+ }