Use the Model Context Protocol endpoint to let AI orchestration tools manage links, workspaces, analytics, and API key workspace defaults.
NEXT_PUBLIC_SERVER_URL when configured, otherwise it falls back to the current browser origin.Server Base URL
1https://a.i6t.co.zaMCP Endpoint
1https://a.i6t.co.za/mcp1Content-Type: application/json
2Accept: application/json, text/event-stream
3x-api-key: <YOUR_API_KEY>
4mcp-session-id: <SESSION_ID> # required after initializemcp-session-id fortools/list and tools/call.1curl -sS -D mcp-init-headers.txt \
2 -X POST "https://a.i6t.co.za/mcp" \
3 -H "Content-Type: application/json" \
4 -H "Accept: application/json, text/event-stream" \
5 -H "x-api-key: $MCP_API_KEY" \
6 --data '{
7 "jsonrpc": "2.0",
8 "id": 1,
9 "method": "initialize",
10 "params": {
11 "protocolVersion": "2024-11-05",
12 "capabilities": {},
13 "clientInfo": {
14 "name": "curl-client",
15 "version": "1.0.0"
16 }
17 }
18 }'Get link by short code
1{
2 "jsonrpc": "2.0",
3 "id": 11,
4 "method": "tools/call",
5 "params": {
6 "name": "get_link_by_short_code",
7 "arguments": {
8 "shortCode": "campaign-2026"
9 }
10 }
11}Create short link
1{
2 "jsonrpc": "2.0",
3 "id": 12,
4 "method": "tools/call",
5 "params": {
6 "name": "create_short_link",
7 "arguments": {
8 "destinationUrl": "https://example.com/landing",
9 "title": "Campaign Landing",
10 "customCode": "campaign-2026",
11 "expiresAt": "2026-12-31T23:59:59.000Z"
12 }
13 }
14}Delete link
1{
2 "jsonrpc": "2.0",
3 "id": 13,
4 "method": "tools/call",
5 "params": {
6 "name": "delete_link",
7 "arguments": {
8 "id": "00000000-0000-0000-0000-000000000000"
9 }
10 }
11}1const MCP_URL = "https://a.i6t.co.za/mcp";
2const API_KEY = process.env.MCP_API_KEY;
3
4if (!API_KEY) throw new Error("MCP_API_KEY is required");
5
6const headers = {
7 "Content-Type": "application/json",
8 Accept: "application/json, text/event-stream",
9 "x-api-key": API_KEY,
10};
11
12const initRes = await fetch(MCP_URL, {
13 method: "POST",
14 headers,
15 body: JSON.stringify({
16 jsonrpc: "2.0",
17 id: 1,
18 method: "initialize",
19 params: {
20 protocolVersion: "2024-11-05",
21 capabilities: {},
22 clientInfo: { name: "node-client", version: "1.0.0" },
23 },
24 }),
25});
26
27const sessionId = initRes.headers.get("mcp-session-id");
28if (!sessionId) throw new Error("No mcp-session-id returned");
29
30const toolsRes = await fetch(MCP_URL, {
31 method: "POST",
32 headers: { ...headers, "mcp-session-id": sessionId },
33 body: JSON.stringify({
34 jsonrpc: "2.0",
35 id: 2,
36 method: "tools/list",
37 params: {},
38 }),
39});
40
41console.log(await toolsRes.text());