@robinmordasiewicz/f5xc-api-mcp 1.0.84-2601020629 → 1.0.91-2601030015
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/CHANGELOG.md +1 -1
- package/README.md +73 -4
- package/dist/http-server.d.ts +58 -0
- package/dist/http-server.d.ts.map +1 -0
- package/dist/http-server.js +227 -0
- package/dist/http-server.js.map +1 -0
- package/dist/index.js +40 -6
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +16 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +47 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/generated/ai_services/index.d.ts +8 -0
- package/dist/tools/generated/ai_services/index.d.ts.map +1 -0
- package/dist/tools/generated/ai_services/index.js +1019 -0
- package/dist/tools/generated/ai_services/index.js.map +1 -0
- package/dist/tools/generated/dependency-graph.json +210 -210
- package/dist/tools/registry.js +2 -2
- package/dist/tools/registry.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -23,7 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
23
23
|
- API token authentication support
|
|
24
24
|
- P12 certificate (mTLS) authentication support
|
|
25
25
|
- Automatic URL normalization for various F5XC URL formats
|
|
26
|
-
-
|
|
26
|
+
- xcsh CLI command equivalents in every response
|
|
27
27
|
- Terraform HCL examples in every response
|
|
28
28
|
- MCP Resources for F5XC configuration objects via URI scheme
|
|
29
29
|
- Workflow prompts for common operations:
|
package/README.md
CHANGED
|
@@ -10,10 +10,11 @@ other MCP-compatible tools.
|
|
|
10
10
|
## Features
|
|
11
11
|
|
|
12
12
|
- **1500+ API Tools** - Complete coverage of F5XC API operations across 23 enriched domains
|
|
13
|
+
- **Dual Transport** - STDIO for Claude/VS Code, HTTP/SSE for vLLM and web clients
|
|
13
14
|
- **Domain-Based Documentation** - Tools organized by domains with intelligent 2-level and
|
|
14
15
|
3-level hierarchical navigation
|
|
15
16
|
- **Dual-Mode Operation** - Works without authentication (documentation mode) AND with authentication (execution mode)
|
|
16
|
-
- **
|
|
17
|
+
- **xcsh Integration** - Every response includes equivalent CLI commands
|
|
17
18
|
- **Terraform Examples** - Every response includes Terraform HCL examples
|
|
18
19
|
- **Multiple Auth Methods** - API token and P12 certificate (mTLS) support
|
|
19
20
|
- **URL Normalization** - Automatically handles various F5XC URL formats
|
|
@@ -40,6 +41,74 @@ f5xc-api-mcp
|
|
|
40
41
|
docker run -i --rm ghcr.io/robinmordasiewicz/f5xc-api-mcp
|
|
41
42
|
```
|
|
42
43
|
|
|
44
|
+
## Transport Modes
|
|
45
|
+
|
|
46
|
+
The server supports two transport modes for different integration scenarios:
|
|
47
|
+
|
|
48
|
+
### STDIO Mode (Default)
|
|
49
|
+
|
|
50
|
+
Standard input/output transport for Claude Desktop, Claude CLI, and VS Code extensions.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
f5xc-api-mcp
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### HTTP/SSE Mode
|
|
57
|
+
|
|
58
|
+
HTTP transport with Server-Sent Events for vLLM servers, web-based clients, and private LLM utilities.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Start HTTP server on default port 3000
|
|
62
|
+
f5xc-api-mcp --http
|
|
63
|
+
|
|
64
|
+
# Custom port
|
|
65
|
+
f5xc-api-mcp --http --port 8080
|
|
66
|
+
|
|
67
|
+
# Bind to localhost only
|
|
68
|
+
f5xc-api-mcp --http --host 127.0.0.1 --port 3000
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### HTTP Endpoints
|
|
72
|
+
|
|
73
|
+
| Endpoint | Method | Description |
|
|
74
|
+
|----------|--------|-------------|
|
|
75
|
+
| `/mcp` | POST | JSON-RPC request endpoint |
|
|
76
|
+
| `/mcp` | GET | SSE streaming endpoint (requires session) |
|
|
77
|
+
| `/mcp` | DELETE | Session termination |
|
|
78
|
+
| `/health` | GET | Health check endpoint |
|
|
79
|
+
|
|
80
|
+
#### Docker with HTTP Mode
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
docker run -p 3000:3000 ghcr.io/robinmordasiewicz/f5xc-api-mcp --http --port 3000
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Or with docker-compose:
|
|
87
|
+
|
|
88
|
+
```yaml
|
|
89
|
+
services:
|
|
90
|
+
f5xc-mcp:
|
|
91
|
+
image: ghcr.io/robinmordasiewicz/f5xc-api-mcp
|
|
92
|
+
command: ["--http", "--port", "3000"]
|
|
93
|
+
ports:
|
|
94
|
+
- "3000:3000"
|
|
95
|
+
environment:
|
|
96
|
+
- F5XC_API_URL=https://tenant.console.ves.volterra.io
|
|
97
|
+
- F5XC_API_TOKEN=${F5XC_API_TOKEN}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Testing HTTP Mode
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Health check
|
|
104
|
+
curl http://localhost:3000/health
|
|
105
|
+
|
|
106
|
+
# Initialize session and send JSON-RPC request
|
|
107
|
+
curl -X POST http://localhost:3000/mcp \
|
|
108
|
+
-H "Content-Type: application/json" \
|
|
109
|
+
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
|
|
110
|
+
```
|
|
111
|
+
|
|
43
112
|
## Configuration
|
|
44
113
|
|
|
45
114
|
### Claude Desktop
|
|
@@ -211,11 +280,11 @@ When no credentials are provided, the server provides:
|
|
|
211
280
|
- OpenAPI specification documentation
|
|
212
281
|
- API operation explanations
|
|
213
282
|
- Parameter descriptions and validation
|
|
214
|
-
-
|
|
283
|
+
- xcsh command equivalents
|
|
215
284
|
- Terraform HCL examples
|
|
216
285
|
- JSON request templates
|
|
217
286
|
|
|
218
|
-
This mode is ideal for users who authenticate via
|
|
287
|
+
This mode is ideal for users who authenticate via xcsh or Terraform.
|
|
219
288
|
|
|
220
289
|
### Execution Mode (With Authentication)
|
|
221
290
|
|
|
@@ -377,7 +446,7 @@ wildcards only match a single subdomain level, not two levels (`tenant.staging`)
|
|
|
377
446
|
|
|
378
447
|
**Error Example:**
|
|
379
448
|
|
|
380
|
-
```
|
|
449
|
+
```text
|
|
381
450
|
Hostname/IP does not match certificate's altnames:
|
|
382
451
|
Host: tenant.staging.console.ves.volterra.io
|
|
383
452
|
Cert covers: DNS:*.console.ves.volterra.io, DNS:console.ves.volterra.io
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP/SSE Transport Server for F5XC API MCP
|
|
3
|
+
*
|
|
4
|
+
* Provides HTTP-based transport for MCP communication, enabling
|
|
5
|
+
* integration with vLLM servers and other HTTP-based AI clients.
|
|
6
|
+
*
|
|
7
|
+
* Endpoints:
|
|
8
|
+
* - POST /mcp - JSON-RPC request endpoint
|
|
9
|
+
* - GET /mcp - SSE streaming endpoint
|
|
10
|
+
* - DELETE /mcp - Session termination
|
|
11
|
+
*/
|
|
12
|
+
import type { Server } from "node:http";
|
|
13
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
14
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
15
|
+
/**
|
|
16
|
+
* HTTP server configuration options
|
|
17
|
+
*/
|
|
18
|
+
export interface HttpServerOptions {
|
|
19
|
+
/** Port to listen on (default: 3000) */
|
|
20
|
+
port?: number;
|
|
21
|
+
/** Host/IP to bind to (default: 0.0.0.0) */
|
|
22
|
+
host?: string;
|
|
23
|
+
/** Enable session management (default: true) */
|
|
24
|
+
enableSessions?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* HTTP server result containing server and transport instances
|
|
28
|
+
*/
|
|
29
|
+
export interface HttpServerResult {
|
|
30
|
+
/** The HTTP server instance */
|
|
31
|
+
server: Server;
|
|
32
|
+
/** The MCP transport instance */
|
|
33
|
+
transport: StreamableHTTPServerTransport;
|
|
34
|
+
/** The bound address */
|
|
35
|
+
address: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Setup HTTP server with MCP transport
|
|
39
|
+
*
|
|
40
|
+
* Creates an Express server with proper MCP endpoints for:
|
|
41
|
+
* - POST /mcp: Handle JSON-RPC requests
|
|
42
|
+
* - GET /mcp: Establish SSE stream for server-to-client messages
|
|
43
|
+
* - DELETE /mcp: Terminate session
|
|
44
|
+
*
|
|
45
|
+
* @param mcpServer - The MCP server instance to connect
|
|
46
|
+
* @param options - Server configuration options
|
|
47
|
+
* @returns Promise resolving to server and transport instances
|
|
48
|
+
*/
|
|
49
|
+
export declare function setupHttpServer(mcpServer: McpServer, options?: HttpServerOptions): Promise<HttpServerResult>;
|
|
50
|
+
/**
|
|
51
|
+
* Cleanup all active sessions
|
|
52
|
+
*/
|
|
53
|
+
export declare function cleanupSessions(): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Get current session count
|
|
56
|
+
*/
|
|
57
|
+
export declare function getSessionCount(): number;
|
|
58
|
+
//# sourceMappingURL=http-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,SAAS,EAAE,6BAA6B,CAAC;IACzC,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AA4DD;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,SAAS,EACpB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,gBAAgB,CAAC,CA0I3B;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAUrD;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP/SSE Transport Server for F5XC API MCP
|
|
3
|
+
*
|
|
4
|
+
* Provides HTTP-based transport for MCP communication, enabling
|
|
5
|
+
* integration with vLLM servers and other HTTP-based AI clients.
|
|
6
|
+
*
|
|
7
|
+
* Endpoints:
|
|
8
|
+
* - POST /mcp - JSON-RPC request endpoint
|
|
9
|
+
* - GET /mcp - SSE streaming endpoint
|
|
10
|
+
* - DELETE /mcp - Session termination
|
|
11
|
+
*/
|
|
12
|
+
import express from "express";
|
|
13
|
+
import { randomUUID } from "node:crypto";
|
|
14
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
15
|
+
import { logger } from "./utils/logging.js";
|
|
16
|
+
/**
|
|
17
|
+
* Session store for managing active MCP sessions
|
|
18
|
+
*/
|
|
19
|
+
const sessions = new Map();
|
|
20
|
+
/**
|
|
21
|
+
* Create and configure the Express app with MCP endpoints
|
|
22
|
+
*/
|
|
23
|
+
function createMcpApp(host) {
|
|
24
|
+
const app = express();
|
|
25
|
+
// JSON body parsing with size limit
|
|
26
|
+
app.use(express.json({ limit: "10mb" }));
|
|
27
|
+
// DNS rebinding protection for localhost
|
|
28
|
+
if (host === "127.0.0.1" || host === "localhost") {
|
|
29
|
+
app.use((req, res, next) => {
|
|
30
|
+
const hostHeader = req.headers.host;
|
|
31
|
+
if (hostHeader) {
|
|
32
|
+
const hostname = hostHeader.split(":")[0];
|
|
33
|
+
if (hostname !== "127.0.0.1" && hostname !== "localhost") {
|
|
34
|
+
res.status(403).json({
|
|
35
|
+
jsonrpc: "2.0",
|
|
36
|
+
error: {
|
|
37
|
+
code: -32600,
|
|
38
|
+
message: "Forbidden: DNS rebinding protection",
|
|
39
|
+
},
|
|
40
|
+
id: null,
|
|
41
|
+
});
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
next();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
// CORS headers for cross-origin requests
|
|
49
|
+
app.use((_req, res, next) => {
|
|
50
|
+
res.header("Access-Control-Allow-Origin", "*");
|
|
51
|
+
res.header("Access-Control-Allow-Methods", "GET, POST, DELETE, OPTIONS");
|
|
52
|
+
res.header("Access-Control-Allow-Headers", "Content-Type, mcp-session-id");
|
|
53
|
+
res.header("Access-Control-Expose-Headers", "mcp-session-id");
|
|
54
|
+
next();
|
|
55
|
+
});
|
|
56
|
+
// Handle preflight requests
|
|
57
|
+
app.options("/mcp", (_req, res) => {
|
|
58
|
+
res.sendStatus(204);
|
|
59
|
+
});
|
|
60
|
+
// Health check endpoint
|
|
61
|
+
app.get("/health", (_req, res) => {
|
|
62
|
+
res.json({ status: "ok", transport: "http", sessions: sessions.size });
|
|
63
|
+
});
|
|
64
|
+
return app;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Setup HTTP server with MCP transport
|
|
68
|
+
*
|
|
69
|
+
* Creates an Express server with proper MCP endpoints for:
|
|
70
|
+
* - POST /mcp: Handle JSON-RPC requests
|
|
71
|
+
* - GET /mcp: Establish SSE stream for server-to-client messages
|
|
72
|
+
* - DELETE /mcp: Terminate session
|
|
73
|
+
*
|
|
74
|
+
* @param mcpServer - The MCP server instance to connect
|
|
75
|
+
* @param options - Server configuration options
|
|
76
|
+
* @returns Promise resolving to server and transport instances
|
|
77
|
+
*/
|
|
78
|
+
export async function setupHttpServer(mcpServer, options = {}) {
|
|
79
|
+
const { port = 3000, host = "0.0.0.0", enableSessions = true } = options;
|
|
80
|
+
const app = createMcpApp(host);
|
|
81
|
+
// Handle POST /mcp - JSON-RPC requests
|
|
82
|
+
app.post("/mcp", async (req, res) => {
|
|
83
|
+
const sessionId = req.headers["mcp-session-id"];
|
|
84
|
+
let transport;
|
|
85
|
+
if (enableSessions && sessionId && sessions.has(sessionId)) {
|
|
86
|
+
// Reuse existing session
|
|
87
|
+
transport = sessions.get(sessionId);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
// Create new transport for this request/session
|
|
91
|
+
transport = new StreamableHTTPServerTransport({
|
|
92
|
+
sessionIdGenerator: enableSessions ? () => randomUUID() : undefined,
|
|
93
|
+
});
|
|
94
|
+
// Connect the transport to the MCP server
|
|
95
|
+
await mcpServer.connect(transport);
|
|
96
|
+
// Store session if enabled
|
|
97
|
+
if (enableSessions && transport.sessionId) {
|
|
98
|
+
sessions.set(transport.sessionId, transport);
|
|
99
|
+
logger.debug("Created new MCP session", { sessionId: transport.sessionId });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
await transport.handleRequest(req, res, req.body);
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
logger.error("Error handling POST /mcp", {
|
|
107
|
+
error: error instanceof Error ? error.message : String(error),
|
|
108
|
+
sessionId,
|
|
109
|
+
});
|
|
110
|
+
if (!res.headersSent) {
|
|
111
|
+
res.status(500).json({
|
|
112
|
+
jsonrpc: "2.0",
|
|
113
|
+
error: {
|
|
114
|
+
code: -32603,
|
|
115
|
+
message: "Internal server error",
|
|
116
|
+
},
|
|
117
|
+
id: null,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
// Handle GET /mcp - SSE stream for server-to-client messages
|
|
123
|
+
app.get("/mcp", async (req, res) => {
|
|
124
|
+
const sessionId = req.headers["mcp-session-id"];
|
|
125
|
+
if (!enableSessions || !sessionId || !sessions.has(sessionId)) {
|
|
126
|
+
res.status(400).json({
|
|
127
|
+
jsonrpc: "2.0",
|
|
128
|
+
error: {
|
|
129
|
+
code: -32600,
|
|
130
|
+
message: "Invalid or missing session ID. Send POST first to initialize.",
|
|
131
|
+
},
|
|
132
|
+
id: null,
|
|
133
|
+
});
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const transport = sessions.get(sessionId);
|
|
137
|
+
try {
|
|
138
|
+
await transport.handleRequest(req, res);
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
logger.error("Error handling GET /mcp (SSE)", {
|
|
142
|
+
error: error instanceof Error ? error.message : String(error),
|
|
143
|
+
sessionId,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
// Handle DELETE /mcp - Session termination
|
|
148
|
+
app.delete("/mcp", async (req, res) => {
|
|
149
|
+
const sessionId = req.headers["mcp-session-id"];
|
|
150
|
+
if (sessionId && sessions.has(sessionId)) {
|
|
151
|
+
const transport = sessions.get(sessionId);
|
|
152
|
+
try {
|
|
153
|
+
await transport.close();
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
// Ignore close errors
|
|
157
|
+
}
|
|
158
|
+
sessions.delete(sessionId);
|
|
159
|
+
logger.debug("Terminated MCP session", { sessionId });
|
|
160
|
+
res.status(200).json({ success: true, message: "Session terminated" });
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
res.status(404).json({
|
|
164
|
+
jsonrpc: "2.0",
|
|
165
|
+
error: {
|
|
166
|
+
code: -32600,
|
|
167
|
+
message: "Session not found",
|
|
168
|
+
},
|
|
169
|
+
id: null,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
// Start the server
|
|
174
|
+
return new Promise((resolve, reject) => {
|
|
175
|
+
try {
|
|
176
|
+
const server = app.listen(port, host, () => {
|
|
177
|
+
const address = `http://${host}:${port}`;
|
|
178
|
+
logger.info("F5XC API MCP HTTP Server started", {
|
|
179
|
+
url: `${address}/mcp`,
|
|
180
|
+
transport: "http/sse",
|
|
181
|
+
sessions: enableSessions ? "enabled" : "disabled",
|
|
182
|
+
});
|
|
183
|
+
// Create a placeholder transport for the result
|
|
184
|
+
// Actual transports are created per-session
|
|
185
|
+
const placeholderTransport = new StreamableHTTPServerTransport({
|
|
186
|
+
sessionIdGenerator: enableSessions ? () => randomUUID() : undefined,
|
|
187
|
+
});
|
|
188
|
+
resolve({
|
|
189
|
+
server,
|
|
190
|
+
transport: placeholderTransport,
|
|
191
|
+
address,
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
server.on("error", (error) => {
|
|
195
|
+
logger.error("HTTP server error", {
|
|
196
|
+
error: error instanceof Error ? error.message : String(error),
|
|
197
|
+
});
|
|
198
|
+
reject(error);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
reject(error);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Cleanup all active sessions
|
|
208
|
+
*/
|
|
209
|
+
export async function cleanupSessions() {
|
|
210
|
+
for (const [sessionId, transport] of sessions) {
|
|
211
|
+
try {
|
|
212
|
+
await transport.close();
|
|
213
|
+
}
|
|
214
|
+
catch {
|
|
215
|
+
// Ignore close errors
|
|
216
|
+
}
|
|
217
|
+
sessions.delete(sessionId);
|
|
218
|
+
logger.debug("Cleaned up session", { sessionId });
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Get current session count
|
|
223
|
+
*/
|
|
224
|
+
export function getSessionCount() {
|
|
225
|
+
return sessions.size;
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=http-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-server.js","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAA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ANGED
|
@@ -45,9 +45,14 @@ async function main() {
|
|
|
45
45
|
|
|
46
46
|
Usage: f5xc-api-mcp [options]
|
|
47
47
|
|
|
48
|
-
Options:
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
Transport Options:
|
|
49
|
+
--http, --sse Start HTTP/SSE server instead of STDIO
|
|
50
|
+
--port <number> HTTP server port (default: 3000)
|
|
51
|
+
--host <address> HTTP server bind address (default: 0.0.0.0)
|
|
52
|
+
|
|
53
|
+
General Options:
|
|
54
|
+
-v, --version Show version number
|
|
55
|
+
-h, --help Show help
|
|
51
56
|
|
|
52
57
|
Environment Variables (override profile settings):
|
|
53
58
|
F5XC_API_URL Tenant URL (e.g., https://tenant.console.ves.volterra.io)
|
|
@@ -61,18 +66,47 @@ Profile Configuration (cross-compatible with f5xc-xcsh CLI):
|
|
|
61
66
|
Profiles are stored in ~/.config/xcsh/profiles/
|
|
62
67
|
Active profile is tracked in ~/.config/xcsh/active_profile
|
|
63
68
|
|
|
69
|
+
Transport Modes:
|
|
70
|
+
STDIO (default) For Claude Desktop, Claude CLI, VS Code extensions
|
|
71
|
+
HTTP/SSE For vLLM servers, web-based clients, private LLM utilities
|
|
72
|
+
|
|
73
|
+
Examples:
|
|
74
|
+
f5xc-api-mcp Start in STDIO mode (default)
|
|
75
|
+
f5xc-api-mcp --http Start HTTP server on 0.0.0.0:3000
|
|
76
|
+
f5xc-api-mcp --http --port 8080 Start HTTP server on port 8080
|
|
77
|
+
f5xc-api-mcp --http --host 127.0.0.1 Start HTTP server on localhost only
|
|
78
|
+
|
|
64
79
|
The server runs in documentation mode when no credentials are provided,
|
|
65
80
|
allowing exploration of the API without authentication.
|
|
66
81
|
`);
|
|
67
82
|
process.exit(0);
|
|
68
83
|
}
|
|
69
|
-
//
|
|
84
|
+
// Parse HTTP mode flags
|
|
85
|
+
const httpMode = args.includes("--http") || args.includes("--sse");
|
|
86
|
+
const portIndex = args.indexOf("--port");
|
|
87
|
+
const portArg = portIndex !== -1 ? args[portIndex + 1] : undefined;
|
|
88
|
+
const port = portArg ? parseInt(portArg, 10) : 3000;
|
|
89
|
+
const hostIndex = args.indexOf("--host");
|
|
90
|
+
const host = hostIndex !== -1 && args[hostIndex + 1] ? args[hostIndex + 1] : "0.0.0.0";
|
|
91
|
+
// Start MCP server
|
|
70
92
|
const server = await createServer();
|
|
71
|
-
|
|
93
|
+
if (httpMode) {
|
|
94
|
+
// Start in HTTP/SSE mode for vLLM and other HTTP clients
|
|
95
|
+
await server.startHttp({ port, host });
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
// Start in STDIO mode (default) for Claude Desktop/CLI
|
|
99
|
+
await server.start();
|
|
100
|
+
}
|
|
72
101
|
// Handle graceful shutdown
|
|
73
102
|
const shutdown = async (signal) => {
|
|
74
103
|
logger.info(`Received ${signal}, shutting down gracefully`);
|
|
75
|
-
|
|
104
|
+
if (httpMode) {
|
|
105
|
+
await server.stopHttp();
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
await server.stop();
|
|
109
|
+
}
|
|
76
110
|
process.exit(0);
|
|
77
111
|
};
|
|
78
112
|
process.on("SIGINT", () => void shutdown("SIGINT"));
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,sDAAsD;AACtD,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B;;GAEG;AACH,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,oEAAoE;QACpE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAEnC,sBAAsB;QACtB,IAAI,IAAI,CAAC,QAAQ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CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,+EAA+E;AAC/E,MAAM,YAAY,GAChB,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,UAAU,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;AAE/F,IAAI,YAAY,EAAE,CAAC;IACjB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QAC9B,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE;YAC1B,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC9D,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* execution mode (authenticated with F5XC credentials).
|
|
7
7
|
*/
|
|
8
8
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
9
|
+
import { type HttpServerOptions } from "./http-server.js";
|
|
9
10
|
import { CredentialManager } from "./auth/credential-manager.js";
|
|
10
11
|
/**
|
|
11
12
|
* Server configuration options
|
|
@@ -32,6 +33,7 @@ export declare class F5XCApiServer {
|
|
|
32
33
|
private httpClient;
|
|
33
34
|
private resourceHandler;
|
|
34
35
|
private transport;
|
|
36
|
+
private httpServer;
|
|
35
37
|
constructor(config: ServerConfig);
|
|
36
38
|
/**
|
|
37
39
|
* Register all MCP capabilities (tools, resources, prompts)
|
|
@@ -59,9 +61,22 @@ export declare class F5XCApiServer {
|
|
|
59
61
|
*/
|
|
60
62
|
start(): Promise<void>;
|
|
61
63
|
/**
|
|
62
|
-
* Stop the MCP server
|
|
64
|
+
* Stop the MCP server (STDIO mode)
|
|
63
65
|
*/
|
|
64
66
|
stop(): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Start the MCP server with HTTP/SSE transport
|
|
69
|
+
*
|
|
70
|
+
* This mode enables integration with HTTP-based clients like vLLM
|
|
71
|
+
* servers and other AI utilities that communicate over HTTP.
|
|
72
|
+
*
|
|
73
|
+
* @param options - HTTP server configuration
|
|
74
|
+
*/
|
|
75
|
+
startHttp(options?: HttpServerOptions): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Stop the HTTP server
|
|
78
|
+
*/
|
|
79
|
+
stopHttp(): Promise<void>;
|
|
65
80
|
/**
|
|
66
81
|
* Get the underlying MCP server instance
|
|
67
82
|
*/
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,OAAO,EAAoC,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAY,MAAM,8BAA8B,CAAC;AA8C3E;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,iBAAiB,EAAE,iBAAiB,CAAC;CACtC;AAED;;;;;;;GAOG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,SAAS,CAAqC;IACtD,OAAO,CAAC,UAAU,CAA2B;gBAEjC,MAAM,EAAE,YAAY;IAmBhC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAM5B;;;;;;;OAOG;IACH,OAAO,CAAC,aAAa;IAwrBrB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAmCzB;;OAEG;IACH,OAAO,CAAC,eAAe;IAuFvB;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAa5B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ3B;;;;;;;OAOG;IACG,SAAS,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB/D;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAmB/B;;OAEG;IACH,YAAY,IAAI,SAAS;IAIzB;;OAEG;IACH,oBAAoB,IAAI,iBAAiB;CAG1C;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,aAAa,CAAC,CAS3D"}
|
package/dist/server.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
9
9
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
10
10
|
import { z } from "zod";
|
|
11
|
+
import { setupHttpServer, cleanupSessions } from "./http-server.js";
|
|
11
12
|
import { CredentialManager, AuthMode } from "./auth/credential-manager.js";
|
|
12
13
|
import { createHttpClient } from "./auth/http-client.js";
|
|
13
14
|
import { logger } from "./utils/logging.js";
|
|
@@ -30,6 +31,7 @@ export class F5XCApiServer {
|
|
|
30
31
|
httpClient = null;
|
|
31
32
|
resourceHandler;
|
|
32
33
|
transport = null;
|
|
34
|
+
httpServer = null;
|
|
33
35
|
constructor(config) {
|
|
34
36
|
this.credentialManager = config.credentialManager;
|
|
35
37
|
// Create HTTP client if authenticated
|
|
@@ -704,7 +706,7 @@ export class F5XCApiServer {
|
|
|
704
706
|
logger.info("F5XC API MCP Server started successfully");
|
|
705
707
|
}
|
|
706
708
|
/**
|
|
707
|
-
* Stop the MCP server
|
|
709
|
+
* Stop the MCP server (STDIO mode)
|
|
708
710
|
*/
|
|
709
711
|
async stop() {
|
|
710
712
|
if (this.transport) {
|
|
@@ -713,6 +715,50 @@ export class F5XCApiServer {
|
|
|
713
715
|
logger.info("F5XC API MCP Server stopped");
|
|
714
716
|
}
|
|
715
717
|
}
|
|
718
|
+
/**
|
|
719
|
+
* Start the MCP server with HTTP/SSE transport
|
|
720
|
+
*
|
|
721
|
+
* This mode enables integration with HTTP-based clients like vLLM
|
|
722
|
+
* servers and other AI utilities that communicate over HTTP.
|
|
723
|
+
*
|
|
724
|
+
* @param options - HTTP server configuration
|
|
725
|
+
*/
|
|
726
|
+
async startHttp(options = {}) {
|
|
727
|
+
const { port = 3000, host = "0.0.0.0" } = options;
|
|
728
|
+
logger.info("Starting F5XC API MCP Server (HTTP mode)", {
|
|
729
|
+
version: VERSION,
|
|
730
|
+
authMode: this.credentialManager.getAuthMode(),
|
|
731
|
+
port,
|
|
732
|
+
host,
|
|
733
|
+
});
|
|
734
|
+
const result = await setupHttpServer(this.server, options);
|
|
735
|
+
this.httpServer = result.server;
|
|
736
|
+
logger.info("F5XC API MCP Server started successfully (HTTP mode)", {
|
|
737
|
+
url: `${result.address}/mcp`,
|
|
738
|
+
transport: "http/sse",
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Stop the HTTP server
|
|
743
|
+
*/
|
|
744
|
+
async stopHttp() {
|
|
745
|
+
if (this.httpServer) {
|
|
746
|
+
await cleanupSessions();
|
|
747
|
+
return new Promise((resolve, reject) => {
|
|
748
|
+
this.httpServer.close((err) => {
|
|
749
|
+
if (err) {
|
|
750
|
+
logger.error("Error stopping HTTP server", { error: err.message });
|
|
751
|
+
reject(err);
|
|
752
|
+
}
|
|
753
|
+
else {
|
|
754
|
+
this.httpServer = null;
|
|
755
|
+
logger.info("F5XC API MCP HTTP Server stopped");
|
|
756
|
+
resolve();
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
}
|
|
716
762
|
/**
|
|
717
763
|
* Get the underlying MCP server instance
|
|
718
764
|
*/
|