Content
# SteamDT MCP Server
SteamDT MCP is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for CS2 item trading analysis, connected to the [SteamDT](https://steamdt.com) open platform API, allowing AI assistants (Claude, Cursor, OpenCode, etc.) to directly query CS2 item real-time prices, K-line trends, broad market indices, wear and tear, inspection views, and other data.
## Function Overview
| Category | Tool | Description |
|------|------|------|
| Basic Data | `steamdt_get_base_info` | Get full CS2 item basic information list |
| Search | `steamdt_search_item_by_name` | Fuzzy search in Chinese/English + intelligent style recognition |
| Price Inquiry | `steamdt_get_price_single` | Single item all-platform in-sale/purchase price |
| | `steamdt_get_price_batch` | Batch query (up to 100 items) |
| | `steamdt_get_price_avg7d` | N-day average price query |
| K-line Data | `steamdt_get_item_kline` | Single item K-line (supports platform/special style) |
| | `steamdt_get_broad_kline` | CS2 broad market K-line |
| Broad Market Index | `steamdt_get_broad_index` | Latest broad market index (including rise/fall) |
| Wear and Tear | `steamdt_get_wear_by_inspect_url` | Query wear and tear/stickers by inspection link |
| | `steamdt_get_wear_by_asmd` | Query wear and tear by ASMD parameters |
| Inspection View | `steamdt_get_inspect_by_url` | Generate 2D inspection view (by inspection link) |
| | `steamdt_get_inspect_by_asmd` | Generate 2D inspection view (by ASMD parameters) |
| Style Comparison | `steamdt_special_styles` | Special style comparison table (Doppler/Gradient/Kimono, etc.) |
## Quick Start
### 1. Get API Key
Go to [SteamDT Open Platform](https://open.steamdt.com) to register and obtain an API Key.
### 2. Clone and Install
```bash
git clone https://github.com/zkcaryq/steamdt-mcp.git
cd steamdt-mcp
# No need for npm install, no external dependencies
```
### 3. Configure API Key
Create a `.env` file in the project root directory:
```env
STEAMDT_API_KEY=your_API_KEY
```
Optional configuration items:
```env
STEAMDT_API_BASE=https://open.steamdt.com # API address (default)
STEAMDT_TIMEOUT_MS=20000 # Request timeout (ms)
STEAMDT_MAX_RETRIES=2 # Maximum retries
STEAMDT_CACHE_DIR=.cache # Cache directory
```
### 4. Connect to AI Client
According to the client you are using, add the corresponding MCP configuration:
#### Claude Desktop
Edit `claude_desktop_config.json`:
```json
{
"mcpServers": {
"steamdt": {
"command": "node",
"args": ["D:/AI/steamDT/steamdt-mcp/src/server.js"],
"env": {
"STEAMDT_API_KEY": "your_API_KEY"
}
}
}
}
```
#### Cursor
Edit `.cursor/mcp.json`:
```json
{
"mcpServers": {
"steamdt": {
"command": "node",
"args": ["D:/AI/steamDT/steamdt-mcp/src/server.js"],
"env": {
"STEAMDT_API_KEY": "your_API_KEY"
}
}
}
}
```
#### OpenCode
Edit `opencode.json`:
```json
{
"mcpServers": {
"steamdt": {
"command": "node",
"args": ["D:/AI/steamDT/steamdt-mcp/src/server.js"],
"env": {
"STEAMDT_API_KEY": "your_API_KEY"
}
}
}
}
```
## Requirements
- **Node.js** >= 18.0.0
- **SteamDT API Key** ([register to obtain](https://open.steamdt.com))
This project has zero external dependencies and only uses Node.js built-in modules (`https`, `fs`, `path`, `readline`).
## Tool Detailed Description
### `steamdt_get_base_info`
Get the full CS2 item basic information list from SteamDT, including Chinese name, `marketHashName`, and platform `itemId` mapping.
- **Frequency Limit**: 1 time per day
- **Cache Mechanism**: Results are automatically cached to `.cache/base_info.json`, and subsequent calls prefer to use the cache
| Parameter | Type | Required | Description |
|------|------|------|------|
| `forceRefresh` | boolean | No | Set to `true` to force refresh the cache |
**Return Example**:
```json
{
"success": true,
"data": [
{
"name": "AK-47 | Redline (Field-Tested)",
"marketHashName": "AK-47 | Redline (Field-Tested)",
"platformList": [
{ "name": "BUFF", "itemId": "33885" },
{ "name": "YOUPIN", "itemId": "425" },
{ "name": "C5", "itemId": "22315" }
]
}
]
}
```
### `steamdt_search_item_by_name`
Fuzzy search for items by Chinese or English name, returning matching `marketHashName`.
> ⚠️ Must call `steamdt_get_base_info` to establish the cache before using the search function.
**Intelligent Style Recognition**: Automatically identify special style keywords in the query, peel them off, search for the basic item, and return the corresponding `specialStyle` parameter value, which can be directly used for `steamdt_get_item_kline` style filtering.
| Parameter | Type | Required | Default Value | Description |
|------|------|------|--------|------|
| `query` | string | Yes | - | Search keyword (Chinese/English, supports word segmentation, can contain style keywords) |
| `limit` | integer | No | 10 | Return quantity upper limit |
**Style Keyword Support Table**:
| Category | Example Keywords | Return `specialStyle` |
|------|-----------|---------------------|
| Doppler Phase | `P1` `P2` `P3` `P4` `Phase 1` | `p1` `p2` `p3` `p4` |
| Doppler Gem | `ruby` `sapphire` `emerald` `blackpearl` | `ruby` `sapphire` `emerald` `blackpearl` |
| Gradient Gear | `1st`~`10th` | `1st`~`10th` |
| Tier | `T1` `T2` `T3` `T4` `Tier 1` | `t1` `t2` `t3` `t4` |
| Single Blue | `singleblue` | `singleblue` |
| Crimson Kimono | `crimson_kimono_p1` | `crimson_kimono_p1`~`p6` |
| Sun | `sun` | `sun` |
**Usage Example**:
```
Search "P2 Butterfly Knife" → Automatically identify P2, search for "Butterfly Knife", return specialStyle: "p2"
Search "Ruby M9" → Automatically identify Ruby, search for "M9", return specialStyle: "ruby"
Search "Gradient Marble 1st" → Automatically identify 1st, search for "Gradient Marble", return specialStyle: "1st"
Search "Crimson Kimono 3rd" → Automatically identify Crimson Kimono 3rd, return specialStyle: "crimson_kimono_p3"
Search "AK-47 Tier 2" → Automatically identify Tier 2, search for "AK-47 Tier", return specialStyle: "t2"
Search "Black Pearl" (no item name) → Automatically fall back to search "Doppler", return specialStyle: "blackpearl"
Search "Print renas" → Ordinary search, no style recognition
```
### `steamdt_get_price_single`
Query the real-time in-sale/purchase price of a single item on each platform.
- **Frequency Limit**: 60 times/minute
| Parameter | Type | Required | Description |
|------|------|------|------|
| `marketHashName` | string | Yes | Steam official item name (obtained from `base_info` or search) |
**Return Example**:
```json
{
"success": true,
"data": [
{
"platform": "BUFF",
"sellPrice": 12999.5,
"sellCount": 32,
"biddingPrice": 11220,
"biddingCount": 7,
"updateTime": 1780543978
},
{
"platform": "YOUPIN",
"sellPrice": 13489.99,
"sellCount": 225,
"biddingPrice": 13010,
"biddingCount": 54
}
]
}
```
**Field Description**:
| Field | Meaning |
|------|------|
| `sellPrice` | Lowest in-sale price (CNY) |
| `sellCount` | In-sale quantity |
| `biddingPrice` | Highest bid price (CNY) |
| `biddingCount` | Bid quantity |
Supported platforms: BUFF / YOUPIN / C5 / HALOSKINS / STEAM / WAXPEER / DMARKET / SKINPORT / CSMONEY
### `steamdt_get_price_batch`
Batch query item prices, up to 100 items at a time.
- **Frequency Limit**: 1 time/minute
| Parameter | Type | Required | Description |
|------|------|------|------|
| `marketHashNames` | string[] | Yes | Item name array, at least 1 item, up to 100 items |
**Usage Example**:
```json
{
"marketHashNames": [
"AK-47 | Redline (Field-Tested)",
"AWP | Asiimov (Field-Tested)",
"M4A4 | The Coalition (Factory New)"
]
}
```
### `steamdt_get_price_avg7d`
Query the average price of an item on each platform over the past N days and the overall average price.
| Parameter | Type | Required | Default Value | Description |
|------|------|------|--------|------|
| `marketHashName` | string | Yes | - | Steam official item name |
| `days` | integer | No | 7 | Lookback days, e.g., 7, 30, 90 |
**Return Example**:
```json
{
"success": true,
"data": {
"marketHashName": "AK-47 | Redline (Field-Tested)",
"avgPrice": 118.5,
"dataList": [
{ "platform": "BUFF", "avgPrice": 115.2 },
{ "platform": "YOUPIN", "avgPrice": 120.8 }
]
}
}
```
### `steamdt_get_item_kline`
Query the K-line data of a single item (OHLC, no volume).
- **Frequency Limit**: 120 times/minute
| Parameter | Type | Required | Description |
|------|------|------|------|
| `marketHashName` | string | Yes | Item name |
| `type` | integer (1-3) | Yes | K-line type (1=day/2=4 hours/3=1 hour) |
| `platform` | string | No | Platform filter: `BUFF` / `YOUPIN` / `C5` / `STEAM` / `HALOSKINS` / `ALL` |
| `specialStyle` | string | No | Special style value (refer to `steamdt_special_styles`) |
**Return Example**:
```json
[
[1735689600, 110.0, 112.5, 108.0, 111.2],
[1735776000, 111.2, 115.0, 110.5, 114.8]
]
```
Each K-line format: `[timestamp, open price, high price, low price, close price]`
`specialStyle` is applicable to items that need to distinguish styles:
- Doppler/Gamma Doppler → `p1` / `p2` / `p3` / `p4` / `ruby` / `emerald` / `sapphire` / `blackpearl`
- Gradient Marble → `1st` ~ `10th` (ice fire gear)
- Crimson Kimono → `crimson_kimono_p1` ~ `crimson_kimono_p6`
- Tier → `t1` / `t2` / `t3` / `t4` / `singleblue` (single blue)
### `steamdt_get_broad_kline`
Query the CS2 broad market K-line data.
| Parameter | Type | Required | Description |
|------|------|------|------|
| `type` | integer (1-3) | Yes | K-line type (1=day/2=4 hours/3=1 hour) |
### `steamdt_get_broad_index`
Query the latest CS2 broad market index (including rise/fall value and historical records).
No parameters.
**Return Example**:
```json
{
"success": true,
"data": {
"broadMarketIndex": 913.88,
"diffYesterday": 14.18,
"diffYesterdayRatio": 1.5761,
"historyMarketIndexList": [
[1780455600, 881.72],
[1780459200, 885.15]
]
}
}
```
| Field | Meaning |
|------|------|
| `broadMarketIndex` | Current broad market index |
| `diffYesterday` | Yesterday's rise/fall value |
| `diffYesterdayRatio` | Yesterday's rise/fall percentage |
| `historyMarketIndexList` | Recent historical index `[timestamp, index value]` |
### `steamdt_get_wear_by_inspect_url`
Query the wear and tear of an item and related data (wear value, stickers, etc.) through the Steam inspection link.
- **Frequency Limit**: 36000 times/hour
| Parameter | Type | Required | Description |
|------|------|------|------|
| `inspectUrl` | string | Yes | Steam CS2 inspection link, format `steam://rungame/730/...` |
| `notifyUrl` | string | No | Asynchronous callback address, not filled in for synchronous return |
### `steamdt_get_wear_by_asmd`
Query the wear and tear through ASMD parameters (alternative to inspection link, applicable to known ASMD parameters).
- **Frequency Limit**: 36000 times/hour
| Parameter | Type | Required | Description |
|------|------|------|------|
| `s` | integer | No | ASMD parameter S |
| `m` | integer | No | ASMD parameter M |
| `a` | integer | No | ASMD parameter A |
| `d` | string | No | ASMD parameter D |
| `notifyUrl` | string | No | Asynchronous callback address |
### `steamdt_get_inspect_by_url`
Generate a 2D inspection view of an item through the inspection link (need to obtain data through wear and tear interface first).
- **Frequency Limit**: 100 times/day ⚠️ Scarce resource
| Parameter | Type | Required | Description |
|------|------|------|------|
| `inspectUrl` | string | Yes | Steam CS2 inspection link |
| `notifyUrl` | string | No | Asynchronous callback address |
### `steamdt_get_inspect_by_asmd`
Generate a 2D inspection view of an item through ASMD parameters.
- **Frequency Limit**: 100 times/day ⚠️ Scarce resource
| Parameter | Type | Required | Description |
|------|------|------|------|
| `s` | integer | No | ASMD parameter S |
| `m` | integer | No | ASMD parameter M |
| `a` | integer | No | ASMD parameter A |
| `d` | string | No | ASMD parameter D |
| `notifyUrl` | string | No | Asynchronous callback address |
---
### `steamdt_special_styles`
Get the CS2 special style comparison table for interpreting `paintseed` and special style fields in wear data.
No parameters.
**Return Comparison Table**:
| Category | Optional Values | Description |
|------|--------|------|
| `RANK` | `1st` ~ `10th` | Gradual marble and other item ranks |
| `TIER` | `t1` ~ `t4` | Surface quenched grade |
| `PHASE` | `p1`/`p2`/`p3`/`p4`/`ruby`/`emerald`/`sapphire`/`blackpearl` | Doppler/Gamma Doppler phase |
| `SINGLEBLUE` | `singleblue` | Surface quenched single-sided all blue |
| `CRIMSON_KIMONO` | `crimson_kimono_p1` ~ `p6` | Crimson kimono ranks |
---
## Typical Use Cases
### Case 1: Quick Item Price Inquiry
Ask the AI assistant:
> "Help me check the prices of AK-47 | Red Line (Battle-Scarred) on various platforms"
The AI will automatically call `steamdt_get_price_single` and return the selling and buying prices on platforms like BUFF, YOUPIN, and C5.
### Case 2: Analyzing K-Line Trends
> "Analyze the K-line trend of M4A4 | Conqueror (Factory New) on BUFF recently"
The AI will call `steamdt_get_item_kline` (type=1 daily line) and combine it with `steamdt_get_price_avg7d` to comprehensively determine the trend.
### Case 3: Doppler Knife Style Analysis
> "What phase is this ★ Butterfly Knife | Doppler in?"
The AI will first query the wear data using `steamdt_get_wear_by_inspect_url`, and then use the `steamdt_special_styles` comparison table to interpret the specific phase.
### Case 4: Market Environment Judgment
> "How is the overall CS2 market right now?"
The AI will call `steamdt_get_broad_index` and `steamdt_get_broad_kline` to provide a market trend judgment.
### Case 5: Batch Comparison
> "Help me compare the BUFF selling prices of these 10 AKs"
The AI will call `steamdt_get_price_batch` to pull the full-platform prices of 10 items at once.
---
## Frequency Limit Summary
| Tool | Limit |
|------|------|
| `steamdt_get_base_info` | 1 time/day |
| `steamdt_get_price_single` | 60 times/minute |
| `steamdt_get_price_batch` | 1 time/minute |
| `steamdt_get_item_kline` | 120 times/minute |
| `steamdt_get_wear_by_inspect_url` / `by_asmd` | 36000 times/hour |
| `steamdt_get_inspect_by_url` / `by_asmd` | 100 times/day |
| `steamdt_get_price_avg7d` | No clear limit |
| `steamdt_get_broad_index` / `kline` | No clear limit |
| `steamdt_search_item_by_name` | Local search, no limit |
---
## Project Structure
```
steamdt-mcp/
├── src/
│ ├── server.js # MCP protocol server (JSON-RPC over stdio)
│ └── lib.js # Core function library (API request, cache, search, tool distribution)
├── test/
│ ├── whitebox.test.js # Unit test (function level)
│ └── blackbox.test.js # Integration test (start MCP server test)
├── .cache/ # Cache directory (automatically generated, gitignored)
├── .env # API Key configuration (gitignored)
├── package.json
└── .gitignore
```
## Running Tests
```bash
# Unit test
npm run test:whitebox
# Integration test (requires MCP service connection)
npm run test:blackbox
# All tests
npm test
```
> In integration tests, if a real `STEAMDT_API_KEY` environment variable is set, Live API tests will also be executed.
## License
MIT
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
No recommendations available