encarapi-mcp 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +1 -1
- package/src/server.js +36 -26
package/README.md
CHANGED
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
|
|
14
14
|
| Tool | What it does |
|
|
15
15
|
|---|---|
|
|
16
|
-
| `search_korean_cars` | Search Korean listings (brand, model, year, price in 10,000 KRW, mileage, fuel, accident-free, seller region and city, source: encar / kbc / kcar / all) |
|
|
16
|
+
| `search_korean_cars` | Search Korean listings (brand, model, year, price in 10,000 KRW, mileage, fuel, accident-free, seller region and city, source: encar / kbc / kcar / all; `lang`: en, ru or de for English, Russian or German values) |
|
|
17
17
|
| `search_korean_excavators` | Search Korean used excavators (maker, model, operating hours, weight class, region; Business/Scale key) |
|
|
18
18
|
| `search_korean_trucks` | Search Korean trucks, buses and special vehicles (body type, payload in tons, use, region; Business/Scale key) |
|
|
19
19
|
| `find_korean_car_by_vin` | All Encar / K Car listings of one VIN, incl. removed ones (Business/Scale key) |
|
|
20
20
|
| `get_korean_truck` | Full record for one truck: detail, inspection report, cargo box, VIN and plate (Business/Scale key) |
|
|
21
|
-
| `get_korean_car` | Full detail for one listing (specs, options, photos, price history, seller) |
|
|
21
|
+
| `get_korean_car` | Full detail for one listing (specs, options, photos, price history, seller; `lang`: en, ru or de) |
|
|
22
22
|
| `get_korean_inspection` | Official Korean inspection report |
|
|
23
23
|
| `get_korean_accident_record` | Insurance accident history and ownership changes |
|
|
24
24
|
| `find_korean_models` | Model name autocomplete across brands |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "encarapi-mcp",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "MCP server for EnCarAPI and ChinaCarAPI: live Korean (Encar, KB Chachacha, K Car) and Chinese (Dongchedi, Che168) used car listings for Claude, Cursor and other AI assistants.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/server.js",
|
package/src/server.js
CHANGED
|
@@ -4,7 +4,7 @@ import encarapi from "encarapi";
|
|
|
4
4
|
|
|
5
5
|
const { KoreaClient, ChinaClient } = encarapi;
|
|
6
6
|
|
|
7
|
-
export const VERSION = "1.6.
|
|
7
|
+
export const VERSION = "1.6.2";
|
|
8
8
|
const MAX_TEXT = 40000;
|
|
9
9
|
|
|
10
10
|
const asText = (data) => {
|
|
@@ -32,27 +32,32 @@ const firstPhoto = (photos) => {
|
|
|
32
32
|
return typeof p === "string" ? p : p.url || p.location || p.Url || undefined;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
// Compact, English-first view of a Korean catalog item for LLM context.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
35
|
+
// Compact, English-first view of a Korean catalog item for LLM context. With
|
|
36
|
+
// lang "ru" / "de" the API puts the Russian / German values into the main
|
|
37
|
+
// fields, so those win over the *English twins.
|
|
38
|
+
const koreaItem = (c, lang = "en") => {
|
|
39
|
+
const pick = (en, main) => (lang === "en" ? en || main : main ?? en);
|
|
40
|
+
return {
|
|
41
|
+
id: c.Id,
|
|
42
|
+
source: c.Source || "encar",
|
|
43
|
+
make: c.ManufacturerEnglish || c.Manufacturer,
|
|
44
|
+
model: pick(c.ModelEnglish, c.Model),
|
|
45
|
+
trim: pick(c.BadgeEnglish, c.Badge),
|
|
46
|
+
year: c.Year,
|
|
47
|
+
priceKRW: typeof c.Price === "number" ? c.Price * 10000 : undefined,
|
|
48
|
+
mileageKm: c.Mileage,
|
|
49
|
+
fuel: pick(c.FuelTypeEnglish, c.FuelType),
|
|
50
|
+
transmission: c.Transmission,
|
|
51
|
+
powerPs: c.PowerPs,
|
|
52
|
+
displacementCc: c.DisplacementCc,
|
|
53
|
+
color: c.Color,
|
|
54
|
+
region: c.Region || undefined,
|
|
55
|
+
city: c.City || undefined,
|
|
56
|
+
duplicateOf: c.IsDuplicate ? c.DuplicateOf : undefined,
|
|
57
|
+
url: c.Url,
|
|
58
|
+
photo: firstPhoto(c.Photos),
|
|
59
|
+
};
|
|
60
|
+
};
|
|
56
61
|
|
|
57
62
|
const chinaItem = (c) => ({
|
|
58
63
|
id: c.id,
|
|
@@ -170,12 +175,14 @@ export function createServer({ apiKey, chinaKey, fetchImpl, transport = "stdio",
|
|
|
170
175
|
sort: z.enum(["newest", "price_asc", "price_desc", "mileage_asc", "mileage_desc", "year_desc", "year_asc"]).optional(),
|
|
171
176
|
limit: z.number().int().min(1).max(50).optional().describe("Results per page, default 10"),
|
|
172
177
|
page: z.number().int().min(1).optional(),
|
|
178
|
+
lang: z.enum(["en", "ru", "de"]).optional().describe("Language of the returned values (fuel, colors, regions, options; with 'de' also model and trim names): en (default), ru = Russian, de = German. Filters stay English"),
|
|
173
179
|
},
|
|
174
180
|
annotations: readOnly,
|
|
175
181
|
},
|
|
176
182
|
run(async (args) => {
|
|
177
|
-
const
|
|
178
|
-
|
|
183
|
+
const lang = args.lang || "en";
|
|
184
|
+
const res = await needKorea().catalog({ ...args, limit: args.limit || 10, lang, count: true });
|
|
185
|
+
return { total: res.Count, page: args.page || 1, results: (res.SearchResults || []).map((c) => koreaItem(c, lang)) };
|
|
179
186
|
})
|
|
180
187
|
);
|
|
181
188
|
|
|
@@ -291,10 +298,13 @@ export function createServer({ apiKey, chinaKey, fetchImpl, transport = "stdio",
|
|
|
291
298
|
{
|
|
292
299
|
title: "Get a Korean car",
|
|
293
300
|
description: "Full details for one Korean listing: specs, options, photos, price history, seller. Id: Encar id, 'kbc:<id>' or 'kcar:<id>'.",
|
|
294
|
-
inputSchema: {
|
|
301
|
+
inputSchema: {
|
|
302
|
+
id: z.string().describe("Listing id from search_korean_cars"),
|
|
303
|
+
lang: z.enum(["en", "ru", "de"]).optional().describe("Language of the spec, category and option names: en (default), ru = Russian, de = German"),
|
|
304
|
+
},
|
|
295
305
|
annotations: readOnly,
|
|
296
306
|
},
|
|
297
|
-
run(({ id }) => needKorea().vehicle(id, { lang: "en" }))
|
|
307
|
+
run(({ id, lang }) => needKorea().vehicle(id, { lang: lang || "en" }))
|
|
298
308
|
);
|
|
299
309
|
|
|
300
310
|
server.registerTool(
|