Skip to content

Commit db4a960

Browse files
authored
Merge pull request #2 from HJianBo/add-connector-tools
Add list_connectors MCP Tool
2 parents 12afe74 + b6f4f8d commit db4a960

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

priv/tools_definition/emqx_api_wrappers.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
"type": "object"
2020
}
2121
},
22+
"list_connectors": {
23+
"description": "Get a list of all connectors configured in EMQX. Each connector has a Connector ID (as the 'id' field) in format of {type}:{name}. Each connector can be either enabled or disabled, indicated by the 'enable' field. The response also includes connector type, name, status and other configuration details.",
24+
"inputSchema": {}
25+
},
2226
"list_authenticators": {
2327
"description": "Get a list of authenticators configured in EMQX. Each has an Authenticator ID (as the 'id' field) in format of {mechanism}:{backend}. Each authenticator can be either enabled or disabled, indicated by the 'enable' field.",
2428
"inputSchema": {}

rebar.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111

1212
{project_plugins, [{erlfmt, "1.6.0"}]}.
1313

14-
{erl_opts, [warnings_as_errors, debug_info, {d, plugin_rel_vsn, "0.0.6"}]}.
14+
{erl_opts, [warnings_as_errors, debug_info, {d, plugin_rel_vsn, "0.0.7"}]}.
1515

1616
%% this is the release version, different from app vsn in .app file
1717
{relx, [
18-
{release, {emqx_mcp_tools, "0.0.6"}, [
18+
{release, {emqx_mcp_tools, "0.0.7"}, [
1919
emqx_mcp_tools,
2020
emqx_plugin_helper,
2121
mcp_mqtt_erl

src/emqx_mcp_tools.app.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{application, emqx_mcp_tools, [
22
{description, "An EMQX Plugin that provides some useful tools via MCP over MQTT."},
3-
{vsn, "0.0.6"},
3+
{vsn, "0.0.7"},
44
{modules, []},
55
{registered, [emqx_mcp_tools_sup]},
66
{applications, [kernel, stdlib, emqtt, emqx_plugin_helper, mcp_mqtt_erl]},

src/emqx_mcp_tools_server.erl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ do_call_tool(<<"emqx_connector_info">>, Args, LoopData) ->
134134
ConnectorId = get_required(<<"id">>, Args),
135135
Result = emqx_connector_api:'/connectors/:id'(get, #{bindings => #{id => ConnectorId}}),
136136
handle_http_api_result(Result, LoopData);
137+
do_call_tool(<<"list_connectors">>, _Args, LoopData) ->
138+
Result = emqx_connector_api:'/connectors'(get, #{}),
139+
handle_http_api_result(Result, LoopData);
137140
do_call_tool(<<"list_authenticators">>, _Args, LoopData) ->
138141
Result = emqx_authn_api:authenticators(get, #{}),
139142
handle_http_api_result(Result, LoopData);

0 commit comments

Comments
 (0)