@unclick/chessdotcom-mcp 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 ADDED
@@ -0,0 +1,15 @@
1
+ Apache License 2.0
2
+
3
+ Copyright (c) 2026 UnClick / malamutemayhem
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # Chess.com MCP by UnClick
2
+
3
+ Chess.com player profiles, stats, games, puzzles, and leaderboards. No API key.
4
+
5
+ > By UnClick. 180+ tools plus persistent agent memory in one install: https://unclick.world
6
+
7
+ ## Install
8
+
9
+ Installs straight from GitHub, no npm account needed.
10
+
11
+ ```json
12
+ {
13
+ "mcpServers": {
14
+ "chessdotcom": {
15
+ "command": "npx",
16
+ "args": ["-y", "https://github.com/malamutemayhem/unclick/releases/download/standalone-mcps-latest/chessdotcom.tgz"]
17
+ }
18
+ }
19
+ }
20
+ ```
21
+
22
+ ## Tools
23
+
24
+ - `chess_player`
25
+ - `chess_player_stats`
26
+ - `chess_player_games`
27
+ - `chess_puzzles_random`
28
+ - `chess_leaderboards`
29
+
30
+ ## Want the rest?
31
+
32
+ This is one connector. [UnClick](https://unclick.world) bundles 180+ tools plus
33
+ persistent cross-session agent memory in a single install.
34
+
35
+ ## License
36
+
37
+ Apache-2.0
@@ -0,0 +1,182 @@
1
+ // Chess.com Public API integration for the UnClick MCP server.
2
+ // Uses the Chess.com Published-Data API via fetch - no external dependencies, no API key required.
3
+ // Documentation: https://www.chess.com/news/view/published-data-api
4
+ const CHESS_BASE = "https://api.chess.com/pub";
5
+ // ─── API helper ──────────────────────────────────────────────────────────────
6
+ async function chessFetch(path) {
7
+ const res = await fetch(`${CHESS_BASE}${path}`, {
8
+ headers: {
9
+ "User-Agent": "UnClick MCP Server",
10
+ Accept: "application/json",
11
+ },
12
+ });
13
+ if (!res.ok) {
14
+ if (res.status === 404) {
15
+ throw new Error(`Not found (HTTP 404). Check the username or resource exists.`);
16
+ }
17
+ throw new Error(`Chess.com API HTTP ${res.status}`);
18
+ }
19
+ return res.json();
20
+ }
21
+ // ─── Operations ──────────────────────────────────────────────────────────────
22
+ export async function chessPlayer(args) {
23
+ const username = String(args.username ?? "").trim().toLowerCase();
24
+ if (!username)
25
+ throw new Error("username is required.");
26
+ const data = (await chessFetch(`/player/${username}`));
27
+ return {
28
+ username: data.username,
29
+ name: data.name ?? null,
30
+ title: data.title ?? null,
31
+ country: data.country ?? null,
32
+ location: data.location ?? null,
33
+ joined: data.joined ? new Date(Number(data.joined) * 1000).toISOString() : null,
34
+ last_online: data.last_online
35
+ ? new Date(Number(data.last_online) * 1000).toISOString()
36
+ : null,
37
+ followers: data.followers ?? 0,
38
+ is_streamer: data.is_streamer ?? false,
39
+ verified: data.verified ?? false,
40
+ url: data.url ?? null,
41
+ avatar: data.avatar ?? null,
42
+ };
43
+ }
44
+ export async function chessPlayerStats(args) {
45
+ const username = String(args.username ?? "").trim().toLowerCase();
46
+ if (!username)
47
+ throw new Error("username is required.");
48
+ const data = (await chessFetch(`/player/${username}/stats`));
49
+ const extractRating = (gameType) => {
50
+ if (!gameType || typeof gameType !== "object")
51
+ return null;
52
+ const gt = gameType;
53
+ const last = gt.last ?? {};
54
+ const best = gt.best ?? {};
55
+ const record = gt.record ?? {};
56
+ return {
57
+ rating: last.rating ?? null,
58
+ best_rating: best.rating ?? null,
59
+ wins: record.win ?? 0,
60
+ losses: record.loss ?? 0,
61
+ draws: record.draw ?? 0,
62
+ };
63
+ };
64
+ return {
65
+ username,
66
+ chess_rapid: extractRating(data.chess_rapid),
67
+ chess_blitz: extractRating(data.chess_blitz),
68
+ chess_bullet: extractRating(data.chess_bullet),
69
+ chess_daily: extractRating(data.chess_daily),
70
+ tactics: data.tactics
71
+ ? {
72
+ highest: data.tactics.highest ?? null,
73
+ lowest: data.tactics.lowest ?? null,
74
+ }
75
+ : null,
76
+ puzzle_rush: data.puzzle_rush ?? null,
77
+ };
78
+ }
79
+ export async function chessPlayerGames(args) {
80
+ const username = String(args.username ?? "").trim().toLowerCase();
81
+ if (!username)
82
+ throw new Error("username is required.");
83
+ const year = String(args.year ?? "").trim();
84
+ const month = String(args.month ?? "").trim().padStart(2, "0");
85
+ if (!year)
86
+ throw new Error("year is required (e.g. 2024).");
87
+ if (!args.month)
88
+ throw new Error("month is required (e.g. 1 for January).");
89
+ const data = (await chessFetch(`/player/${username}/games/${year}/${month}`));
90
+ const games = data.games ?? [];
91
+ return {
92
+ username,
93
+ year,
94
+ month,
95
+ count: games.length,
96
+ games: games.slice(-20).map((g) => ({
97
+ url: g.url,
98
+ pgn_first_move: g.pgn
99
+ ? String(g.pgn).split("\n").filter((l) => !l.startsWith("[")).join(" ").trim().slice(0, 100)
100
+ : null,
101
+ time_class: g.time_class,
102
+ time_control: g.time_control,
103
+ rated: g.rated,
104
+ white: {
105
+ username: g.white?.username,
106
+ result: g.white?.result,
107
+ rating: g.white?.rating,
108
+ },
109
+ black: {
110
+ username: g.black?.username,
111
+ result: g.black?.result,
112
+ rating: g.black?.rating,
113
+ },
114
+ end_time: g.end_time
115
+ ? new Date(Number(g.end_time) * 1000).toISOString()
116
+ : null,
117
+ })),
118
+ };
119
+ }
120
+ export async function chessPuzzlesRandom(_args) {
121
+ const data = (await chessFetch("/puzzle/random"));
122
+ return {
123
+ title: data.title ?? null,
124
+ url: data.url ?? null,
125
+ publish_time: data.publish_time
126
+ ? new Date(Number(data.publish_time) * 1000).toISOString()
127
+ : null,
128
+ fen: data.fen ?? null,
129
+ pgn: data.pgn ?? null,
130
+ image: data.image ?? null,
131
+ };
132
+ }
133
+ export async function chessLeaderboards(args) {
134
+ const data = (await chessFetch("/leaderboards"));
135
+ const gameType = args.game_type ? String(args.game_type) : null;
136
+ const validTypes = [
137
+ "live_rapid",
138
+ "live_blitz",
139
+ "live_bullet",
140
+ "live_bughouse",
141
+ "live_blitz960",
142
+ "live_threecheck",
143
+ "live_crazyhouse",
144
+ "live_kingofthehill",
145
+ "tactics",
146
+ "lessons",
147
+ "puzzle_rush",
148
+ "daily",
149
+ "daily960",
150
+ ];
151
+ if (gameType) {
152
+ if (!validTypes.includes(gameType)) {
153
+ throw new Error(`game_type must be one of: ${validTypes.join(", ")}`);
154
+ }
155
+ const board = data[gameType] ?? [];
156
+ return {
157
+ game_type: gameType,
158
+ count: board.length,
159
+ players: board.slice(0, 20).map((p) => ({
160
+ rank: p.rank,
161
+ username: p.username,
162
+ score: p.score,
163
+ title: p.title ?? null,
164
+ country: p.country ?? null,
165
+ })),
166
+ };
167
+ }
168
+ const result = {};
169
+ for (const type of ["live_rapid", "live_blitz", "live_bullet", "daily"]) {
170
+ const board = data[type] ?? [];
171
+ result[type] = board.slice(0, 5).map((p) => ({
172
+ rank: p.rank,
173
+ username: p.username,
174
+ score: p.score,
175
+ title: p.title ?? null,
176
+ }));
177
+ }
178
+ return {
179
+ note: "Showing top 5 for rapid, blitz, bullet, and daily. Pass game_type for a full leaderboard.",
180
+ leaderboards: result,
181
+ };
182
+ }
package/dist/index.js ADDED
@@ -0,0 +1,99 @@
1
+ #!/usr/bin/env node
2
+ // Chess.com MCP. Standalone MCP server by UnClick.
3
+ // By UnClick. 180+ tools plus persistent agent memory in one install: https://unclick.world
4
+ //
5
+ // Generated from the UnClick connector by scripts/generate-standalone-mcp.mjs.
6
+ // Edit the connector in the UnClick monorepo, not here.
7
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
8
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
9
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
10
+ import { chessPlayer, chessPlayerStats, chessPlayerGames, chessPuzzlesRandom, chessLeaderboards, } from "./chessdotcom-tool.js";
11
+ const TOOLS = [
12
+ {
13
+ name: "chess_player",
14
+ description: "Get a Chess.com player profile.",
15
+ inputSchema: {
16
+ type: "object",
17
+ additionalProperties: false,
18
+ properties: {
19
+ username: { type: "string" },
20
+ },
21
+ required: ["username"],
22
+ },
23
+ },
24
+ {
25
+ name: "chess_player_stats",
26
+ description: "Get Chess.com player statistics.",
27
+ inputSchema: {
28
+ type: "object",
29
+ additionalProperties: false,
30
+ properties: {
31
+ username: { type: "string" },
32
+ },
33
+ required: ["username"],
34
+ },
35
+ },
36
+ {
37
+ name: "chess_player_games",
38
+ description: "Get recent games for a Chess.com player.",
39
+ inputSchema: {
40
+ type: "object",
41
+ additionalProperties: false,
42
+ properties: {
43
+ username: { type: "string" },
44
+ year: { type: "number" },
45
+ month: { type: "number" },
46
+ },
47
+ required: ["username"],
48
+ },
49
+ },
50
+ {
51
+ name: "chess_puzzles_random",
52
+ description: "Get a random chess puzzle from Chess.com.",
53
+ inputSchema: {
54
+ type: "object",
55
+ additionalProperties: false,
56
+ properties: {},
57
+ },
58
+ },
59
+ {
60
+ name: "chess_leaderboards",
61
+ description: "Get Chess.com leaderboards.",
62
+ inputSchema: {
63
+ type: "object",
64
+ additionalProperties: false,
65
+ properties: {},
66
+ },
67
+ }
68
+ ];
69
+ const HANDLERS = {
70
+ chess_player: (args) => chessPlayer(args),
71
+ chess_player_stats: (args) => chessPlayerStats(args),
72
+ chess_player_games: (args) => chessPlayerGames(args),
73
+ chess_puzzles_random: (args) => chessPuzzlesRandom(args),
74
+ chess_leaderboards: (args) => chessLeaderboards(args),
75
+ };
76
+ const server = new Server({ name: "io.github.malamutemayhem/chessdotcom", version: "0.1.0" }, { capabilities: { tools: {} } });
77
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
78
+ server.setRequestHandler(CallToolRequestSchema, async (req) => {
79
+ const handler = HANDLERS[req.params.name];
80
+ if (!handler) {
81
+ return { content: [{ type: "text", text: `Unknown tool: ${req.params.name}` }], isError: true };
82
+ }
83
+ try {
84
+ const result = await handler((req.params.arguments ?? {}));
85
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
86
+ }
87
+ catch (err) {
88
+ const message = err instanceof Error ? err.message : String(err);
89
+ return { content: [{ type: "text", text: message }], isError: true };
90
+ }
91
+ });
92
+ async function main() {
93
+ const transport = new StdioServerTransport();
94
+ await server.connect(transport);
95
+ }
96
+ main().catch((err) => {
97
+ process.stderr.write(`[chessdotcom-mcp] fatal: ${err instanceof Error ? err.message : String(err)}\n`);
98
+ process.exit(1);
99
+ });
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@unclick/chessdotcom-mcp",
3
+ "version": "0.1.0",
4
+ "mcpName": "io.github.malamutemayhem/chessdotcom",
5
+ "description": "Chess.com player profiles, stats, games, puzzles, and leaderboards. No API key. By UnClick (https://unclick.world).",
6
+ "keywords": [
7
+ "mcp",
8
+ "model-context-protocol",
9
+ "unclick",
10
+ "chess",
11
+ "chess.com",
12
+ "games"
13
+ ],
14
+ "author": "UnClick (https://unclick.world)",
15
+ "type": "module",
16
+ "bin": {
17
+ "chessdotcom-mcp": "./dist/index.js"
18
+ },
19
+ "main": "./dist/index.js",
20
+ "files": [
21
+ "dist",
22
+ "README.md",
23
+ "server.json"
24
+ ],
25
+ "scripts": {
26
+ "build": "tsc",
27
+ "start": "node dist/index.js",
28
+ "prepublishOnly": "npm run build"
29
+ },
30
+ "dependencies": {
31
+ "@modelcontextprotocol/sdk": "^1.15.1"
32
+ },
33
+ "devDependencies": {
34
+ "typescript": "^5.6.0",
35
+ "@types/node": "^22.0.0"
36
+ },
37
+ "license": "Apache-2.0",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://github.com/malamutemayhem/unclick.git",
41
+ "directory": "packages/standalone/chessdotcom-mcp"
42
+ },
43
+ "homepage": "https://unclick.world"
44
+ }
package/server.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.malamutemayhem/chessdotcom",
4
+ "title": "Chess.com MCP by UnClick",
5
+ "description": "Chess.com player profiles, stats, games, puzzles, and leaderboards. No API key. By UnClick.",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://unclick.world",
8
+ "icons": [
9
+ {
10
+ "src": "https://unclick.world/favicon.png",
11
+ "mimeType": "image/png",
12
+ "sizes": [
13
+ "512x512"
14
+ ]
15
+ }
16
+ ],
17
+ "repository": {
18
+ "url": "https://github.com/malamutemayhem/unclick.git",
19
+ "source": "github",
20
+ "subfolder": "packages/standalone/chessdotcom-mcp"
21
+ },
22
+ "packages": [
23
+ {
24
+ "registryType": "npm",
25
+ "identifier": "@unclick/chessdotcom-mcp",
26
+ "version": "0.1.0",
27
+ "runtimeHint": "npx",
28
+ "transport": {
29
+ "type": "stdio"
30
+ }
31
+ }
32
+ ]
33
+ }