@@ -25,7 +25,7 @@ const n8nApi = axios.create({
2525// Create MCP server with modern SDK 1.17.0 API
2626const server = new McpServer ( {
2727 name : "n8n-workflow-builder" ,
28- version : "0.10.2 "
28+ version : "0.10.3 "
2929} ) ;
3030
3131// Register workflow management tools using modern MCP SDK 1.17.0 API
@@ -35,7 +35,7 @@ server.tool(
3535 { } ,
3636 async ( ) => {
3737 try {
38- const response = await n8nApi . get ( '/api/v1/ workflows' ) ;
38+ const response = await n8nApi . get ( '/workflows' ) ;
3939 return {
4040 content : [ {
4141 type : "text" ,
@@ -68,7 +68,7 @@ server.tool(
6868 } ,
6969 async ( { workflow } ) => {
7070 try {
71- const response = await n8nApi . post ( '/api/v1/ workflows' , workflow ) ;
71+ const response = await n8nApi . post ( '/workflows' , workflow ) ;
7272 return {
7373 content : [ {
7474 type : "text" ,
@@ -95,7 +95,7 @@ server.tool(
9595 } ,
9696 async ( { id } ) => {
9797 try {
98- const response = await n8nApi . get ( `/api/v1/ workflows/${ id } ` ) ;
98+ const response = await n8nApi . get ( `/workflows/${ id } ` ) ;
9999 return {
100100 content : [ {
101101 type : "text" ,
@@ -129,7 +129,7 @@ server.tool(
129129 } ,
130130 async ( { id, workflow } ) => {
131131 try {
132- const response = await n8nApi . put ( `/api/v1/ workflows/${ id } ` , workflow ) ;
132+ const response = await n8nApi . put ( `/workflows/${ id } ` , workflow ) ;
133133 return {
134134 content : [ {
135135 type : "text" ,
@@ -156,7 +156,7 @@ server.tool(
156156 } ,
157157 async ( { id } ) => {
158158 try {
159- const response = await n8nApi . delete ( `/api/v1/ workflows/${ id } ` ) ;
159+ const response = await n8nApi . delete ( `/workflows/${ id } ` ) ;
160160 return {
161161 content : [ {
162162 type : "text" ,
@@ -187,7 +187,7 @@ server.tool(
187187 } ,
188188 async ( { id } ) => {
189189 try {
190- const response = await n8nApi . post ( `/api/v1/ workflows/${ id } /activate` ) ;
190+ const response = await n8nApi . post ( `/workflows/${ id } /activate` ) ;
191191 return {
192192 content : [ {
193193 type : "text" ,
@@ -218,7 +218,7 @@ server.tool(
218218 } ,
219219 async ( { id } ) => {
220220 try {
221- const response = await n8nApi . post ( `/api/v1/ workflows/${ id } /deactivate` ) ;
221+ const response = await n8nApi . post ( `/workflows/${ id } /deactivate` ) ;
222222 return {
223223 content : [ {
224224 type : "text" ,
@@ -249,7 +249,7 @@ server.tool(
249249 } ,
250250 async ( { id } ) => {
251251 try {
252- const response = await n8nApi . post ( `/api/v1/ workflows/${ id } /execute` ) ;
252+ const response = await n8nApi . post ( `/workflows/${ id } /execute` ) ;
253253 return {
254254 content : [ {
255255 type : "text" ,
@@ -287,11 +287,11 @@ server.tool(
287287 async ( { workflow } ) => {
288288 try {
289289 // First create the workflow
290- const createResponse = await n8nApi . post ( '/api/v1/ workflows' , workflow ) ;
290+ const createResponse = await n8nApi . post ( '/workflows' , workflow ) ;
291291 const workflowId = createResponse . data . id ;
292292
293293 // Then activate it
294- const activateResponse = await n8nApi . post ( `/api/v1/ workflows/${ workflowId } /activate` ) ;
294+ const activateResponse = await n8nApi . post ( `/workflows/${ workflowId } /activate` ) ;
295295
296296 return {
297297 content : [ {
@@ -338,7 +338,7 @@ server.tool(
338338 if ( limit ) params . append ( 'limit' , limit . toString ( ) ) ;
339339 if ( cursor ) params . append ( 'cursor' , cursor ) ;
340340
341- const response = await n8nApi . get ( `/api/v1/ executions?${ params . toString ( ) } ` ) ;
341+ const response = await n8nApi . get ( `/executions?${ params . toString ( ) } ` ) ;
342342 return {
343343 content : [ {
344344 type : "text" ,
@@ -369,7 +369,7 @@ server.tool(
369369 const params = new URLSearchParams ( ) ;
370370 if ( includeData !== undefined ) params . append ( 'includeData' , includeData . toString ( ) ) ;
371371
372- const url = `/api/v1/ executions/${ id } ${ params . toString ( ) ? `?${ params . toString ( ) } ` : '' } ` ;
372+ const url = `/executions/${ id } ${ params . toString ( ) ? `?${ params . toString ( ) } ` : '' } ` ;
373373 const response = await n8nApi . get ( url ) ;
374374 return {
375375 content : [ {
@@ -397,7 +397,7 @@ server.tool(
397397 } ,
398398 async ( { id } ) => {
399399 try {
400- const response = await n8nApi . delete ( `/api/v1/ executions/${ id } ` ) ;
400+ const response = await n8nApi . delete ( `/executions/${ id } ` ) ;
401401 return {
402402 content : [ {
403403 type : "text" ,
@@ -435,7 +435,7 @@ server.tool(
435435 if ( limit ) params . append ( 'limit' , limit . toString ( ) ) ;
436436 if ( cursor ) params . append ( 'cursor' , cursor ) ;
437437
438- const response = await n8nApi . get ( `/api/v1/ tags?${ params . toString ( ) } ` ) ;
438+ const response = await n8nApi . get ( `/tags?${ params . toString ( ) } ` ) ;
439439 return {
440440 content : [ {
441441 type : "text" ,
@@ -462,7 +462,7 @@ server.tool(
462462 } ,
463463 async ( { name } ) => {
464464 try {
465- const response = await n8nApi . post ( '/api/v1/ tags' , { name } ) ;
465+ const response = await n8nApi . post ( '/tags' , { name } ) ;
466466 return {
467467 content : [ {
468468 type : "text" ,
@@ -493,7 +493,7 @@ server.tool(
493493 } ,
494494 async ( { id } ) => {
495495 try {
496- const response = await n8nApi . get ( `/api/v1/ tags/${ id } ` ) ;
496+ const response = await n8nApi . get ( `/tags/${ id } ` ) ;
497497 return {
498498 content : [ {
499499 type : "text" ,
@@ -525,7 +525,7 @@ server.tool(
525525 } ,
526526 async ( { id, name } ) => {
527527 try {
528- const response = await n8nApi . put ( `/api/v1/ tags/${ id } ` , { name } ) ;
528+ const response = await n8nApi . put ( `/tags/${ id } ` , { name } ) ;
529529 return {
530530 content : [ {
531531 type : "text" ,
@@ -556,7 +556,7 @@ server.tool(
556556 } ,
557557 async ( { id } ) => {
558558 try {
559- const response = await n8nApi . delete ( `/api/v1/ tags/${ id } ` ) ;
559+ const response = await n8nApi . delete ( `/tags/${ id } ` ) ;
560560 return {
561561 content : [ {
562562 type : "text" ,
@@ -587,7 +587,7 @@ server.tool(
587587 } ,
588588 async ( { workflowId } ) => {
589589 try {
590- const response = await n8nApi . get ( `/api/v1/ workflows/${ workflowId } /tags` ) ;
590+ const response = await n8nApi . get ( `/workflows/${ workflowId } /tags` ) ;
591591 return {
592592 content : [ {
593593 type : "text" ,
@@ -620,7 +620,7 @@ server.tool(
620620 } ,
621621 async ( { workflowId, tagIds } ) => {
622622 try {
623- const response = await n8nApi . put ( `/api/v1/ workflows/${ workflowId } /tags` , { tagIds } ) ;
623+ const response = await n8nApi . put ( `/workflows/${ workflowId } /tags` , { tagIds } ) ;
624624 return {
625625 content : [ {
626626 type : "text" ,
@@ -655,7 +655,7 @@ server.tool(
655655 } ,
656656 async ( { name, type, data } ) => {
657657 try {
658- const response = await n8nApi . post ( '/api/v1/ credentials' , {
658+ const response = await n8nApi . post ( '/credentials' , {
659659 name,
660660 type,
661661 data
@@ -695,7 +695,7 @@ server.tool(
695695 } ,
696696 async ( { credentialType } ) => {
697697 try {
698- const response = await n8nApi . get ( `/api/v1/ credentials/schema/${ credentialType } ` ) ;
698+ const response = await n8nApi . get ( `/credentials/schema/${ credentialType } ` ) ;
699699 return {
700700 content : [ {
701701 type : "text" ,
@@ -727,7 +727,7 @@ server.tool(
727727 } ,
728728 async ( { id } ) => {
729729 try {
730- const response = await n8nApi . delete ( `/api/v1/ credentials/${ id } ` ) ;
730+ const response = await n8nApi . delete ( `/credentials/${ id } ` ) ;
731731 return {
732732 content : [ {
733733 type : "text" ,
@@ -773,7 +773,7 @@ server.tool(
773773 }
774774 }
775775
776- const response = await n8nApi . post ( '/api/v1/ audit' , auditPayload ) ;
776+ const response = await n8nApi . post ( '/audit' , auditPayload ) ;
777777 return {
778778 content : [ {
779779 type : "text" ,
@@ -800,7 +800,7 @@ server.tool(
800800async function main ( ) {
801801 const transport = new StdioServerTransport ( ) ;
802802 await server . connect ( transport ) ;
803- console . error ( "N8N Workflow Builder MCP server v0.10.2 running on stdio" ) ;
803+ console . error ( "N8N Workflow Builder MCP server v0.10.3 running on stdio" ) ;
804804 console . error ( "Modern SDK 1.17.0 with 23 tools: 9 workflow + 3 execution + 7 tag + 3 credential + 1 audit" ) ;
805805}
806806
0 commit comments