- Node.js 22 or later
- npm
- A Steam Web API key for testing authenticated tools (free at https://steamcommunity.com/dev/apikey)
git clone https://github.com/TMHSDigital/steam-mcp.git
cd steam-mcp
npm install
npm run buildSet your API key for testing:
# PowerShell
$env:STEAM_API_KEY = "your_key_here"
# Bash
export STEAM_API_KEY="your_key_here"Run in development mode (auto-reloads on changes):
npm run devCLAUDE.md maps the source tree and the patterns every tool follows; it is the fastest way in.
-
Create a new file in
src/tools/(e.g.src/tools/getPlayerCount.ts). -
Follow the existing pattern - export a
registerfunction that callsserver.registerTool()(never the deprecatedserver.tool()):
import { z } from "zod";
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { steamApiUrl, steamFetch, errorResponse } from "../utils/steam-api.js";
import { READ_ONLY } from "../utils/annotations.js";
const inputSchema = {
appid: z.number().int().positive().describe("Steam application ID"),
};
// Optional: declare the result shape and return it as structuredContent too.
const outputSchema = {
appid: z.number().int(),
player_count: z.number().int().describe("Concurrent players right now"),
};
export function register(server: McpServer): void {
server.registerTool(
"steam_getPlayerCount",
{
title: "Get Player Count",
description:
"Get the current number of concurrent players for a Steam app. No API key required.",
inputSchema,
outputSchema,
annotations: READ_ONLY,
},
async ({ appid }) => {
try {
const url = steamApiUrl("/ISteamUserStats/GetNumberOfCurrentPlayers/v1/", { appid });
const data = (await steamFetch(url)) as { response?: { player_count?: number; result?: number } };
if (data.response?.result !== 1 || data.response.player_count === undefined) {
return errorResponse(new Error(`No player count data available for app ${appid}.`));
}
// Compact JSON (no indentation): results go into the agent's context.
const structured = { appid, player_count: data.response.player_count };
return {
content: [{ type: "text", text: JSON.stringify(structured) }],
structuredContent: structured,
};
} catch (error) {
return errorResponse(error);
}
},
);
}Pick annotations from src/utils/annotations.ts: READ_ONLY for Steam reads, LOCAL_ONLY for tools that never touch the network, LIVE_WRITE or LIVE_WRITE_IDEMPOTENT for confirm-gated mutations.
- Add it to a toolset in
src/tools/index.ts(store,community,publisher,mutations,sdk,assets,build, ordeploy). Live Partner API writes go inmutations, which is off by default. Anything that uploads or changes a live build goes indeploy, which also needsSTEAM_MCP_ENABLE_DEPLOY=1and never loads over HTTP:
import { register as registerGetPlayerCount } from "./getPlayerCount.js";
// ...
export const TOOLSETS = {
store: [registerGetAppDetails, registerGetPlayerCount, /* ... */],Add the tool to the README toolset table too.
4. Every tool description, keyless ones included, must say which key it needs with one of these exact phrases, which the site build reads (site/build.ts keyNeed): "No API key required", "Requires STEAM_API_KEY", "publisher key", or "Financial API Group key". Tools in the sdk, assets, and build toolsets are local and exempt. If the tool needs a key, use requireApiKey() from steam-api.ts.
-
If the tool performs a live mutation (inventory grant, achievement/stat write, leaderboard write, Workshop metadata update, Partner-admin upload, or similar), spread
confirmSchemafromsrc/utils/confirm.ts, callrefuseIfUnconfirmedbefore any network I/O, run the dry-run branch beforerequireApiKey(), and prepend a capability warning to the tool description. Do not add a new write tool that can send unconfirmed. Adeploytool also calls the gates insrc/build/deploy.ts(refuseLiveDeployfor agent sessions,refuseProtectedBranchfor the default branch) before it runs anything. Read-only Steam POSTs (for exampleGetPublishedFileDetails) are not mutations and must not use this gate. -
Add a row for the tool to the README tool table and bump the tool counts (README,
CLAUDE.md,package.jsondescription). A new Steam endpoint also gets a row in the README endpoint table (and its count), a newoutputSchemagoes in the README "Typed output" list, and a new prompt gets a row in the README prompts table. Then runnpm run siteand commit the regenerateddocs/pages, which list every tool.npm test(docs-drift.test.ts) fails until they all match. -
Add a handler test under
src/tools/__tests__/that stubsfetchwith a fixture (handlers.test.tsfails until every tool has a success and an error case), and build and test:
npm run build
npm testThe animated terminal at the top of the README (assets/demo-dark.svg, assets/demo-light.svg) is generated by node scripts/render-demo-svg.mjs. It only shows real tool output: to change a scene, run the tool, paste what it returned into the script, and regenerate both files.
- TypeScript with strict mode enabled
- Never use em dashes. Use a regular dash or rewrite the sentence.
- Never hardcode API keys. Always read from
STEAM_API_KEYenvironment variable. - Every tool should have a clear description and well-typed zod input schema with
.describe()on each field. - Wrap all tool handlers in try/catch and use
errorResponse()for error formatting. - Live mutations must use the shared confirm gate (
confirmSchema,refuseIfUnconfirmed, dry-run beforerequireApiKey()).
- One tool per PR when adding new tools
- Include the Steam API endpoint URL in the PR description
- Note whether the endpoint requires authentication
- Test with real Steam API calls before submitting
- Keep changes focused - avoid unrelated refactors in the same PR
- Make sure
npm run build,npm run typecheck, andnpm testpass
The version lives in package.json, mirrored in server.json and mcpb/manifest.json (a test enforces that they match). Both servers read it at runtime from src/version.ts.
- Move the
[Unreleased]entries inCHANGELOG.mdunder a new version heading with today's date. npm version <patch|minor|major> --no-git-tag-version(updatespackage.jsonandpackage-lock.json), and set bothversionfields inserver.jsonand theversioninmcpb/manifest.jsonto the same value.npm testfails until they match.- If the tool list changed, update the counts in
package.jsondescription, the README badge, summary line, and tool tables, andCLAUDE.md.npm testfails until they match the registered tools. - If a supported-version boundary moved, update the table in
SECURITY.md. - Run
npm run siteand commit the regenerateddocs/pages: they show the version, sonpm versionmakes them stale. npm run build && npx tsc -p tsconfig.partner.json && npm run typecheck && npm test- Commit, push, and publish a GitHub release tagged
vX.Y.Z. The publish workflow ships it to npm, then lists it in the official MCP Registry fromserver.json, and attaches the Claude Desktop extension (steam-mcp.mcpb, built bynpm run mcpb) to the release. The Docker workflow pushesghcr.io/tmhsdigital/steam-mcp. - Check the publish run. If the MCP Registry job fails because npm does not have the new version yet, wait until
npm view @tmhs/steam-mcp versionshows it and rerun only the failed job (gh run rerun <run id> --failed).
This project uses CC-BY-ND-4.0 as its outbound license, which forbids derivatives. Every pull request is a derivative. Contributions are accepted inbound under a broader grant via the Developer Certificate of Origin (DCO), which resolves the conflict so the project can accept and redistribute contributions.
By submitting a contribution to this repository, you certify that you have the right to do so under the Developer Certificate of Origin (DCO) 1.1, and you grant TMHSDigital a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license to use, reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute your contribution under the project's current license (CC-BY-ND-4.0) or any successor license chosen by the project.
Every commit in a pull request must have a Signed-off-by: trailer matching the commit author:
Signed-off-by: Jane Developer <jane@example.com>
Signing is done at commit time:
git commit -s -m "feat: add new skill"The GitHub DCO App enforces this on every PR.
For the full inbound/outbound model and rationale, see standards/licensing.md in the Developer-Tools-Directory meta-repo.