videogame-encyclopedia-mcp-server 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/LICENCE.md +21 -0
- package/README.md +219 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +18 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +179 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/steam.d.ts +46 -0
- package/dist/tools/steam.d.ts.map +1 -0
- package/dist/tools/steam.js +64 -0
- package/dist/tools/steam.js.map +1 -0
- package/dist/tools/steamgrid.d.ts +32 -0
- package/dist/tools/steamgrid.d.ts.map +1 -0
- package/dist/tools/steamgrid.js +63 -0
- package/dist/tools/steamgrid.js.map +1 -0
- package/dist/types.d.ts +100 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +39 -0
package/LICENCE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Hoani Cross
|
|
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
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Videogame Encyclopedia MCP Server
|
|
2
|
+
|
|
3
|
+
A Model Context Protocol (MCP) server that provides structured video game information from Steam and SteamGridDB. This server exposes tools for searching games and retrieving comprehensive metadata including descriptions, categories, release dates, player counts, and visual assets like logos, boxart, and icons.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
### Steam Integration
|
|
8
|
+
- **steam_search_game**: Search for games by name on Steam
|
|
9
|
+
- **steam_get_details**: Get comprehensive game information including:
|
|
10
|
+
- Description and detailed information
|
|
11
|
+
- Categories and genres
|
|
12
|
+
- Supported platforms (Windows, Mac, Linux)
|
|
13
|
+
- Multiplayer/singleplayer capabilities
|
|
14
|
+
- Release date
|
|
15
|
+
- Pricing information
|
|
16
|
+
- Developer and publisher details
|
|
17
|
+
|
|
18
|
+
### SteamGridDB Integration
|
|
19
|
+
- **steamgrid_search_game**: Search for games on SteamGridDB
|
|
20
|
+
- **steamgrid_get_assets**: Retrieve visual assets including:
|
|
21
|
+
- Transparent logos
|
|
22
|
+
- Boxart/grid images
|
|
23
|
+
- Hero/banner images
|
|
24
|
+
- Icons
|
|
25
|
+
- Multiple variations with metadata (dimensions, MIME type, author)
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
### Prerequisites
|
|
30
|
+
- Node.js 18 or higher
|
|
31
|
+
- npm or yarn
|
|
32
|
+
|
|
33
|
+
### Setup
|
|
34
|
+
|
|
35
|
+
1. **Clone or download this repository**
|
|
36
|
+
```bash
|
|
37
|
+
cd /Users/hoanicross/devel/perso/genai/mcp/game-encyclopedia-mcp-server
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
2. **Install dependencies**
|
|
41
|
+
```bash
|
|
42
|
+
npm install
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
3. **Configure API keys**
|
|
46
|
+
|
|
47
|
+
Copy the example environment file:
|
|
48
|
+
```bash
|
|
49
|
+
cp .env.example .env
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Edit `.env` and add your API keys:
|
|
53
|
+
- **Steam API Key**: Get from https://steamcommunity.com/dev/apikey
|
|
54
|
+
- **SteamGridDB API Key**: Get from https://www.steamgriddb.com/profile/preferences/api
|
|
55
|
+
|
|
56
|
+
```env
|
|
57
|
+
STEAM_API_KEY=your_steam_api_key_here
|
|
58
|
+
STEAMGRIDDB_API_KEY=your_steamgriddb_api_key_here
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
4. **Build the project**
|
|
62
|
+
```bash
|
|
63
|
+
npm run build
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Usage
|
|
67
|
+
|
|
68
|
+
### With Claude Desktop
|
|
69
|
+
|
|
70
|
+
Add this server to your Claude Desktop configuration file:
|
|
71
|
+
|
|
72
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"mcpServers": {
|
|
77
|
+
"game-encyclopedia": {
|
|
78
|
+
"command": "node",
|
|
79
|
+
"args": ["/Users/hoanicross/devel/perso/genai/mcp/game-encyclopedia-mcp-server/dist/index.js"],
|
|
80
|
+
"env": {
|
|
81
|
+
"STEAM_API_KEY": "your_steam_api_key_here",
|
|
82
|
+
"STEAMGRIDDB_API_KEY": "your_steamgriddb_api_key_here"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Restart Claude Desktop to load the server.
|
|
90
|
+
|
|
91
|
+
### Quick Installation/Launch
|
|
92
|
+
|
|
93
|
+
#### Via Smithery
|
|
94
|
+
You can install this server into your MCP client (like Claude Desktop) with one command:
|
|
95
|
+
```bash
|
|
96
|
+
npx -y @smithery/cli@latest install videogame-encyclopedia-mcp-server --client claude
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### Via uvx
|
|
100
|
+
If you have `uv` installed, you can run the server directly (requires Node.js locally):
|
|
101
|
+
```bash
|
|
102
|
+
uvx --from node videogame-encyclopedia-mcp-server
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
#### Via npx
|
|
106
|
+
```bash
|
|
107
|
+
npx videogame-encyclopedia-mcp-server
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
> [!NOTE]
|
|
111
|
+
> To publish this package to NPM, you must set an `NPM_TOKEN` secret in your GitHub repository settings.
|
|
112
|
+
|
|
113
|
+
## Available Tools
|
|
114
|
+
|
|
115
|
+
### 1. steam_search_game
|
|
116
|
+
|
|
117
|
+
Search for games on Steam by name.
|
|
118
|
+
|
|
119
|
+
**Input:**
|
|
120
|
+
- `query` (string, required): Game name to search for
|
|
121
|
+
- `limit` (number, optional): Maximum results (default: 10)
|
|
122
|
+
|
|
123
|
+
**Example:**
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"query": "Elden Ring",
|
|
127
|
+
"limit": 5
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 2. steam_get_details
|
|
132
|
+
|
|
133
|
+
Get detailed information about a Steam game.
|
|
134
|
+
|
|
135
|
+
**Input:**
|
|
136
|
+
- `appid` (number, required): Steam App ID
|
|
137
|
+
|
|
138
|
+
**Example:**
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"appid": 1245620
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 3. steamgrid_search_game
|
|
146
|
+
|
|
147
|
+
Search for games on SteamGridDB.
|
|
148
|
+
|
|
149
|
+
**Input:**
|
|
150
|
+
- `query` (string, required): Game name to search for
|
|
151
|
+
|
|
152
|
+
**Example:**
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"query": "Elden Ring"
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### 4. steamgrid_get_assets
|
|
160
|
+
|
|
161
|
+
Get visual assets for a game from SteamGridDB.
|
|
162
|
+
|
|
163
|
+
**Input:**
|
|
164
|
+
- `gameId` (number, required): SteamGridDB game ID
|
|
165
|
+
- `assetTypes` (array, optional): Asset types to retrieve: `grid`, `hero`, `logo`, `icon` (default: all)
|
|
166
|
+
|
|
167
|
+
**Example:**
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"gameId": 123456,
|
|
171
|
+
"assetTypes": ["logo", "grid"]
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Development
|
|
176
|
+
|
|
177
|
+
### Scripts
|
|
178
|
+
|
|
179
|
+
- `npm run build` - Compile TypeScript to JavaScript
|
|
180
|
+
- `npm start` - Run the compiled server
|
|
181
|
+
- `npm run dev` - Build and run in one command
|
|
182
|
+
|
|
183
|
+
### Project Structure
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
game-encyclopedia-mcp-server/
|
|
187
|
+
├── src/
|
|
188
|
+
│ ├── index.ts # Main server entry point
|
|
189
|
+
│ ├── config.ts # Configuration management
|
|
190
|
+
│ ├── types.ts # TypeScript type definitions
|
|
191
|
+
│ └── tools/
|
|
192
|
+
│ ├── steam.ts # Steam API integration
|
|
193
|
+
│ └── steamgrid.ts # SteamGridDB API integration
|
|
194
|
+
├── package.json
|
|
195
|
+
├── tsconfig.json
|
|
196
|
+
└── .env.example
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Troubleshooting
|
|
200
|
+
|
|
201
|
+
### "Configuration error" on startup
|
|
202
|
+
|
|
203
|
+
Make sure you've created a `.env` file with valid API keys:
|
|
204
|
+
- Check that `.env` exists in the project root
|
|
205
|
+
- Verify both `STEAM_API_KEY` and `STEAMGRIDDB_API_KEY` are set
|
|
206
|
+
- Ensure there are no quotes around the keys in the `.env` file
|
|
207
|
+
|
|
208
|
+
### "Game not found" errors
|
|
209
|
+
|
|
210
|
+
- For Steam: Verify the App ID is correct (use `steam_search_game` first)
|
|
211
|
+
- For SteamGridDB: Ensure the game ID is from SteamGridDB, not Steam
|
|
212
|
+
|
|
213
|
+
### No visual assets returned
|
|
214
|
+
|
|
215
|
+
Some games may not have all asset types available. The server returns only assets that exist in SteamGridDB.
|
|
216
|
+
|
|
217
|
+
## License
|
|
218
|
+
|
|
219
|
+
MIT
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,MAAM;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,UAAU,IAAI,MAAM,CAoBnC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import dotenv from 'dotenv';
|
|
2
|
+
// Load environment variables
|
|
3
|
+
dotenv.config();
|
|
4
|
+
export function loadConfig() {
|
|
5
|
+
const steamApiKey = process.env.STEAM_API_KEY;
|
|
6
|
+
const steamGridDbApiKey = process.env.STEAMGRIDDB_API_KEY;
|
|
7
|
+
if (!steamApiKey) {
|
|
8
|
+
throw new Error('STEAM_API_KEY is not set. Please set it in your .env file or environment variables.');
|
|
9
|
+
}
|
|
10
|
+
if (!steamGridDbApiKey) {
|
|
11
|
+
throw new Error('STEAMGRIDDB_API_KEY is not set. Please set it in your .env file or environment variables.');
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
steamApiKey,
|
|
15
|
+
steamGridDbApiKey,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,6BAA6B;AAC7B,MAAM,CAAC,MAAM,EAAE,CAAC;AAOhB,MAAM,UAAU,UAAU;IACtB,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;IAC9C,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IAE1D,IAAI,CAAC,WAAW,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACX,qFAAqF,CACxF,CAAC;IACN,CAAC;IAED,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACX,2FAA2F,CAC9F,CAAC;IACN,CAAC;IAED,OAAO;QACH,WAAW;QACX,iBAAiB;KACpB,CAAC;AACN,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
import { loadConfig } from './config.js';
|
|
6
|
+
import { searchSteamGames, getSteamGameDetails } from './tools/steam.js';
|
|
7
|
+
import { searchSteamGridGames, getSteamGridAssets } from './tools/steamgrid.js';
|
|
8
|
+
// Load configuration
|
|
9
|
+
let config;
|
|
10
|
+
try {
|
|
11
|
+
config = loadConfig();
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
console.error('Configuration error:', error);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
// Create MCP server
|
|
18
|
+
const server = new Server({
|
|
19
|
+
name: 'game-encyclopedia-mcp-server',
|
|
20
|
+
version: '1.0.0',
|
|
21
|
+
}, {
|
|
22
|
+
capabilities: {
|
|
23
|
+
tools: {},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
// Register tool list handler
|
|
27
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
28
|
+
return {
|
|
29
|
+
tools: [
|
|
30
|
+
{
|
|
31
|
+
name: 'steam_search_game',
|
|
32
|
+
description: 'Search for video games on Steam by name. Returns a list of matching games with their App IDs.',
|
|
33
|
+
inputSchema: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: {
|
|
36
|
+
query: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: 'The game name to search for',
|
|
39
|
+
},
|
|
40
|
+
limit: {
|
|
41
|
+
type: 'number',
|
|
42
|
+
description: 'Maximum number of results to return (default: 10)',
|
|
43
|
+
default: 10,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
required: ['query'],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'steam_get_details',
|
|
51
|
+
description: 'Get detailed information about a Steam game by its App ID. Returns comprehensive metadata including description, categories, genres, supported players, release date, price, and more.',
|
|
52
|
+
inputSchema: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
properties: {
|
|
55
|
+
appid: {
|
|
56
|
+
type: 'number',
|
|
57
|
+
description: 'The Steam App ID of the game',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
required: ['appid'],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'steamgrid_search_game',
|
|
65
|
+
description: 'Search for video games on SteamGridDB by name. Returns a list of matching games with their SteamGridDB IDs, which can be used to retrieve visual assets.',
|
|
66
|
+
inputSchema: {
|
|
67
|
+
type: 'object',
|
|
68
|
+
properties: {
|
|
69
|
+
query: {
|
|
70
|
+
type: 'string',
|
|
71
|
+
description: 'The game name to search for',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
required: ['query'],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'steamgrid_get_assets',
|
|
79
|
+
description: 'Get visual assets for a game from SteamGridDB. Returns URLs for various asset types including transparent logos, boxart/grids, hero images, and icons.',
|
|
80
|
+
inputSchema: {
|
|
81
|
+
type: 'object',
|
|
82
|
+
properties: {
|
|
83
|
+
gameId: {
|
|
84
|
+
type: 'number',
|
|
85
|
+
description: 'The SteamGridDB game ID',
|
|
86
|
+
},
|
|
87
|
+
assetTypes: {
|
|
88
|
+
type: 'array',
|
|
89
|
+
items: {
|
|
90
|
+
type: 'string',
|
|
91
|
+
enum: ['grid', 'hero', 'logo', 'icon'],
|
|
92
|
+
},
|
|
93
|
+
description: 'Types of assets to retrieve (default: all types)',
|
|
94
|
+
default: ['grid', 'hero', 'logo', 'icon'],
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
required: ['gameId'],
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
// Register tool call handler
|
|
104
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
105
|
+
const { name, arguments: args } = request.params;
|
|
106
|
+
try {
|
|
107
|
+
switch (name) {
|
|
108
|
+
case 'steam_search_game': {
|
|
109
|
+
const result = await searchSteamGames(args);
|
|
110
|
+
return {
|
|
111
|
+
content: [
|
|
112
|
+
{
|
|
113
|
+
type: 'text',
|
|
114
|
+
text: JSON.stringify(result, null, 2),
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
case 'steam_get_details': {
|
|
120
|
+
const result = await getSteamGameDetails(args);
|
|
121
|
+
return {
|
|
122
|
+
content: [
|
|
123
|
+
{
|
|
124
|
+
type: 'text',
|
|
125
|
+
text: JSON.stringify(result, null, 2),
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
case 'steamgrid_search_game': {
|
|
131
|
+
const result = await searchSteamGridGames(args, config);
|
|
132
|
+
return {
|
|
133
|
+
content: [
|
|
134
|
+
{
|
|
135
|
+
type: 'text',
|
|
136
|
+
text: JSON.stringify(result, null, 2),
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
case 'steamgrid_get_assets': {
|
|
142
|
+
const result = await getSteamGridAssets(args, config);
|
|
143
|
+
return {
|
|
144
|
+
content: [
|
|
145
|
+
{
|
|
146
|
+
type: 'text',
|
|
147
|
+
text: JSON.stringify(result, null, 2),
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
default:
|
|
153
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
158
|
+
return {
|
|
159
|
+
content: [
|
|
160
|
+
{
|
|
161
|
+
type: 'text',
|
|
162
|
+
text: `Error: ${errorMessage}`,
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
isError: true,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
// Start server
|
|
170
|
+
async function main() {
|
|
171
|
+
const transport = new StdioServerTransport();
|
|
172
|
+
await server.connect(transport);
|
|
173
|
+
console.error('Game Encyclopedia MCP Server running on stdio');
|
|
174
|
+
}
|
|
175
|
+
main().catch((error) => {
|
|
176
|
+
console.error('Fatal error:', error);
|
|
177
|
+
process.exit(1);
|
|
178
|
+
});
|
|
179
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACH,qBAAqB,EACrB,sBAAsB,GACzB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAEhF,qBAAqB;AACrB,IAAI,MAAM,CAAC;AACX,IAAI,CAAC;IACD,MAAM,GAAG,UAAU,EAAE,CAAC;AAC1B,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACb,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;IAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAED,oBAAoB;AACpB,MAAM,MAAM,GAAG,IAAI,MAAM,CACrB;IACI,IAAI,EAAE,8BAA8B;IACpC,OAAO,EAAE,OAAO;CACnB,EACD;IACI,YAAY,EAAE;QACV,KAAK,EAAE,EAAE;KACZ;CACJ,CACJ,CAAC;AAEF,6BAA6B;AAC7B,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;IACxD,OAAO;QACH,KAAK,EAAE;YACH;gBACI,IAAI,EAAE,mBAAmB;gBACzB,WAAW,EACP,+FAA+F;gBACnG,WAAW,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACR,KAAK,EAAE;4BACH,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,6BAA6B;yBAC7C;wBACD,KAAK,EA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wBACL;4BACI,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;yBACxC;qBACJ;iBACJ,CAAC;YACN,CAAC;YAED;gBACI,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QACjD,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,YAAY,GACd,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC;QACtE,OAAO;YACH,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,UAAU,YAAY,EAAE;iBACjC;aACJ;YACD,OAAO,EAAE,IAAI;SAChB,CAAC;IACN,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,eAAe;AACf,KAAK,UAAU,IAAI;IACf,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;AACnE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { SteamSearchInput, SteamDetailsInput } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Search for games on Steam by name
|
|
4
|
+
*/
|
|
5
|
+
export declare function searchSteamGames(input: SteamSearchInput): Promise<{
|
|
6
|
+
results: import("../types.js").SteamApp[];
|
|
7
|
+
count: number;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* Get detailed information about a Steam game by App ID
|
|
11
|
+
*/
|
|
12
|
+
export declare function getSteamGameDetails(input: SteamDetailsInput): Promise<{
|
|
13
|
+
appid: number;
|
|
14
|
+
name: string;
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
detailed_description: string;
|
|
18
|
+
about: string;
|
|
19
|
+
header_image: string;
|
|
20
|
+
capsule_image: string;
|
|
21
|
+
website: string | undefined;
|
|
22
|
+
developers: string[];
|
|
23
|
+
publishers: string[];
|
|
24
|
+
price: {
|
|
25
|
+
currency: string;
|
|
26
|
+
initial: number;
|
|
27
|
+
final: number;
|
|
28
|
+
discount_percent: number;
|
|
29
|
+
initial_formatted: string;
|
|
30
|
+
final_formatted: string;
|
|
31
|
+
} | undefined;
|
|
32
|
+
platforms: {
|
|
33
|
+
windows: boolean;
|
|
34
|
+
mac: boolean;
|
|
35
|
+
linux: boolean;
|
|
36
|
+
};
|
|
37
|
+
categories: string[];
|
|
38
|
+
genres: string[];
|
|
39
|
+
release_date: {
|
|
40
|
+
coming_soon: boolean;
|
|
41
|
+
date: string;
|
|
42
|
+
};
|
|
43
|
+
is_free: boolean;
|
|
44
|
+
supported_languages: string;
|
|
45
|
+
}>;
|
|
46
|
+
//# sourceMappingURL=steam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steam.d.ts","sourceRoot":"","sources":["../../src/tools/steam.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGR,gBAAgB,EAChB,iBAAiB,EACpB,MAAM,aAAa,CAAC;AAUrB;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB;;;GAqB7D;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCjE"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
const STEAM_APP_LIST_URL = 'https://api.steampowered.com/ISteamApps/GetAppList/v2/';
|
|
3
|
+
const STEAM_APP_DETAILS_URL = 'https://store.steampowered.com/api/appdetails';
|
|
4
|
+
// Cache for the app list to avoid repeated requests
|
|
5
|
+
let appListCache = null;
|
|
6
|
+
let appListCacheTime = 0;
|
|
7
|
+
const CACHE_DURATION = 1000 * 60 * 60 * 24; // 24 hours
|
|
8
|
+
/**
|
|
9
|
+
* Search for games on Steam by name
|
|
10
|
+
*/
|
|
11
|
+
export async function searchSteamGames(input) {
|
|
12
|
+
const { query, limit = 10 } = input;
|
|
13
|
+
// Get or update app list cache
|
|
14
|
+
const now = Date.now();
|
|
15
|
+
if (!appListCache || now - appListCacheTime > CACHE_DURATION) {
|
|
16
|
+
const response = await axios.get(STEAM_APP_LIST_URL);
|
|
17
|
+
appListCache = response.data;
|
|
18
|
+
appListCacheTime = now;
|
|
19
|
+
}
|
|
20
|
+
// Filter apps by query (case-insensitive)
|
|
21
|
+
const lowerQuery = query.toLowerCase();
|
|
22
|
+
const matches = appListCache.applist.apps
|
|
23
|
+
.filter((app) => app.name.toLowerCase().includes(lowerQuery))
|
|
24
|
+
.slice(0, limit);
|
|
25
|
+
return {
|
|
26
|
+
results: matches,
|
|
27
|
+
count: matches.length,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get detailed information about a Steam game by App ID
|
|
32
|
+
*/
|
|
33
|
+
export async function getSteamGameDetails(input) {
|
|
34
|
+
const { appid } = input;
|
|
35
|
+
const response = await axios.get(STEAM_APP_DETAILS_URL, {
|
|
36
|
+
params: { appids: appid },
|
|
37
|
+
});
|
|
38
|
+
const details = response.data[appid];
|
|
39
|
+
if (!details || !details.success) {
|
|
40
|
+
throw new Error(`Game with App ID ${appid} not found or unavailable`);
|
|
41
|
+
}
|
|
42
|
+
const data = details.data;
|
|
43
|
+
return {
|
|
44
|
+
appid: data.steam_appid,
|
|
45
|
+
name: data.name,
|
|
46
|
+
type: data.type,
|
|
47
|
+
description: data.short_description,
|
|
48
|
+
detailed_description: data.detailed_description,
|
|
49
|
+
about: data.about_the_game,
|
|
50
|
+
header_image: data.header_image,
|
|
51
|
+
capsule_image: data.capsule_image,
|
|
52
|
+
website: data.website,
|
|
53
|
+
developers: data.developers || [],
|
|
54
|
+
publishers: data.publishers || [],
|
|
55
|
+
price: data.price_overview,
|
|
56
|
+
platforms: data.platforms,
|
|
57
|
+
categories: data.categories?.map((c) => c.description) || [],
|
|
58
|
+
genres: data.genres?.map((g) => g.description) || [],
|
|
59
|
+
release_date: data.release_date,
|
|
60
|
+
is_free: data.is_free,
|
|
61
|
+
supported_languages: data.supported_languages,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=steam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steam.js","sourceRoot":"","sources":["../../src/tools/steam.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,kBAAkB,GAAG,wDAAwD,CAAC;AACpF,MAAM,qBAAqB,GAAG,+CAA+C,CAAC;AAE9E,oDAAoD;AACpD,IAAI,YAAY,GAAgC,IAAI,CAAC;AACrD,IAAI,gBAAgB,GAAG,CAAC,CAAC;AACzB,MAAM,cAAc,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW;AAEvD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,KAAuB;IAC1D,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,KAAK,CAAC;IAEpC,+BAA+B;IAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,IAAI,CAAC,YAAY,IAAI,GAAG,GAAG,gBAAgB,GAAG,cAAc,EAAE,CAAC;QAC3D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAuB,kBAAkB,CAAC,CAAC;QAC3E,YAAY,G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,CAAC,YAAY;QAC/B,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,EAAE;QACjC,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,EAAE;QACjC,KAAK,EAAE,IAAI,CAAC,cAAc;QAC1B,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE;QAC5D,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE;QACpD,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;KAChD,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Config } from '../config.js';
|
|
2
|
+
import type { SteamGridSearchInput, SteamGridAssetsInput } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Search for games on SteamGridDB
|
|
5
|
+
*/
|
|
6
|
+
export declare function searchSteamGridGames(input: SteamGridSearchInput, config: Config): Promise<{
|
|
7
|
+
results: {
|
|
8
|
+
id: number;
|
|
9
|
+
name: string;
|
|
10
|
+
types: string[];
|
|
11
|
+
verified: boolean;
|
|
12
|
+
}[];
|
|
13
|
+
count: number;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Get visual assets for a game from SteamGridDB
|
|
17
|
+
*/
|
|
18
|
+
export declare function getSteamGridAssets(input: SteamGridAssetsInput, config: Config): Promise<{
|
|
19
|
+
gameId: number;
|
|
20
|
+
assets: {
|
|
21
|
+
[key: string]: {
|
|
22
|
+
id: number;
|
|
23
|
+
url: string;
|
|
24
|
+
thumb: string;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
mime: string;
|
|
28
|
+
author: string;
|
|
29
|
+
}[];
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
//# sourceMappingURL=steamgrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steamgrid.d.ts","sourceRoot":"","sources":["../../src/tools/steamgrid.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAGR,oBAAoB,EACpB,oBAAoB,EACvB,MAAM,aAAa,CAAC;AAIrB;;GAEG;AACH,wBAAsB,oBAAoB,CACtC,KAAK,EAAE,oBAAoB,EAC3B,MAAM,EAAE,MAAM;;;;;;;;GA0BjB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACpC,KAAK,EAAE,oBAAoB,EAC3B,MAAM,EAAE,MAAM;;;;gBAMF,MAAM;iBACL,MAAM;mBACJ,MAAM;mBACN,MAAM;oBACL,MAAM;kBACR,MAAM;oBACJ,MAAM;;;GAmCzB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
const STEAMGRID_BASE_URL = 'https://www.steamgriddb.com/api/v2';
|
|
3
|
+
/**
|
|
4
|
+
* Search for games on SteamGridDB
|
|
5
|
+
*/
|
|
6
|
+
export async function searchSteamGridGames(input, config) {
|
|
7
|
+
const { query } = input;
|
|
8
|
+
const response = await axios.get(`${STEAMGRID_BASE_URL}/search/autocomplete/${encodeURIComponent(query)}`, {
|
|
9
|
+
headers: {
|
|
10
|
+
Authorization: `Bearer ${config.steamGridDbApiKey}`,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
if (!response.data.success) {
|
|
14
|
+
throw new Error('Failed to search SteamGridDB');
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
results: response.data.data.map((game) => ({
|
|
18
|
+
id: game.id,
|
|
19
|
+
name: game.name,
|
|
20
|
+
types: game.types,
|
|
21
|
+
verified: game.verified,
|
|
22
|
+
})),
|
|
23
|
+
count: response.data.data.length,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get visual assets for a game from SteamGridDB
|
|
28
|
+
*/
|
|
29
|
+
export async function getSteamGridAssets(input, config) {
|
|
30
|
+
const { gameId, assetTypes = ['grid', 'hero', 'logo', 'icon'] } = input;
|
|
31
|
+
const assets = {};
|
|
32
|
+
// Fetch each asset type
|
|
33
|
+
for (const assetType of assetTypes) {
|
|
34
|
+
try {
|
|
35
|
+
const endpoint = `${STEAMGRID_BASE_URL}/${assetType}s/game/${gameId}`;
|
|
36
|
+
const response = await axios.get(endpoint, {
|
|
37
|
+
headers: {
|
|
38
|
+
Authorization: `Bearer ${config.steamGridDbApiKey}`,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
if (response.data.success && response.data.data.length > 0) {
|
|
42
|
+
assets[assetType] = response.data.data.map((asset) => ({
|
|
43
|
+
id: asset.id,
|
|
44
|
+
url: asset.url,
|
|
45
|
+
thumb: asset.thumb,
|
|
46
|
+
width: asset.width,
|
|
47
|
+
height: asset.height,
|
|
48
|
+
mime: asset.mime,
|
|
49
|
+
author: asset.author.name,
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
// If a specific asset type fails, continue with others
|
|
55
|
+
console.error(`Failed to fetch ${assetType} for game ${gameId}:`, error);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
gameId,
|
|
60
|
+
assets,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=steamgrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steamgrid.js","sourceRoot":"","sources":["../../src/tools/steamgrid.ts"],"names":[],"mappings":"AAAA,OAAO,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kB,IAAI,SAAS,UAAU,MAAM,EAAE,CAAC;YACtE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAA0B,QAAQ,EAAE;gBAChE,OAAO,EAAE;oBACL,aAAa,EAAE,UAAU,MAAM,CAAC,iBAAiB,EAAE;iBACtD;aACJ,CAAC,CAAC;YAEH,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACzD,MAAM,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;oBACnD,EAAE,EAAE,KAAK,CAAC,EAAE;oBACZ,GAAG,EAAE,KAAK,CAAC,GAAG;oBACd,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;oBAChB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;iBAC5B,CAAC,CAAC,CAAC;YACR,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,uDAAuD;YACvD,OAAO,CAAC,KAAK,CAAC,mBAAmB,SAAS,aAAa,MAAM,GAAG,EAAE,KAAK,CAAC,CAAC;QAC7E,CAAC;IACL,CAAC;IAED,OAAO;QACH,MAAM;QACN,MAAM;KACT,CAAC;AACN,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for Steam and SteamGridDB API responses
|
|
3
|
+
*/
|
|
4
|
+
export interface SteamApp {
|
|
5
|
+
appid: number;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SteamAppListResponse {
|
|
9
|
+
applist: {
|
|
10
|
+
apps: SteamApp[];
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface SteamAppDetails {
|
|
14
|
+
success: boolean;
|
|
15
|
+
data?: {
|
|
16
|
+
name: string;
|
|
17
|
+
type: string;
|
|
18
|
+
steam_appid: number;
|
|
19
|
+
required_age: number;
|
|
20
|
+
is_free: boolean;
|
|
21
|
+
detailed_description: string;
|
|
22
|
+
short_description: string;
|
|
23
|
+
about_the_game: string;
|
|
24
|
+
supported_languages: string;
|
|
25
|
+
header_image: string;
|
|
26
|
+
capsule_image: string;
|
|
27
|
+
capsule_imagev5: string;
|
|
28
|
+
website?: string;
|
|
29
|
+
developers?: string[];
|
|
30
|
+
publishers?: string[];
|
|
31
|
+
price_overview?: {
|
|
32
|
+
currency: string;
|
|
33
|
+
initial: number;
|
|
34
|
+
final: number;
|
|
35
|
+
discount_percent: number;
|
|
36
|
+
initial_formatted: string;
|
|
37
|
+
final_formatted: string;
|
|
38
|
+
};
|
|
39
|
+
platforms: {
|
|
40
|
+
windows: boolean;
|
|
41
|
+
mac: boolean;
|
|
42
|
+
linux: boolean;
|
|
43
|
+
};
|
|
44
|
+
categories?: Array<{
|
|
45
|
+
id: number;
|
|
46
|
+
description: string;
|
|
47
|
+
}>;
|
|
48
|
+
genres?: Array<{
|
|
49
|
+
id: string;
|
|
50
|
+
description: string;
|
|
51
|
+
}>;
|
|
52
|
+
release_date: {
|
|
53
|
+
coming_soon: boolean;
|
|
54
|
+
date: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export interface SteamGridGame {
|
|
59
|
+
id: number;
|
|
60
|
+
name: string;
|
|
61
|
+
types: string[];
|
|
62
|
+
verified: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface SteamGridSearchResponse {
|
|
65
|
+
success: boolean;
|
|
66
|
+
data: SteamGridGame[];
|
|
67
|
+
}
|
|
68
|
+
export interface SteamGridAsset {
|
|
69
|
+
id: number;
|
|
70
|
+
url: string;
|
|
71
|
+
thumb: string;
|
|
72
|
+
width: number;
|
|
73
|
+
height: number;
|
|
74
|
+
mime: string;
|
|
75
|
+
language: string;
|
|
76
|
+
author: {
|
|
77
|
+
name: string;
|
|
78
|
+
steam64: string;
|
|
79
|
+
avatar: string;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export interface SteamGridAssetsResponse {
|
|
83
|
+
success: boolean;
|
|
84
|
+
data: SteamGridAsset[];
|
|
85
|
+
}
|
|
86
|
+
export interface SteamSearchInput {
|
|
87
|
+
query: string;
|
|
88
|
+
limit?: number;
|
|
89
|
+
}
|
|
90
|
+
export interface SteamDetailsInput {
|
|
91
|
+
appid: number;
|
|
92
|
+
}
|
|
93
|
+
export interface SteamGridSearchInput {
|
|
94
|
+
query: string;
|
|
95
|
+
}
|
|
96
|
+
export interface SteamGridAssetsInput {
|
|
97
|
+
gameId: number;
|
|
98
|
+
assetTypes?: ('grid' | 'hero' | 'logo' | 'icon')[];
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,MAAM,WAAW,QAAQ;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE;QACL,IAAI,EAAE,QAAQ,EAAE,CAAC;KACpB,CAAC;CACL;AAED,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE;QACH,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,EAAE,OAAO,CAAC;QACjB,oBAAoB,EAAE,MAAM,CAAC;QAC7B,iBAAiB,EAAE,MAAM,CAAC;QAC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MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;CACL;AAED,MAAM,WAAW,uBAAuB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,cAAc,EAAE,CAAC;CAC1B;AAGD,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACjC,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CACtD"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "videogame-encyclopedia-mcp-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server providing structured video game information from Steam and SteamGridDB",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"videogame-encyclopedia-mcp-server": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENCE.md"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"start": "node dist/index.js",
|
|
18
|
+
"dev": "tsc && node dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"mcp",
|
|
22
|
+
"model-context-protocol",
|
|
23
|
+
"steam",
|
|
24
|
+
"steamgriddb",
|
|
25
|
+
"games",
|
|
26
|
+
"videogames"
|
|
27
|
+
],
|
|
28
|
+
"author": "",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@modelcontextprotocol/sdk": "^1.0.4",
|
|
32
|
+
"axios": "^1.7.9",
|
|
33
|
+
"dotenv": "^16.4.7"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/node": "^22.10.2",
|
|
37
|
+
"typescript": "^5.7.2"
|
|
38
|
+
}
|
|
39
|
+
}
|