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 through /audit-log and per-account /steam-accounts/{id}/audit-events.

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

Service-key authentication uses the x-api-key header. It is also useful to send x-steammarketrunner-actor and x-request-id for audit correlation.

1. Create a service key from the owner browser session. The plaintext key is returned only once:

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

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