Skip to main content

Agents and MCP

SteamMarketRunner is designed for both humans and AI agents. Agent support has three layers.

1. llms.txt​

The documentation site publishes machine-readable files using the llmstxt.org convention:

  • https://docs.steammarketrunner.com/llms.txt — an index with links to all sections;
  • https://docs.steammarketrunner.com/llms-full.txt — the full documentation as one text file.

Agents can load llms-full.txt to get product context. Use absolute URLs when operating outside the site; relative paths may not resolve in an agent runtime.

2. OpenAPI​

The public API specification is available:

  • interactively on API Reference;
  • as a file: https://docs.steammarketrunner.com/openapi.json.

Internal and operator-only endpoints are hidden from the public spec. User integrations should create a service key in the cabinet. Service keys are tenant-scoped, stored only as hashes, and shown in plaintext once at creation. Mutations that enqueue work are idempotent with the x-idempotency-key header.

Account trading is controlled through per-account routes such as /steam-accounts/{id}/trading/*; user job history is available under /steam-accounts/{id}/decisions/jobs; user audit is available per account under /steam-accounts/{id}/audit-events. Note: the generic job enqueue POST /steam-accounts/{id}/decisions/jobs used below works for service keys but is intentionally hidden from the public OpenAPI spec.

Global /jobs*, /audit-events, and runner operator routes under /admin/runner/* require an admin actor; tenant-scoped service keys receive 403 there and should use the per-account APIs above. The old global /runner/* base is gone; /trading/* is only a deprecated internal alias for admin operator clients.

Work model: enqueue and poll​

Trading actions are asynchronous and idempotent. You enqueue a job, get its id, and poll for result.

Repeating the same x-idempotency-key for the same account returns the existing job instead of creating a duplicate.

End-to-end example​

Send the key in the x-api-key header (Authorization: Bearer <key> works too) to https://api.steammarketrunner.com — not to the cabinet domain app.steammarketrunner.com, which serves the web app and answers every path with HTML. A missing, unknown or revoked key gets 401 UNAUTHORIZED; 403 FORBIDDEN means the key is valid but the route is not open to it (admin-only routes and key management). It is also useful to send x-steammarketrunner-actor and x-request-id for audit correlation.

1. Create a service key in the cabinet: Settings → Service API keys. The plaintext key is shown only once. The same can be done from the owner browser session:

curl -X POST https://api.steammarketrunner.com/auth/service-keys \
-H "content-type: application/json" \
-H "cookie: steammarketrunner_session=..." \
-d '{"name":"my-agent"}'
# -> { "key": "mops_<plaintext shown once>", "serviceKey": { "id": "...", "prefix": "mops_...", ... } }

Check that the key works:

curl https://api.steammarketrunner.com/auth/service/me -H "x-api-key: ***"
# -> { "actor": { "type": "service_api", "userId": "...", ... }, ... }

2. Enqueue a buy analysis. New decision jobs are live-only; use conservative strategy settings and small item scopes:

curl -X POST https://api.steammarketrunner.com/steam-accounts/$STEAM_ACCOUNT_ID/decisions/jobs \
-H "content-type: application/json" \
-H "x-api-key: ***" \
-H "x-steammarketrunner-actor: my-agent" \
-H "x-request-id: my-agent-2026-06-14-0001" \
-H "x-idempotency-key: my-agent-buy-analysis-0001" \
-d '{"type":"buy_analysis","appid":252490,"payload":{"maxCandidates":5}}'
# -> { "id": "$JOB_QUEUE_ID", ... }

3. Fetch the result:

curl "https://api.steammarketrunner.com/steam-accounts/$STEAM_ACCOUNT_ID/decisions/jobs/$JOB_QUEUE_ID/result" \
-H "x-api-key: ***" \
-H "x-steammarketrunner-actor: my-agent"

3. MCP server​

The @steammarketrunner/mcp package exposes the documentation and OpenAPI spec as Model Context Protocol tools instead of a long text blob. The stdio server provides six tools:

ToolWhat it does
list_docslist all documentation pages with id, title, and URL
read_docread one full markdown document by id
search_docssearch docs with ranked snippets
list_api_operationslist OpenAPI operations with filters
search_apisearch API operations by keywords
get_api_operationget full operation schema: parameters, body, responses

Claude Code setup​

pnpm --filter @steammarketrunner/mcp build
claude mcp add steammarketrunner -- node /absolute/path/to/steammarketrunner/apps/mcp/dist/index.js

Generic client config​

{
"mcpServers": {
"steammarketrunner": {
"command": "node",
"args": ["/absolute/path/to/steammarketrunner/apps/mcp/dist/index.js"]
}
}
}
Use an absolute path

args must contain an absolute path to dist/index.js. Relative paths usually fail because an MCP client’s working directory is not the repository root.

See apps/mcp/README.md for more details.

Next​