encarapi-mcp 1.2.1 → 1.4.0

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.
Files changed (3) hide show
  1. package/README.md +4 -1
  2. package/package.json +2 -2
  3. package/src/server.js +101 -1
package/README.md CHANGED
@@ -13,7 +13,10 @@
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, 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) |
17
+ | `search_korean_excavators` | Search Korean used excavators (maker, model, operating hours, weight class, region; Business/Scale key) |
18
+ | `search_korean_trucks` | Search Korean trucks, buses and special vehicles (body type, payload in tons, use, region; Business/Scale key) |
19
+ | `find_korean_car_by_vin` | All Encar / K Car listings of one VIN, incl. removed ones (Business/Scale key) |
17
20
  | `get_korean_car` | Full detail for one listing (specs, options, photos, price history, seller) |
18
21
  | `get_korean_inspection` | Official Korean inspection report |
19
22
  | `get_korean_accident_record` | Insurance accident history and ownership changes |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "encarapi-mcp",
3
- "version": "1.2.1",
3
+ "version": "1.4.0",
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",
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@modelcontextprotocol/sdk": "^1.32.0",
52
- "encarapi": "^1.0.0",
52
+ "encarapi": "^1.3.0",
53
53
  "zod": "^4.1.0",
54
54
  "express": "^5.2.1"
55
55
  }
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.2.1";
7
+ export const VERSION = "1.4.0";
8
8
  const MAX_TEXT = 40000;
9
9
 
