MCP connectors
This content is not available in your language yet.
An MCP connector points Wetel at a tool server you run (Model Context Protocol), so a workflow tool node can call its tools. Every operation here takes a dashboard JWT. The server must be reachable from the internet: a serverUrl that resolves to a private or reserved address is refused. The apiKey you register is the key of your tool server; it is stored as a secret and never returned.
Every operation is a POST of { "query", "variables" } to https://api.wetel.dev/graphql (sandbox) with the x-huat-platform: customer header and the credential shown. New here? Start with the Quickstart and the Authentication cheat sheet. Errors are listed in Errors; Postman and OpenAPI files are on Downloads.
| Operation | Kind | Credential | What it does |
|---|---|---|---|
createMcpConnector | mutation | Dashboard JWT | Register an MCP tool server for your workspace. |
mcpConnectors | query | Dashboard JWT | List the workspace’s MCP connectors, newest first. |
listMcpTools | query | Dashboard JWT | Connect to the server and list its tools. Use it to test a connector before a workflow relies on it. |
deleteMcpConnector | mutation | Dashboard JWT | Remove an MCP connector. Workflow nodes that use it stop working. |
createMcpConnector
Section titled “createMcpConnector”Register an MCP tool server for your workspace.
- Kind: mutation
- Credential: Dashboard JWT:
Authorization: Bearer <jwt>, fromlogin(a person or a one-off script) - Available in: sandbox and production
creditsPerCallis optional: the credits charged for one successful call of any tool on this connector. Omit it for the platform default.
Request
mutation CreateConnector($input: CreateMcpConnectorInput!) { createMcpConnector(input: $input) { id name serverUrl creditsPerCall }}{ "input": { "name": "Ticketing tools", "serverUrl": "https://tools.example.com/mcp", "apiKey": "example-tool-server-key-not-real" }}Input fields
CreateMcpConnectorInput
| Field | Type | Required | Description |
|---|---|---|---|
apiKey | String! | yes | Credential sent as Authorization: Bearer on every call to the server. Stored as a secret, never returned. |
creditsPerCall | Int | no | The credits charged for one successful call of ANY tool on this connector (an integer, 0 or more). Omit to use the platform default (2 credits). |
name | String! | yes | Display name (1 to 100 characters). |
serverUrl | String! | yes | URL of the MCP server (streamable HTTP transport). Private and internal addresses are refused. |
Code samples
#!/usr/bin/env bash# createMcpConnector: Register an MCP tool server for your workspace.# Credential: Dashboard JWT (WETEL_JWT).API_URL="${WETEL_API_URL:-https://api.wetel.dev/graphql}"
curl -sS "$API_URL" \ -H "Content-Type: application/json" \ -H "x-huat-platform: customer" \ -H "Authorization: Bearer $WETEL_JWT" \ --data-binary @- <<'JSON'{ "query": "mutation CreateConnector($input:CreateMcpConnectorInput!){createMcpConnector(input:$input){id name serverUrl creditsPerCall}}", "variables": { "input": { "name": "Ticketing tools", "serverUrl": "https://tools.example.com/mcp", "apiKey": "example-tool-server-key-not-real" } }}JSON// createMcpConnector: Register an MCP tool server for your workspace.// Credential: Dashboard JWT (WETEL_JWT). Node 18+ (built-in fetch).const API_URL = process.env.WETEL_API_URL ?? "https://api.wetel.dev/graphql";
const query = `mutation CreateConnector($input: CreateMcpConnectorInput!) { createMcpConnector(input: $input) { id name serverUrl creditsPerCall }}`;
const variables = { input: { name: "Ticketing tools", serverUrl: "https://tools.example.com/mcp", apiKey: "example-tool-server-key-not-real", },};
type GraphQLResponse = { data?: Record<string, unknown>; errors?: { message: string; extensions?: { code?: string } }[];};
async function main(): Promise<void> { const res = await fetch(API_URL, { method: "POST", headers: { "Content-Type": "application/json", "x-huat-platform": "customer", Authorization: `Bearer ${process.env.WETEL_JWT ?? ""}`, }, body: JSON.stringify({ query, variables }), }); const body = (await res.json()) as GraphQLResponse; if (body.errors?.length) { const error = body.errors[0]; throw new Error(`${error.extensions?.code}: ${error.message}`); } console.log(JSON.stringify(body.data?.createMcpConnector, null, 2));}
main().catch(err => { console.error(err); process.exit(1);});
export {};<?php// createMcpConnector: Register an MCP tool server for your workspace.// Credential: Dashboard JWT (WETEL_JWT). PHP 7.3+ with the curl extension.$apiUrl = getenv('WETEL_API_URL') ?: 'https://api.wetel.dev/graphql';
$query = <<<'GRAPHQL'mutation CreateConnector($input: CreateMcpConnectorInput!) { createMcpConnector(input: $input) { id name serverUrl creditsPerCall }}GRAPHQL;
$variables = json_decode(<<<'JSON'{ "input": { "name": "Ticketing tools", "serverUrl": "https://tools.example.com/mcp", "apiKey": "example-tool-server-key-not-real" }}JSON);
$ch = curl_init($apiUrl);curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'x-huat-platform: customer', 'Authorization: Bearer ' . getenv('WETEL_JWT'), ], CURLOPT_POSTFIELDS => json_encode(['query' => $query, 'variables' => $variables]),]);$body = json_decode(curl_exec($ch), true);curl_close($ch);
if (!empty($body['errors'])) { $error = $body['errors'][0]; fwrite(STDERR, ($error['extensions']['code'] ?? 'ERROR') . ': ' . $error['message'] . PHP_EOL); exit(1);}echo json_encode($body['data']['createMcpConnector'], JSON_PRETTY_PRINT), PHP_EOL;// createMcpConnector: Register an MCP tool server for your workspace.// Credential: Dashboard JWT (WETEL_JWT). .NET 8: put this in Program.cs of a console app and run "dotnet run".using System.Net.Http.Headers;using System.Net.Http.Json;using System.Text.Json;using System.Text.Json.Nodes;
var apiUrl = Environment.GetEnvironmentVariable("WETEL_API_URL") ?? "https://api.wetel.dev/graphql";
const string query = """ mutation CreateConnector($input: CreateMcpConnectorInput!) { createMcpConnector(input: $input) { id name serverUrl creditsPerCall } } """;
var variables = JsonNode.Parse(""" { "input": { "name": "Ticketing tools", "serverUrl": "https://tools.example.com/mcp", "apiKey": "example-tool-server-key-not-real" } } """);
using var http = new HttpClient();using var request = new HttpRequestMessage(HttpMethod.Post, apiUrl){ Content = JsonContent.Create(new { query, variables }),};request.Headers.Add("x-huat-platform", "customer");request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WETEL_JWT"));
using var response = await http.SendAsync(request);var body = JsonNode.Parse(await response.Content.ReadAsStringAsync())!;if (body["errors"] is JsonArray errors && errors.Count > 0){ Console.Error.WriteLine($"{errors[0]?["extensions"]?["code"]}: {errors[0]?["message"]}"); return 1;}Console.WriteLine(body["data"]?["createMcpConnector"]?.ToJsonString(new JsonSerializerOptions { WriteIndented = true }));return 0;# createMcpConnector: Register an MCP tool server for your workspace.# Credential: Dashboard JWT (WETEL_JWT). Python 3.8+ with "requests".import jsonimport os
import requests
API_URL = os.environ.get("WETEL_API_URL", "https://api.wetel.dev/graphql")
QUERY = """mutation CreateConnector($input: CreateMcpConnectorInput!) { createMcpConnector(input: $input) { id name serverUrl creditsPerCall }}"""
VARIABLES = { "input": { "name": "Ticketing tools", "serverUrl": "https://tools.example.com/mcp", "apiKey": "example-tool-server-key-not-real", },}
response = requests.post( API_URL, json={"query": QUERY, "variables": VARIABLES}, headers={ "x-huat-platform": "customer", "Authorization": "Bearer " + os.environ["WETEL_JWT"], }, timeout=30,)body = response.json()if body.get("errors"): error = body["errors"][0] raise SystemExit(f"{error.get('extensions', {}).get('code')}: {error['message']}")print(json.dumps(body["data"]["createMcpConnector"], indent=2))Responses
Success (HTTP 200)
{ "data": { "createMcpConnector": { "id": 4, "name": "Ticketing tools", "serverUrl": "https://tools.example.com/mcp", "creditsPerCall": null } }}BAD_USER_INPUT: A required field is missing (HTTP 400)
Sent with variables:
{ "input": { "name": "Ticketing tools", "serverUrl": "https://tools.example.com/mcp" }}{ "errors": [ { "message": "Variable \"$input\" got invalid value { name: \"Ticketing tools\", serverUrl: \"https://tools.example.com/mcp\" }; Field \"apiKey\" of required type \"String!\" was not provided.", "locations": [ { "line": 1, "column": 26 } ], "extensions": { "code": "BAD_USER_INPUT" } } ]}UNAUTHENTICATED: Called with an API key instead of a JWT (HTTP 200)
{ "errors": [ { "message": "Unauthorized", "locations": [ { "line": 2, "column": 3 } ], "path": [ "createMcpConnector" ], "extensions": { "code": "UNAUTHENTICATED", "originalError": { "message": "Unauthorized", "statusCode": 401 } } } ], "data": null}mcpConnectors
Section titled “mcpConnectors”List the workspace’s MCP connectors, newest first.
- Kind: query
- Credential: Dashboard JWT:
Authorization: Bearer <jwt>, fromlogin(a person or a one-off script) - Available in: sandbox and production
Request
query ListConnectors { mcpConnectors { id name serverUrl creditsPerCall createdAt }}{}Code samples
#!/usr/bin/env bash# mcpConnectors: List the workspace's MCP connectors, newest first.# Credential: Dashboard JWT (WETEL_JWT).API_URL="${WETEL_API_URL:-https://api.wetel.dev/graphql}"
curl -sS "$API_URL" \ -H "Content-Type: application/json" \ -H "x-huat-platform: customer" \ -H "Authorization: Bearer $WETEL_JWT" \ --data-binary @- <<'JSON'{ "query": "query ListConnectors{mcpConnectors{id name serverUrl creditsPerCall createdAt}}", "variables": {}}JSON// mcpConnectors: List the workspace's MCP connectors, newest first.// Credential: Dashboard JWT (WETEL_JWT). Node 18+ (built-in fetch).const API_URL = process.env.WETEL_API_URL ?? "https://api.wetel.dev/graphql";
const query = `query ListConnectors { mcpConnectors { id name serverUrl creditsPerCall createdAt }}`;
const variables = {};
type GraphQLResponse = { data?: Record<string, unknown>; errors?: { message: string; extensions?: { code?: string } }[];};
async function main(): Promise<void> { const res = await fetch(API_URL, { method: "POST", headers: { "Content-Type": "application/json", "x-huat-platform": "customer", Authorization: `Bearer ${process.env.WETEL_JWT ?? ""}`, }, body: JSON.stringify({ query, variables }), }); const body = (await res.json()) as GraphQLResponse; if (body.errors?.length) { const error = body.errors[0]; throw new Error(`${error.extensions?.code}: ${error.message}`); } console.log(JSON.stringify(body.data?.mcpConnectors, null, 2));}
main().catch(err => { console.error(err); process.exit(1);});
export {};<?php// mcpConnectors: List the workspace's MCP connectors, newest first.// Credential: Dashboard JWT (WETEL_JWT). PHP 7.3+ with the curl extension.$apiUrl = getenv('WETEL_API_URL') ?: 'https://api.wetel.dev/graphql';
$query = <<<'GRAPHQL'query ListConnectors { mcpConnectors { id name serverUrl creditsPerCall createdAt }}GRAPHQL;
$variables = json_decode(<<<'JSON'{}JSON);
$ch = curl_init($apiUrl);curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'x-huat-platform: customer', 'Authorization: Bearer ' . getenv('WETEL_JWT'), ], CURLOPT_POSTFIELDS => json_encode(['query' => $query, 'variables' => $variables]),]);$body = json_decode(curl_exec($ch), true);curl_close($ch);
if (!empty($body['errors'])) { $error = $body['errors'][0]; fwrite(STDERR, ($error['extensions']['code'] ?? 'ERROR') . ': ' . $error['message'] . PHP_EOL); exit(1);}echo json_encode($body['data']['mcpConnectors'], JSON_PRETTY_PRINT), PHP_EOL;// mcpConnectors: List the workspace's MCP connectors, newest first.// Credential: Dashboard JWT (WETEL_JWT). .NET 8: put this in Program.cs of a console app and run "dotnet run".using System.Net.Http.Headers;using System.Net.Http.Json;using System.Text.Json;using System.Text.Json.Nodes;
var apiUrl = Environment.GetEnvironmentVariable("WETEL_API_URL") ?? "https://api.wetel.dev/graphql";
const string query = """ query ListConnectors { mcpConnectors { id name serverUrl creditsPerCall createdAt } } """;
var variables = JsonNode.Parse(""" {} """);
using var http = new HttpClient();using var request = new HttpRequestMessage(HttpMethod.Post, apiUrl){ Content = JsonContent.Create(new { query, variables }),};request.Headers.Add("x-huat-platform", "customer");request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WETEL_JWT"));
using var response = await http.SendAsync(request);var body = JsonNode.Parse(await response.Content.ReadAsStringAsync())!;if (body["errors"] is JsonArray errors && errors.Count > 0){ Console.Error.WriteLine($"{errors[0]?["extensions"]?["code"]}: {errors[0]?["message"]}"); return 1;}Console.WriteLine(body["data"]?["mcpConnectors"]?.ToJsonString(new JsonSerializerOptions { WriteIndented = true }));return 0;# mcpConnectors: List the workspace's MCP connectors, newest first.# Credential: Dashboard JWT (WETEL_JWT). Python 3.8+ with "requests".import jsonimport os
import requests
API_URL = os.environ.get("WETEL_API_URL", "https://api.wetel.dev/graphql")
QUERY = """query ListConnectors { mcpConnectors { id name serverUrl creditsPerCall createdAt }}"""
VARIABLES = {}
response = requests.post( API_URL, json={"query": QUERY, "variables": VARIABLES}, headers={ "x-huat-platform": "customer", "Authorization": "Bearer " + os.environ["WETEL_JWT"], }, timeout=30,)body = response.json()if body.get("errors"): error = body["errors"][0] raise SystemExit(f"{error.get('extensions', {}).get('code')}: {error['message']}")print(json.dumps(body["data"]["mcpConnectors"], indent=2))Responses
Success (HTTP 200)
{ "data": { "mcpConnectors": [ { "id": 4, "name": "Ticketing tools", "serverUrl": "https://tools.example.com/mcp", "creditsPerCall": null, "createdAt": "2026-10-12T04:30:00.000Z" } ] }}UNAUTHENTICATED: Missing credential (HTTP 200)
{ "errors": [ { "message": "Unauthorized", "locations": [ { "line": 2, "column": 3 } ], "path": [ "mcpConnectors" ], "extensions": { "code": "UNAUTHENTICATED", "originalError": { "message": "Unauthorized", "statusCode": 401 } } } ], "data": null}listMcpTools
Section titled “listMcpTools”Connect to the server and list its tools. Use it to test a connector before a workflow relies on it.
- Kind: query
- Credential: Dashboard JWT:
Authorization: Bearer <jwt>, fromlogin(a person or a one-off script) - Available in: sandbox and production
- This calls your server live with the stored key. A server that cannot be reached, or that refuses the key, answers
INTERNAL_SERVER_ERRORwith a message describing the connection problem. inputSchemais the tool’s own JSON Schema for its arguments, as your server declares it.
Request
query Tools($connectorId: Int!) { listMcpTools(connectorId: $connectorId) { name description inputSchema }}{ "connectorId": 4}Code samples
#!/usr/bin/env bash# listMcpTools: Connect to the server and list its tools. Use it to test a connector before a workflow relies on it.# Credential: Dashboard JWT (WETEL_JWT).API_URL="${WETEL_API_URL:-https://api.wetel.dev/graphql}"
curl -sS "$API_URL" \ -H "Content-Type: application/json" \ -H "x-huat-platform: customer" \ -H "Authorization: Bearer $WETEL_JWT" \ --data-binary @- <<'JSON'{ "query": "query Tools($connectorId:Int!){listMcpTools(connectorId:$connectorId){name description inputSchema}}", "variables": { "connectorId": 4 }}JSON// listMcpTools: Connect to the server and list its tools. Use it to test a connector before a workflow relies on it.// Credential: Dashboard JWT (WETEL_JWT). Node 18+ (built-in fetch).const API_URL = process.env.WETEL_API_URL ?? "https://api.wetel.dev/graphql";
const query = `query Tools($connectorId: Int!) { listMcpTools(connectorId: $connectorId) { name description inputSchema }}`;
const variables = { connectorId: 4,};
type GraphQLResponse = { data?: Record<string, unknown>; errors?: { message: string; extensions?: { code?: string } }[];};
async function main(): Promise<void> { const res = await fetch(API_URL, { method: "POST", headers: { "Content-Type": "application/json", "x-huat-platform": "customer", Authorization: `Bearer ${process.env.WETEL_JWT ?? ""}`, }, body: JSON.stringify({ query, variables }), }); const body = (await res.json()) as GraphQLResponse; if (body.errors?.length) { const error = body.errors[0]; throw new Error(`${error.extensions?.code}: ${error.message}`); } console.log(JSON.stringify(body.data?.listMcpTools, null, 2));}
main().catch(err => { console.error(err); process.exit(1);});
export {};<?php// listMcpTools: Connect to the server and list its tools. Use it to test a connector before a workflow relies on it.// Credential: Dashboard JWT (WETEL_JWT). PHP 7.3+ with the curl extension.$apiUrl = getenv('WETEL_API_URL') ?: 'https://api.wetel.dev/graphql';
$query = <<<'GRAPHQL'query Tools($connectorId: Int!) { listMcpTools(connectorId: $connectorId) { name description inputSchema }}GRAPHQL;
$variables = json_decode(<<<'JSON'{ "connectorId": 4}JSON);
$ch = curl_init($apiUrl);curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'x-huat-platform: customer', 'Authorization: Bearer ' . getenv('WETEL_JWT'), ], CURLOPT_POSTFIELDS => json_encode(['query' => $query, 'variables' => $variables]),]);$body = json_decode(curl_exec($ch), true);curl_close($ch);
if (!empty($body['errors'])) { $error = $body['errors'][0]; fwrite(STDERR, ($error['extensions']['code'] ?? 'ERROR') . ': ' . $error['message'] . PHP_EOL); exit(1);}echo json_encode($body['data']['listMcpTools'], JSON_PRETTY_PRINT), PHP_EOL;// listMcpTools: Connect to the server and list its tools. Use it to test a connector before a workflow relies on it.// Credential: Dashboard JWT (WETEL_JWT). .NET 8: put this in Program.cs of a console app and run "dotnet run".using System.Net.Http.Headers;using System.Net.Http.Json;using System.Text.Json;using System.Text.Json.Nodes;
var apiUrl = Environment.GetEnvironmentVariable("WETEL_API_URL") ?? "https://api.wetel.dev/graphql";
const string query = """ query Tools($connectorId: Int!) { listMcpTools(connectorId: $connectorId) { name description inputSchema } } """;
var variables = JsonNode.Parse(""" { "connectorId": 4 } """);
using var http = new HttpClient();using var request = new HttpRequestMessage(HttpMethod.Post, apiUrl){ Content = JsonContent.Create(new { query, variables }),};request.Headers.Add("x-huat-platform", "customer");request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WETEL_JWT"));
using var response = await http.SendAsync(request);var body = JsonNode.Parse(await response.Content.ReadAsStringAsync())!;if (body["errors"] is JsonArray errors && errors.Count > 0){ Console.Error.WriteLine($"{errors[0]?["extensions"]?["code"]}: {errors[0]?["message"]}"); return 1;}Console.WriteLine(body["data"]?["listMcpTools"]?.ToJsonString(new JsonSerializerOptions { WriteIndented = true }));return 0;# listMcpTools: Connect to the server and list its tools. Use it to test a connector before a workflow relies on it.# Credential: Dashboard JWT (WETEL_JWT). Python 3.8+ with "requests".import jsonimport os
import requests
API_URL = os.environ.get("WETEL_API_URL", "https://api.wetel.dev/graphql")
QUERY = """query Tools($connectorId: Int!) { listMcpTools(connectorId: $connectorId) { name description inputSchema }}"""
VARIABLES = { "connectorId": 4,}
response = requests.post( API_URL, json={"query": QUERY, "variables": VARIABLES}, headers={ "x-huat-platform": "customer", "Authorization": "Bearer " + os.environ["WETEL_JWT"], }, timeout=30,)body = response.json()if body.get("errors"): error = body["errors"][0] raise SystemExit(f"{error.get('extensions', {}).get('code')}: {error['message']}")print(json.dumps(body["data"]["listMcpTools"], indent=2))Responses
Success (HTTP 200)
{ "data": { "listMcpTools": [ { "name": "create_ticket", "description": "Create a ticket in the ticketing system and return its number.", "inputSchema": { "type": "object", "properties": { "subject": { "type": "string" }, "level": { "type": "string", "enum": [ "L1", "L2", "L3" ] } }, "required": [ "subject", "level" ] } } ] }}NOT_FOUND: Connector not in your workspace (HTTP 200)
{ "errors": [ { "message": "Connector #4 not found", "locations": [ { "line": 2, "column": 3 } ], "path": [ "listMcpTools" ], "extensions": { "code": "NOT_FOUND", "status": 404, "originalError": { "message": "Connector #4 not found", "error": "Not Found", "statusCode": 404 } } } ], "data": null}deleteMcpConnector
Section titled “deleteMcpConnector”Remove an MCP connector. Workflow nodes that use it stop working.
- Kind: mutation
- Credential: Dashboard JWT:
Authorization: Bearer <jwt>, fromlogin(a person or a one-off script) - Available in: sandbox and production
Request
mutation DeleteConnector($id: Int!) { deleteMcpConnector(id: $id)}{ "id": 4}Code samples
#!/usr/bin/env bash# deleteMcpConnector: Remove an MCP connector. Workflow nodes that use it stop working.# Credential: Dashboard JWT (WETEL_JWT).API_URL="${WETEL_API_URL:-https://api.wetel.dev/graphql}"
curl -sS "$API_URL" \ -H "Content-Type: application/json" \ -H "x-huat-platform: customer" \ -H "Authorization: Bearer $WETEL_JWT" \ --data-binary @- <<'JSON'{ "query": "mutation DeleteConnector($id:Int!){deleteMcpConnector(id:$id)}", "variables": { "id": 4 }}JSON// deleteMcpConnector: Remove an MCP connector. Workflow nodes that use it stop working.// Credential: Dashboard JWT (WETEL_JWT). Node 18+ (built-in fetch).const API_URL = process.env.WETEL_API_URL ?? "https://api.wetel.dev/graphql";
const query = `mutation DeleteConnector($id: Int!) { deleteMcpConnector(id: $id)}`;
const variables = { id: 4,};
type GraphQLResponse = { data?: Record<string, unknown>; errors?: { message: string; extensions?: { code?: string } }[];};
async function main(): Promise<void> { const res = await fetch(API_URL, { method: "POST", headers: { "Content-Type": "application/json", "x-huat-platform": "customer", Authorization: `Bearer ${process.env.WETEL_JWT ?? ""}`, }, body: JSON.stringify({ query, variables }), }); const body = (await res.json()) as GraphQLResponse; if (body.errors?.length) { const error = body.errors[0]; throw new Error(`${error.extensions?.code}: ${error.message}`); } console.log(JSON.stringify(body.data?.deleteMcpConnector, null, 2));}
main().catch(err => { console.error(err); process.exit(1);});
export {};<?php// deleteMcpConnector: Remove an MCP connector. Workflow nodes that use it stop working.// Credential: Dashboard JWT (WETEL_JWT). PHP 7.3+ with the curl extension.$apiUrl = getenv('WETEL_API_URL') ?: 'https://api.wetel.dev/graphql';
$query = <<<'GRAPHQL'mutation DeleteConnector($id: Int!) { deleteMcpConnector(id: $id)}GRAPHQL;
$variables = json_decode(<<<'JSON'{ "id": 4}JSON);
$ch = curl_init($apiUrl);curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'x-huat-platform: customer', 'Authorization: Bearer ' . getenv('WETEL_JWT'), ], CURLOPT_POSTFIELDS => json_encode(['query' => $query, 'variables' => $variables]),]);$body = json_decode(curl_exec($ch), true);curl_close($ch);
if (!empty($body['errors'])) { $error = $body['errors'][0]; fwrite(STDERR, ($error['extensions']['code'] ?? 'ERROR') . ': ' . $error['message'] . PHP_EOL); exit(1);}echo json_encode($body['data']['deleteMcpConnector'], JSON_PRETTY_PRINT), PHP_EOL;// deleteMcpConnector: Remove an MCP connector. Workflow nodes that use it stop working.// Credential: Dashboard JWT (WETEL_JWT). .NET 8: put this in Program.cs of a console app and run "dotnet run".using System.Net.Http.Headers;using System.Net.Http.Json;using System.Text.Json;using System.Text.Json.Nodes;
var apiUrl = Environment.GetEnvironmentVariable("WETEL_API_URL") ?? "https://api.wetel.dev/graphql";
const string query = """ mutation DeleteConnector($id: Int!) { deleteMcpConnector(id: $id) } """;
var variables = JsonNode.Parse(""" { "id": 4 } """);
using var http = new HttpClient();using var request = new HttpRequestMessage(HttpMethod.Post, apiUrl){ Content = JsonContent.Create(new { query, variables }),};request.Headers.Add("x-huat-platform", "customer");request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("WETEL_JWT"));
using var response = await http.SendAsync(request);var body = JsonNode.Parse(await response.Content.ReadAsStringAsync())!;if (body["errors"] is JsonArray errors && errors.Count > 0){ Console.Error.WriteLine($"{errors[0]?["extensions"]?["code"]}: {errors[0]?["message"]}"); return 1;}Console.WriteLine(body["data"]?["deleteMcpConnector"]?.ToJsonString(new JsonSerializerOptions { WriteIndented = true }));return 0;# deleteMcpConnector: Remove an MCP connector. Workflow nodes that use it stop working.# Credential: Dashboard JWT (WETEL_JWT). Python 3.8+ with "requests".import jsonimport os
import requests
API_URL = os.environ.get("WETEL_API_URL", "https://api.wetel.dev/graphql")
QUERY = """mutation DeleteConnector($id: Int!) { deleteMcpConnector(id: $id)}"""
VARIABLES = { "id": 4,}
response = requests.post( API_URL, json={"query": QUERY, "variables": VARIABLES}, headers={ "x-huat-platform": "customer", "Authorization": "Bearer " + os.environ["WETEL_JWT"], }, timeout=30,)body = response.json()if body.get("errors"): error = body["errors"][0] raise SystemExit(f"{error.get('extensions', {}).get('code')}: {error['message']}")print(json.dumps(body["data"]["deleteMcpConnector"], indent=2))Responses
Success (HTTP 200)
{ "data": { "deleteMcpConnector": true }}NOT_FOUND: Not in your workspace (HTTP 200)
{ "errors": [ { "message": "Connector #4 not found", "locations": [ { "line": 2, "column": 3 } ], "path": [ "deleteMcpConnector" ], "extensions": { "code": "NOT_FOUND", "status": 404, "originalError": { "message": "Connector #4 not found", "error": "Not Found", "statusCode": 404 } } } ], "data": null}