@mrfentmen/steam-screenshots-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 +21 -2
- package/dist/api.d.ts +14 -0
- package/dist/api.js +41 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +13 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +17 -0
- package/package.json +39 -4
- package/server.json +20 -0
package/README.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
#
|
|
1
|
+
# steam-screenshots-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MCP server for Steam app screenshots. Keyless: it reads the public Steam store API.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
| Tool | What it returns |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| `get_screenshots` | Screenshots with full-size and thumbnail links |
|
|
10
|
+
|
|
11
|
+
## Run
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx -y @mrfentmen/steam-screenshots-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,14 @@
|
|
|
1
|
+
export declare class SteamScreenshotsError extends Error {
|
|
2
|
+
}
|
|
3
|
+
export interface Screenshot {
|
|
4
|
+
id: string;
|
|
5
|
+
full: string;
|
|
6
|
+
thumbnail: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ScreenshotList {
|
|
9
|
+
app: string;
|
|
10
|
+
name: string;
|
|
11
|
+
shots: Screenshot[];
|
|
12
|
+
}
|
|
13
|
+
export declare function screenshots(appId: string): Promise<ScreenshotList>;
|
|
14
|
+
export declare function formatScreenshots(find: ScreenshotList): string;
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const API = "https://store.steampowered.com/api/appdetails";
|
|
2
|
+
export class SteamScreenshotsError extends Error {
|
|
3
|
+
}
|
|
4
|
+
export async function screenshots(appId) {
|
|
5
|
+
if (!/^\d+$/.test(appId.trim()))
|
|
6
|
+
throw new SteamScreenshotsError(`not a Steam app id: ${appId}`);
|
|
7
|
+
const id = appId.trim();
|
|
8
|
+
let json;
|
|
9
|
+
try {
|
|
10
|
+
const response = await fetch(`${API}?appids=${id}&l=en`, { signal: AbortSignal.timeout(25000) });
|
|
11
|
+
if (!response.ok)
|
|
12
|
+
throw new SteamScreenshotsError(`Steam answered ${response.status}`);
|
|
13
|
+
json = (await response.json());
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
if (error instanceof SteamScreenshotsError)
|
|
17
|
+
throw error;
|
|
18
|
+
throw new SteamScreenshotsError(`Steam unreachable: ${error instanceof Error ? error.message : String(error)}`);
|
|
19
|
+
}
|
|
20
|
+
const app = json[id];
|
|
21
|
+
if (!app?.success || !app.data)
|
|
22
|
+
throw new SteamScreenshotsError(`Steam has no app ${id}`);
|
|
23
|
+
const shots = app.data.screenshots ?? [];
|
|
24
|
+
if (shots.length === 0)
|
|
25
|
+
throw new SteamScreenshotsError(`Steam has no screenshots for app ${id}`);
|
|
26
|
+
return {
|
|
27
|
+
app: id,
|
|
28
|
+
name: app.data.name ?? `app ${id}`,
|
|
29
|
+
shots: shots.map((shot) => ({
|
|
30
|
+
id: String(shot.id ?? "unknown"),
|
|
31
|
+
full: shot.path_full ?? "no image",
|
|
32
|
+
thumbnail: shot.path_thumbnail ?? "no thumbnail",
|
|
33
|
+
})),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export function formatScreenshots(find) {
|
|
37
|
+
const lines = find.shots.map((shot, index) => {
|
|
38
|
+
return `${index + 1}. ${shot.full} — thumbnail ${shot.thumbnail}`;
|
|
39
|
+
});
|
|
40
|
+
return `# Steam screenshots for ${find.name} (${find.app})\n\n${lines.join("\n")}`;
|
|
41
|
+
}
|
package/dist/index.d.ts
ADDED
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("steam-screenshots-mcp running on stdio");
|
|
9
|
+
}
|
|
10
|
+
main().catch((error) => {
|
|
11
|
+
console.error("Fatal error:", error);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
});
|
package/dist/server.d.ts
ADDED
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 { formatScreenshots, screenshots } 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: "steam-screenshots-mcp", version: "1.0.0" });
|
|
8
|
+
server.tool("get_screenshots", "Screenshots for a Steam app with full-size links.", { appId: z.string().min(1).describe("Steam app id, e.g. 570 for Dota 2") }, async ({ appId }) => {
|
|
9
|
+
try {
|
|
10
|
+
return text(formatScreenshots(await screenshots(appId)));
|
|
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/steam-screenshots-mcp",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Steam app screenshots MCP with full-size links. Keyless.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"mcpName": "io.github.mrfentmen/steam-screenshots-mcp",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/mrfentmen/awesome-servers.git"
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"steam-screenshots-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
|
+
"steam",
|
|
28
|
+
"screenshots",
|
|
29
|
+
"media",
|
|
30
|
+
"gaming"
|
|
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/steam-screenshots-mcp",
|
|
4
|
+
"description": "Steam app screenshots MCP with full-size links. 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/steam-screenshots-mcp",
|
|
14
|
+
"version": "1.0.0",
|
|
15
|
+
"transport": {
|
|
16
|
+
"type": "stdio"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|