Skip to content

Commit 2b265ff

Browse files
committed
v0.2.1: Add tests, retry logic, input validation, TimeoutError, README badges
Made-with: Cursor
1 parent eca75d4 commit 2b265ff

16 files changed

Lines changed: 1966 additions & 223 deletions

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,14 @@ dist/
55
!.env.example
66
*.ssfn
77
config.vdf
8+
9+
# OS
10+
.DS_Store
11+
Thumbs.db
12+
13+
# IDE
14+
.vscode/
15+
.idea/
16+
17+
# Test coverage
18+
coverage/

CLAUDE.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## What is this?
44

5-
An MCP (Model Context Protocol) server that exposes Steam Web API endpoints as structured tools for AI-powered IDEs. It is the companion server for the [Steam Developer Tools](https://github.com/TMHSDigital/Steam-Cursor-Plugin) Cursor plugin, which provides 14 skills and 3 rules for Steam/Steamworks development.
5+
An MCP (Model Context Protocol) server that exposes Steam Web API endpoints as structured tools for AI-powered IDEs. It is the companion server for the [Steam Developer Tools](https://github.com/TMHSDigital/Steam-Cursor-Plugin) Cursor plugin, which provides 14 skills and 4 rules for Steam/Steamworks development.
66

77
The plugin's skills reference these MCP tools to fetch live data from Steam - player stats, store info, workshop items, leaderboards, and more.
88

@@ -24,7 +24,7 @@ src/
2424
**Key patterns:**
2525

2626
- Each tool is a self-contained module that exports `register(server: McpServer)`.
27-
- `steam-api.ts` provides `steamFetch()` which handles timeouts (15s via AbortController), HTTP error detection (429 rate limits, 5xx unavailable), and JSON parsing.
27+
- `steam-api.ts` provides `steamFetch()` which handles timeouts (15s via AbortController with `TimeoutError`), HTTP error detection (429 rate limits with up to 2 retries and exponential backoff, 5xx unavailable), and JSON parsing.
2828
- `errorResponse()` formats errors as MCP-compatible `{ isError: true }` responses.
2929
- Tools that need an API key call `requireApiKey()` which reads `STEAM_API_KEY` from env and throws `MissingApiKeyError` with setup instructions if missing.
3030
- No-auth tools (getAppDetails, searchApps, getPlayerCount, getAchievementStats, getWorkshopItem) work without any configuration.
@@ -40,7 +40,16 @@ npm run dev # tsx watch for development
4040

4141
## How to test
4242

43-
Manual testing via MCP inspector or by configuring as an MCP server in Cursor:
43+
**Automated tests (vitest):**
44+
45+
```bash
46+
npm test # single run
47+
npm run test:watch # watch mode
48+
```
49+
50+
Tests cover error classes, `steamFetch` behavior (mocked fetch), retry logic, and Zod input validation for all 10 tools.
51+
52+
**Manual testing** via MCP inspector or by configuring as an MCP server in Cursor:
4453

4554
```json
4655
{

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Steam MCP Server
22

3+
[![npm](https://img.shields.io/npm/v/@tmhs/steam-mcp)](https://www.npmjs.com/package/@tmhs/steam-mcp)
4+
[![license](https://img.shields.io/npm/l/@tmhs/steam-mcp)](LICENSE)
5+
[![node](https://img.shields.io/node/v/@tmhs/steam-mcp)](package.json)
6+
37
MCP (Model Context Protocol) server for Steam and Steamworks APIs. Provides structured tools for querying Steam store data, player statistics, achievements, workshop items, leaderboards, and player profiles from AI-powered IDEs.
48

59
Built as the companion MCP server for the [Steam Developer Tools](https://github.com/TMHSDigital/Steam-Cursor-Plugin) Cursor plugin.
@@ -143,6 +147,13 @@ These require `STEAM_API_KEY` to be set:
143147
| `IPublishedFileService/QueryFiles/v1` | API key |
144148
| `ISteamLeaderboards/GetLeaderboardEntries/v1` | Publisher key + IP allowlist |
145149

150+
## Testing
151+
152+
```bash
153+
npm test # Run all tests (vitest)
154+
npm run test:watch # Watch mode
155+
```
156+
146157
## Development
147158

148159
```bash

0 commit comments

Comments
 (0)