@@ -41,6 +41,27 @@ const ACCEPTED_TOOLS = [
4141 'webhooks.configureInbound' ,
4242] ;
4343
44+ // Mapping from MCP tool names to their actual actions configuration
45+ const TOOL_ACTIONS_MAP : { [ key : string ] : { [ resource : string ] : { [ action : string ] : boolean } } } = {
46+ 'messaging.send' : { messaging : { create : true } } ,
47+ 'messaging.sendAwesomeTemplate' : { messaging : { create : true } } ,
48+ 'messaging.getStatus' : { messaging : { read : true } } ,
49+ 'messaging.getReplies' : { messaging : { read : true } } ,
50+ 'templates.list' : { templates : { read : true } } ,
51+ 'templates.create' : { templates : { create : true } } ,
52+ 'templates.update' : { templates : { update : true } } ,
53+ 'templates.delete' : { templates : { delete : true } } ,
54+ 'templates.publish' : { templates : { update : true } } ,
55+ 'users.add' : { users : { create : true } } ,
56+ 'users.update' : { users : { update : true } } ,
57+ 'users.delete' : { users : { delete : true } } ,
58+ 'workflows.trigger' : { workflows : { trigger : true } } ,
59+ 'workflows.triggerBulk' : { workflows : { trigger : true } } ,
60+ 'workflows.schedule' : { workflows : { schedule : true } } ,
61+ 'webhooks.configureNotification' : { webhooks : { create : true } } ,
62+ 'webhooks.configureInbound' : { webhooks : { create : true } } ,
63+ } ;
64+
4465export function parseArgs ( args : string [ ] ) : Options {
4566 const options : Options = { } ;
4667
@@ -111,19 +132,27 @@ export async function main() {
111132
112133 if ( selectedTools . includes ( 'all' ) ) {
113134 ACCEPTED_TOOLS . forEach ( ( tool ) => {
114- const [ resource , action ] = tool . split ( '.' ) ;
115- configuration . actions [ resource ] = {
116- ...configuration . actions [ resource ] ,
117- [ action ] : true ,
118- } ;
135+ const toolActions = TOOL_ACTIONS_MAP [ tool ] ;
136+ if ( toolActions ) {
137+ Object . keys ( toolActions ) . forEach ( ( resource ) => {
138+ configuration . actions [ resource ] = {
139+ ...configuration . actions [ resource ] ,
140+ ...toolActions [ resource ] ,
141+ } ;
142+ } ) ;
143+ }
119144 } ) ;
120145 } else {
121146 selectedTools . forEach ( ( tool : any ) => {
122- const [ resource , action ] = tool . split ( '.' ) ;
123- configuration . actions [ resource ] = {
124- ...configuration . actions [ resource ] ,
125- [ action ] : true ,
126- } ;
147+ const toolActions = TOOL_ACTIONS_MAP [ tool ] ;
148+ if ( toolActions ) {
149+ Object . keys ( toolActions ) . forEach ( ( resource ) => {
150+ configuration . actions [ resource ] = {
151+ ...configuration . actions [ resource ] ,
152+ ...toolActions [ resource ] ,
153+ } ;
154+ } ) ;
155+ }
127156 } ) ;
128157 }
129158
0 commit comments