@motorbay/mcp 0.1.0 → 0.1.1
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 +4 -1
- package/dist/capabilities.js +4 -4
- package/dist/tools.js +2 -10
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @motorbay/mcp
|
|
2
2
|
|
|
3
|
+
[npm: @motorbay/mcp](https://www.npmjs.com/package/@motorbay/mcp)
|
|
4
|
+
|
|
3
5
|
A Model Context Protocol (MCP) server for the [Motorbay API](https://app.motorbay.app). It lets an AI assistant look up Danish vehicles by registration number, VIN or id, and read their inspection, technical details, engine, environmental data, fuel types, equipment and usages.
|
|
4
6
|
|
|
5
7
|
The data comes from Motorstyrelsen's public weekly extract of the Danish Motor Register (DMR) and is updated weekly. Motorbay is not affiliated with Motorstyrelsen, and the data is provided as-is. It holds no owner or keeper information.
|
|
@@ -104,10 +106,11 @@ Do not commit a real key to a repository.
|
|
|
104
106
|
| `list_vehicle_equipment` | Registered equipment |
|
|
105
107
|
| `list_vehicle_secondary_usages` | Secondary usages, e.g. rental |
|
|
106
108
|
| `search_vehicles` | Search by plate history, make, kind, usage, color, model year |
|
|
109
|
+
| `check_vehicle` | Used-car check: status, blocks, damage, leasing, latest inspection, flags |
|
|
107
110
|
|
|
108
111
|
All tools are read-only. Results are compact JSON as the API returns it. When the register has no engine, inspection or environmental record, the tool returns `{"found": false, ...}` instead of an error.
|
|
109
112
|
|
|
110
|
-
|
|
113
|
+
The server reads the API's OpenAPI document at start-up and offers only the tools whose endpoints that API serves.
|
|
111
114
|
|
|
112
115
|
## Errors
|
|
113
116
|
|
package/dist/capabilities.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Reads the API's OpenAPI document to find which paths exist, so
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* then show
|
|
2
|
+
* Reads the API's OpenAPI document to find which paths exist, so a tool is
|
|
3
|
+
* offered only when the API it talks to serves its path (an older or
|
|
4
|
+
* self-hosted API may not). Returns null if the document can't be read;
|
|
5
|
+
* callers then show every tool.
|
|
6
6
|
*/
|
|
7
7
|
export async function fetchAvailablePaths(baseUrl, fetchImpl = fetch) {
|
|
8
8
|
try {
|
package/dist/tools.js
CHANGED
|
@@ -99,21 +99,13 @@ export const TOOLS = [
|
|
|
99
99
|
pageSize,
|
|
100
100
|
},
|
|
101
101
|
},
|
|
102
|
-
// ---- Planned endpoints ------------------------------------------------
|
|
103
|
-
// Offered only once the live OpenAPI document lists the path. Check the
|
|
104
|
-
// path and parameter names against the OpenAPI document when they ship.
|
|
105
102
|
{
|
|
106
103
|
name: "check_vehicle",
|
|
107
104
|
title: "Used-car check",
|
|
108
105
|
path: "/v1/vehicles/{vehicleId}/check",
|
|
109
|
-
|
|
110
|
-
description: "Run a used-car risk check on a vehicle by its Motorbay id and return the findings.",
|
|
106
|
+
description: "Run a used-car risk check on a vehicle by its Motorbay id: registration status, blocks, traffic damage, restamped VIN, active leasing, latest inspection, and flags with a severity, the most serious first. It reflects the latest weekly extract, so no flags is not a guarantee.",
|
|
111
107
|
input: { vehicleId },
|
|
112
108
|
},
|
|
113
|
-
// Blocks, permits and leasing go here, one entry each, e.g.:
|
|
114
|
-
// { name: "list_vehicle_blocks", title: "Blocks", path: "/v1/vehicles/{vehicleId}/blocks", planned: true, description: "...", input: { vehicleId, page, pageSize } },
|
|
115
|
-
// { name: "list_vehicle_permits", title: "Permits", path: "/v1/vehicles/{vehicleId}/permits", planned: true, description: "...", input: { vehicleId, page, pageSize } },
|
|
116
|
-
// { name: "get_vehicle_leasing", title: "Leasing", path: "/v1/vehicles/{vehicleId}/leasing", planned: true, description: "...", input: { vehicleId } },
|
|
117
109
|
];
|
|
118
110
|
/** Fills `{name}` placeholders from args and returns the rest as query parameters. */
|
|
119
111
|
export function buildRequest(path, args) {
|
|
@@ -129,5 +121,5 @@ export function buildRequest(path, args) {
|
|
|
129
121
|
return { path: filled, query };
|
|
130
122
|
}
|
|
131
123
|
export function availableTools(paths) {
|
|
132
|
-
return TOOLS.filter((t) =>
|
|
124
|
+
return paths ? TOOLS.filter((t) => paths.has(t.path)) : TOOLS;
|
|
133
125
|
}
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.1.
|
|
1
|
+
export const VERSION = "0.1.1";
|