@fleetx_io/fleetx-mcp-server 1.1.0 → 1.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 +129 -16
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcpServer.d.ts +2 -1
- package/dist/mcpServer.d.ts.map +1 -1
- package/dist/mcpServer.js +30 -5
- package/dist/mcpServer.js.map +1 -1
- package/dist/utils.d.ts +4 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +6 -0
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,10 +10,25 @@ An MCP (Model Context Protocol) server that gives AI agents access to the FleetX
|
|
|
10
10
|
## How it Works
|
|
11
11
|
|
|
12
12
|
1. Your AI agent (Cursor, Claude Desktop, Windsurf, etc.) launches this server as a subprocess.
|
|
13
|
-
2. The agent calls the `login` tool
|
|
14
|
-
3.
|
|
15
|
-
4.
|
|
16
|
-
|
|
13
|
+
2. The server authenticates — either automatically via credentials in the config, or when the agent calls the `login` tool.
|
|
14
|
+
3. After authentication, all available API definitions are fetched and registered as MCP tools with validated inputs.
|
|
15
|
+
4. The agent can now call any FleetX API — the server handles auth, validation, and proxying automatically.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Authentication
|
|
20
|
+
|
|
21
|
+
There are two ways to authenticate:
|
|
22
|
+
|
|
23
|
+
### Option 1: Auto-login via environment variables (recommended)
|
|
24
|
+
|
|
25
|
+
Pass `USERNAME` and `PASSWORD` in the MCP config. The server logs in at startup and all tools are available immediately — no manual login step needed.
|
|
26
|
+
|
|
27
|
+
### Option 2: Login via chat
|
|
28
|
+
|
|
29
|
+
If no credentials are provided in the config, only the `login` tool is exposed initially. Ask your AI agent to call it with your FleetX credentials, and the remaining tools will be registered dynamically.
|
|
30
|
+
|
|
31
|
+
> The `login` tool is always available regardless of which option you use, so you can re-authenticate or switch accounts at any time.
|
|
17
32
|
|
|
18
33
|
---
|
|
19
34
|
|
|
@@ -40,7 +55,40 @@ fleetx-mcp-server
|
|
|
40
55
|
|
|
41
56
|
Add to `.cursor/mcp.json` in your project root:
|
|
42
57
|
|
|
43
|
-
**
|
|
58
|
+
**With auto-login (recommended):**
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"mcpServers": {
|
|
63
|
+
"fleetx": {
|
|
64
|
+
"command": "npx",
|
|
65
|
+
"args": ["-y", "@fleetx_io/fleetx-mcp-server"],
|
|
66
|
+
"env": {
|
|
67
|
+
"USERNAME": "your_fleetx_username",
|
|
68
|
+
"PASSWORD": "your_fleetx_password"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**With global install + auto-login:**
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"mcpServers": {
|
|
80
|
+
"fleetx": {
|
|
81
|
+
"command": "fleetx-mcp-server",
|
|
82
|
+
"env": {
|
|
83
|
+
"USERNAME": "your_fleetx_username",
|
|
84
|
+
"PASSWORD": "your_fleetx_password"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Without auto-login (login via chat):**
|
|
44
92
|
|
|
45
93
|
```json
|
|
46
94
|
{
|
|
@@ -53,7 +101,7 @@ Add to `.cursor/mcp.json` in your project root:
|
|
|
53
101
|
}
|
|
54
102
|
```
|
|
55
103
|
|
|
56
|
-
**
|
|
104
|
+
**With global install, without auto-login:**
|
|
57
105
|
|
|
58
106
|
```json
|
|
59
107
|
{
|
|
@@ -74,7 +122,40 @@ Add to your `claude_desktop_config.json`:
|
|
|
74
122
|
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
75
123
|
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
76
124
|
|
|
77
|
-
**
|
|
125
|
+
**With auto-login (recommended):**
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"mcpServers": {
|
|
130
|
+
"fleetx": {
|
|
131
|
+
"command": "npx",
|
|
132
|
+
"args": ["-y", "@fleetx_io/fleetx-mcp-server"],
|
|
133
|
+
"env": {
|
|
134
|
+
"USERNAME": "your_fleetx_username",
|
|
135
|
+
"PASSWORD": "your_fleetx_password"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**With global install + auto-login:**
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"mcpServers": {
|
|
147
|
+
"fleetx": {
|
|
148
|
+
"command": "fleetx-mcp-server",
|
|
149
|
+
"env": {
|
|
150
|
+
"USERNAME": "your_fleetx_username",
|
|
151
|
+
"PASSWORD": "your_fleetx_password"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Without auto-login (login via chat):**
|
|
78
159
|
|
|
79
160
|
```json
|
|
80
161
|
{
|
|
@@ -87,7 +168,7 @@ Add to your `claude_desktop_config.json`:
|
|
|
87
168
|
}
|
|
88
169
|
```
|
|
89
170
|
|
|
90
|
-
**
|
|
171
|
+
**With global install, without auto-login:**
|
|
91
172
|
|
|
92
173
|
```json
|
|
93
174
|
{
|
|
@@ -103,7 +184,40 @@ Add to your `claude_desktop_config.json`:
|
|
|
103
184
|
|
|
104
185
|
Add to your Windsurf MCP config:
|
|
105
186
|
|
|
106
|
-
**
|
|
187
|
+
**With auto-login (recommended):**
|
|
188
|
+
|
|
189
|
+
```json
|
|
190
|
+
{
|
|
191
|
+
"mcpServers": {
|
|
192
|
+
"fleetx": {
|
|
193
|
+
"command": "npx",
|
|
194
|
+
"args": ["-y", "@fleetx_io/fleetx-mcp-server"],
|
|
195
|
+
"env": {
|
|
196
|
+
"USERNAME": "your_fleetx_username",
|
|
197
|
+
"PASSWORD": "your_fleetx_password"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**With global install + auto-login:**
|
|
205
|
+
|
|
206
|
+
```json
|
|
207
|
+
{
|
|
208
|
+
"mcpServers": {
|
|
209
|
+
"fleetx": {
|
|
210
|
+
"command": "fleetx-mcp-server",
|
|
211
|
+
"env": {
|
|
212
|
+
"USERNAME": "your_fleetx_username",
|
|
213
|
+
"PASSWORD": "your_fleetx_password"
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**Without auto-login (login via chat):**
|
|
107
221
|
|
|
108
222
|
```json
|
|
109
223
|
{
|
|
@@ -116,7 +230,7 @@ Add to your Windsurf MCP config:
|
|
|
116
230
|
}
|
|
117
231
|
```
|
|
118
232
|
|
|
119
|
-
**
|
|
233
|
+
**With global install, without auto-login:**
|
|
120
234
|
|
|
121
235
|
```json
|
|
122
236
|
{
|
|
@@ -132,12 +246,10 @@ Add to your Windsurf MCP config:
|
|
|
132
246
|
|
|
133
247
|
## Usage
|
|
134
248
|
|
|
135
|
-
Once connected
|
|
136
|
-
|
|
137
|
-
1. **Log in:** _"Log in to FleetX with username X and password Y"_
|
|
138
|
-
2. **Use any tool:** _"Show me all vehicles"_, _"Create a new job"_, _"Get trip history for vehicle KA01AB1234"_
|
|
249
|
+
Once connected:
|
|
139
250
|
|
|
140
|
-
|
|
251
|
+
- **If you used auto-login:** All FleetX tools are ready immediately. Just ask _"Show me all vehicles"_ or _"Get trip history for vehicle KA01AB1234"_.
|
|
252
|
+
- **If you didn't pass credentials:** Ask the agent to _"Log in to FleetX with username X and password Y"_ first. After login, all tools become available.
|
|
141
253
|
|
|
142
254
|
### Available Tools (after login)
|
|
143
255
|
|
|
@@ -160,7 +272,8 @@ The full list depends on your account's enabled APIs.
|
|
|
160
272
|
|
|
161
273
|
## Security
|
|
162
274
|
|
|
163
|
-
- Credentials are
|
|
275
|
+
- Credentials passed via `env` are held only as process environment variables — never logged or stored on disk.
|
|
276
|
+
- Credentials are sent only to the FleetX login endpoint.
|
|
164
277
|
- The access token is held in memory for the session duration and never exposed in tool responses.
|
|
165
278
|
- Token is automatically cleared on 401/403 errors, requiring re-login.
|
|
166
279
|
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { createTokenStore } from "./auth.js";
|
|
|
6
6
|
import { log } from "./utils.js";
|
|
7
7
|
async function main() {
|
|
8
8
|
const tokenStore = createTokenStore();
|
|
9
|
-
const server = createMcpServer(tokenStore);
|
|
9
|
+
const server = await createMcpServer(tokenStore);
|
|
10
10
|
const transport = new StdioServerTransport();
|
|
11
11
|
await server.connect(transport);
|
|
12
12
|
log("Running on stdio");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,oCAAoC;AAEpC,OAAO,EACL,oBAAoB,EACrB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,KAAK,UAAU,IAAI;IACjB,MAAM,UAAU,GAAG,gBAAgB,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,oCAAoC;AAEpC,OAAO,EACL,oBAAoB,EACrB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,KAAK,UAAU,IAAI;IACjB,MAAM,UAAU,GAAG,gBAAgB,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAE7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,GAAG,CAAC,kBAAkB,CAAC,CAAC;AAC1B,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,GAAG,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/mcpServer.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
2
2
|
import { TokenStore } from "./types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Creates and configures the McpServer instance with login + dynamic tools.
|
|
5
|
+
* If USERNAME and PASSWORD env vars are set, auto-login and register all tools at startup.
|
|
5
6
|
*/
|
|
6
|
-
export declare function createMcpServer(tokenStore: TokenStore): McpServer
|
|
7
|
+
export declare function createMcpServer(tokenStore: TokenStore): Promise<McpServer>;
|
|
7
8
|
//# sourceMappingURL=mcpServer.d.ts.map
|
package/dist/mcpServer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpServer.d.ts","sourceRoot":"","sources":["../src/mcpServer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACV,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,UAAU,EAAiB,MAAM,YAAY,CAAC;AAMvD
|
|
1
|
+
{"version":3,"file":"mcpServer.d.ts","sourceRoot":"","sources":["../src/mcpServer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACV,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,UAAU,EAAiB,MAAM,YAAY,CAAC;AAMvD;;;GAGG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAmChF"}
|
package/dist/mcpServer.js
CHANGED
|
@@ -3,13 +3,37 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
3
3
|
import { login } from "./auth.js";
|
|
4
4
|
import { fetchApiDefinitions } from "./apiDiscovery.js";
|
|
5
5
|
import { generateTools } from "./toolGenerator.js";
|
|
6
|
-
import { log, getLoginURL, getAPIDefinitionURL } from "./utils.js";
|
|
6
|
+
import { log, getLoginURL, getAPIDefinitionURL, getUsernameLoginDetails } from "./utils.js";
|
|
7
7
|
/**
|
|
8
8
|
* Creates and configures the McpServer instance with login + dynamic tools.
|
|
9
|
+
* If USERNAME and PASSWORD env vars are set, auto-login and register all tools at startup.
|
|
9
10
|
*/
|
|
10
|
-
export function createMcpServer(tokenStore) {
|
|
11
|
-
const mcp = new McpServer({ name: "fleetx-mcp-server", version: "1.
|
|
11
|
+
export async function createMcpServer(tokenStore) {
|
|
12
|
+
const mcp = new McpServer({ name: "fleetx-mcp-server", version: "1.1.0" }, { capabilities: { tools: { listChanged: true } } });
|
|
12
13
|
registerLoginTool(mcp, tokenStore);
|
|
14
|
+
const { username, password } = getUsernameLoginDetails();
|
|
15
|
+
log(`Username: ${username}`);
|
|
16
|
+
if (username && password) {
|
|
17
|
+
log("Auto-login: USERNAME and PASSWORD found in environment");
|
|
18
|
+
try {
|
|
19
|
+
const loginResult = await login(getLoginURL(), username, password, tokenStore);
|
|
20
|
+
if (!loginResult.success) {
|
|
21
|
+
log("Auto-login failed:", loginResult.message);
|
|
22
|
+
return mcp;
|
|
23
|
+
}
|
|
24
|
+
log("Auto-login succeeded");
|
|
25
|
+
const discoveryResult = await fetchApiDefinitions(getAPIDefinitionURL(), tokenStore);
|
|
26
|
+
if (!discoveryResult.success) {
|
|
27
|
+
log("Auto-discovery failed:", discoveryResult.message);
|
|
28
|
+
return mcp;
|
|
29
|
+
}
|
|
30
|
+
const toolNames = registerDynamicTools(mcp, discoveryResult.definitions, tokenStore);
|
|
31
|
+
log(`Auto-registered ${toolNames.length} tool(s) at startup`);
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
log("Auto-login error:", err);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
13
37
|
return mcp;
|
|
14
38
|
}
|
|
15
39
|
function registerLoginTool(mcp, tokenStore) {
|
|
@@ -67,17 +91,18 @@ function registerDynamicTools(mcp, definitions, tokenStore) {
|
|
|
67
91
|
for (const tool of tools) {
|
|
68
92
|
if (tool.name === "login")
|
|
69
93
|
continue;
|
|
94
|
+
const toolName = tool.name.length > 64 ? tool.name.slice(0, 64) : tool.name;
|
|
70
95
|
const shape = {};
|
|
71
96
|
for (const [key, propSchema] of Object.entries(tool.inputSchema.properties)) {
|
|
72
97
|
shape[key] = jsonSchemaPropertyToZod(propSchema, tool.inputSchema.required.includes(key));
|
|
73
98
|
}
|
|
74
99
|
try {
|
|
75
|
-
const registered = mcp.tool(
|
|
100
|
+
const registered = mcp.tool(toolName, tool.description, shape, async (args) => {
|
|
76
101
|
const result = await tool.handler(args);
|
|
77
102
|
return result;
|
|
78
103
|
});
|
|
79
104
|
registeredDynamicTools.push(registered);
|
|
80
|
-
registeredNames.push(
|
|
105
|
+
registeredNames.push(toolName);
|
|
81
106
|
}
|
|
82
107
|
catch (err) {
|
|
83
108
|
log(`Failed to register tool "${tool.name}":`, err);
|
package/dist/mcpServer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpServer.js","sourceRoot":"","sources":["../src/mcpServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,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AmB,EAAE,CAAC;IAC5B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;IAC1C,CAAC;IAED,GAAG,CAAC,cAAc,eAAe,CAAC,MAAM,qBAAqB,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3F,OAAO,eAAe,CAAC;AACzB,CAAC;AAED;;;GAGG;AACH,SAAS,uBAAuB,CAAC,IAAY,EAAE,QAAiB;IAC9D,MAAM,CAAC,GAAG,IAA+B,CAAC;IAC1C,IAAI,MAAoB,CAAC;IAEzB,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QACf,KAAK,SAAS;YACZ,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC;YACrB,MAAM;QACR,KAAK,QAAQ;YACX,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;YACpB,MAAM;QACR,KAAK,OAAO;YACV,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;YAC7B,MAAM;QACR,KAAK,QAAQ,CAAC;QACd;YACE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;YACpB,MAAM;IACV,CAAC;IAED,IAAI,OAAO,CAAC,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QACtC,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC/C,CAAC"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -5,4 +5,8 @@
|
|
|
5
5
|
export declare function log(...args: unknown[]): void;
|
|
6
6
|
export declare function getAPIDefinitionURL(): string;
|
|
7
7
|
export declare function getLoginURL(): string;
|
|
8
|
+
export declare function getUsernameLoginDetails(): {
|
|
9
|
+
username: string;
|
|
10
|
+
password: string;
|
|
11
|
+
};
|
|
8
12
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,QAGrC;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,wBAAgB,uBAAuB,IAAI;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAKhF"}
|
package/dist/utils.js
CHANGED
|
@@ -12,4 +12,10 @@ export function getAPIDefinitionURL() {
|
|
|
12
12
|
export function getLoginURL() {
|
|
13
13
|
return process.env.LOGIN_URL ?? "https://api.fleetx.io/api/v1/login";
|
|
14
14
|
}
|
|
15
|
+
export function getUsernameLoginDetails() {
|
|
16
|
+
return {
|
|
17
|
+
username: process.env.USERNAME ?? process.env.FLEETX_USERNAME ?? "",
|
|
18
|
+
password: process.env.PASSWORD ?? process.env.FLEETX_PASSWORD ?? "",
|
|
19
|
+
};
|
|
20
|
+
}
|
|
15
21
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,GAAG,CAAC,GAAG,IAAe;IACpC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EA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|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "MCP server that gives AI agents access to the FleetX REST API. Works with Cursor, Claude Desktop, Windsurf, and any MCP-compatible client.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|