10
10
  const asText = (data) => {
@@ -46,6 +46,8 @@ const koreaItem = (c) => ({
46
46
  transmission: c.Transmission,
47
47
  powerPs: c.PowerPs,
48
48
  color: c.Color,
49
+ region: c.Region || undefined,
50
+ city: c.City || undefined,
49
51
  duplicateOf: c.IsDuplicate ? c.DuplicateOf : undefined,
50
52
  url: c.Url,
51
53
  photo: firstPhoto(c.Photos),
@@ -162,6 +164,8 @@ export function createServer({ apiKey, chinaKey, fetchImpl, transport = "stdio",
162
164
  frame_clean: z.boolean().optional().describe("Only cars with an accident-free chassis frame"),
163
165
  no_damage_cost: z.boolean().optional().describe("Only cars with zero insurance-reported repair cost"),
164
166
  has_inspection: z.boolean().optional().describe("Only cars with an official inspection report"),
167
+ region: z.string().optional().describe("Seller region code, comma = OR: seoul, gyeonggi, incheon, busan, daegu, daejeon, ulsan, gwangju, sejong, gangwon, chungbuk, chungnam, jeonbuk, jeonnam, gyeongbuk, gyeongnam, jeju. Encar listings only: leave source unset"),
168
+ city: z.string().optional().describe("Seller city, e.g. suwon, gangnam (values in korean_filter_values -> city). Encar listings only: leave source unset"),
165
169
  sort: z.enum(["newest", "price_asc", "price_desc", "mileage_asc", "mileage_desc", "year_desc", "year_asc"]).optional(),
166
170
  limit: z.number().int().min(1).max(50).optional().describe("Results per page, default 10"),
167
171
  page: z.number().int().min(1).optional(),
@@ -174,6 +178,102 @@ export function createServer({ apiKey, chinaKey, fetchImpl, transport = "stdio",
174
178
  })
175
179
  );
176
180
 
181
+ server.registerTool(
182
+ "search_korean_trucks",
183
+ {
184
+ title: "Search Korean trucks and buses",
185
+ description:
186
+ "Search used trucks, buses and special vehicles in South Korea (Encar truck marketplace): cargo trucks " +
187
+ "(Porter, Bongo, Mighty, Xcient), wing bodies, dump and construction trucks, cranes, tankers, buses, campers. " +
188
+ "Prices are in 10,000 KRW. Needs a Business or Scale key (or a trial).",
189
+ inputSchema: {
190
+ form: z.string().optional().describe("Body type, comma = OR: cargo, wing_body, bus, dump_construction, crane, tank, camper, waste_transport, live_fish, tow_transport, tractor, trailer"),
191
+ manufacturer: z.string().optional().describe("Brand in English, e.g. Hyundai, Kia, Volvo"),
192
+ model: z.string().optional().describe("Substring of the Korean model name, e.g. 포터 (Porter), 봉고 (Bongo), 마이티 (Mighty)"),
193
+ min_tons: z.number().optional().describe("Minimum payload in tons"),
194
+ max_tons: z.number().optional().describe("Maximum payload in tons"),
195
+ use: z.enum(["private", "commercial", "other"]).optional().describe("Registration use"),
196
+ fuel: z.string().optional(),
197
+ transmission: z.string().optional(),
198
+ min_year: z.number().int().optional(),
199
+ max_year: z.number().int().optional(),
200
+ max_price: z.number().int().optional().describe("Maximum price in 10,000 KRW"),
201
+ max_mileage: z.number().int().optional().describe("Maximum mileage in km"),
202
+ region: z.string().optional().describe("Region code, e.g. gyeonggi, busan"),
203
+ sort: z.enum(["newest", "price_asc", "price_desc", "mileage_asc", "mileage_desc", "year_desc", "year_asc"]).optional(),
204
+ limit: z.number().int().min(1).max(50).optional().describe("Results per page, default 10"),
205
+ page: z.number().int().min(1).optional(),
206
+ },
207
+ annotations: readOnly,
208
+ },
209
+ run(async (args) => {
210
+ const res = await needKorea().trucks({ ...args, limit: args.limit || 10, lang: "en", count: true });
211
+ return {
212
+ total: res.Count,
213
+ page: args.page || 1,
214
+ results: (res.SearchResults || []).map((c) => ({
215
+ id: c.Id, make: c.Manufacturer, model: c.Model, trim: c.Badge, bodyType: c.FormEnglish || c.Form,
216
+ bodyDetail: c.FormDetail, payloadTons: c.CapacityTons ?? undefined, use: c.UseEnglish || c.Use,
217
+ year: c.Year, priceKRW: typeof c.Price === "number" ? c.Price * 10000 : undefined, mileageKm: c.Mileage,
218
+ fuel: c.FuelTypeEnglish || c.FuelType, transmission: c.TransmissionEnglish || c.Transmission,
219
+ region: c.Region || undefined, url: c.Url, photo: firstPhoto(c.Photos),
220
+ })),
221
+ };
222
+ })
223
+ );
224
+
225
+ server.registerTool(
226
+ "search_korean_excavators",
227
+ {
228
+ title: "Search Korean used excavators",
229
+ description:
230
+ "Search used excavators in South Korea (굴삭기나라 / direct-nara.co.kr, Korea's construction-equipment " +
231
+ "marketplace): crawler and wheeled excavators with maker, model, year, operating hours, " +
232
+ "weight class, region and price. Needs a Business or Scale key (or a trial). Export-control rules for " +
233
+ "construction machinery are the exporter's responsibility.",
234
+ inputSchema: {
235
+ maker: z.string().optional().describe("Maker in English, e.g. Doosan (Develon), HD Hyundai, Volvo, Kubota, Kobelco"),
236
+ model: z.string().optional().describe("Model or title substring, e.g. DX55, HX60"),
237
+ sub_type: z.enum(["crawler", "wheel"]).optional(),
238
+ weight_class: z.string().optional().describe("Weight class code, e.g. EXC_CR_LE_6_5 (02 class crawler), EXC_TIRE_LE_17 (06W wheeled)"),
239
+ min_year: z.number().int().optional(),
240
+ max_hours: z.number().int().optional().describe("Maximum operating hours"),
241
+ max_price: z.number().int().optional().describe("Maximum price in 10,000 KRW"),
242
+ region: z.string().optional().describe("Region code, e.g. gyeonggi"),
243
+ sort: z.enum(["newest", "price_asc", "price_desc", "hours_asc", "year_desc", "year_asc"]).optional(),
244
+ limit: z.number().int().min(1).max(50).optional().describe("Results per page, default 10"),
245
+ page: z.number().int().min(1).optional(),
246
+ },
247
+ annotations: readOnly,
248
+ },
249
+ run(async (args) => {
250
+ const res = await needKorea().equipment({ ...args, limit: args.limit || 10, count: true });
251
+ return {
252
+ total: res.Count,
253
+ page: args.page || 1,
254
+ results: (res.SearchResults || []).map((c) => ({
255
+ id: c.Id, title: c.Title, maker: c.MakerEnglish || c.Maker, model: c.Model || undefined, year: c.Year,
256
+ hours: c.Hours ?? undefined, type: c.SubType || undefined, weightClass: c.WeightClassLabel || undefined,
257
+ priceKRW: c.PriceKRW ?? undefined, region: c.Region || undefined, city: c.City || undefined,
258
+ sold: c.Sold || undefined, url: c.Url, photo: (c.Photos || [])[0],
259
+ })),
260
+ };
261
+ })
262
+ );
263
+
264
+ server.registerTool(
265
+ "find_korean_car_by_vin",
266
+ {
267
+ title: "Find a Korean car by VIN",
268
+ description:
269
+ "Every Encar and K Car listing of one VIN, active and removed - the listing history of one vehicle " +
270
+ "(relists, earlier prices). Use the returned id with get_korean_car for full details. Needs a Business or Scale key (or a trial).",
271
+ inputSchema: { vin: z.string().describe("17-character VIN") },
272
+ annotations: readOnly,
273
+ },
274
+ run(async ({ vin }) => needKorea().vehicleByVin(vin))
275
+ );
276
+
177
277
  server.registerTool(
178
278
  "get_korean_car",
179
279
  {