n8n-workflow-builder-mcp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/rules/cursor_rules.mdc +53 -0
- package/.cursor/rules/dev_workflow.mdc +219 -0
- package/.cursor/rules/mcp.mdc +430 -0
- package/.cursor/rules/self_improve.mdc +72 -0
- package/.cursor/rules/taskmaster.mdc +382 -0
- package/.cursorignore +1 -0
- package/.cursorrules +4 -0
- package/.env.example +23 -0
- package/.eslintrc.json +38 -0
- package/.github/workflows/npm-publish-github-packages.yml +55 -0
- package/.prettierrc +9 -0
- package/.roo/rules/dev_workflow.md +219 -0
- package/.roo/rules/mcp.md +430 -0
- package/.roo/rules/roo_rules.md +53 -0
- package/.roo/rules/self_improve.md +72 -0
- package/.roo/rules/taskmaster.md +382 -0
- package/.roo/rules-architect/architect-rules +93 -0
- package/.roo/rules-ask/ask-rules +89 -0
- package/.roo/rules-boomerang/boomerang-rules +181 -0
- package/.roo/rules-code/code-rules +61 -0
- package/.roo/rules-debug/debug-rules +68 -0
- package/.roo/rules-test/test-rules +61 -0
- package/.roomodes +63 -0
- package/.taskmasterconfig +31 -0
- package/.windsurfrules +2382 -0
- package/LICENSE +21 -0
- package/README.md +210 -0
- package/config/credentials/credentials.json +1 -0
- package/config/default.js +41 -0
- package/package.json +56 -0
- package/scripts/demo-n8n-integration.js +161 -0
- package/scripts/demo-workflow-generator.js +102 -0
- package/scripts/init.sh +36 -0
- package/scripts/prd.txt +197 -0
- package/src/index.ts +1440 -0
- package/src/middleware/auth.js +273 -0
- package/src/middleware/authorize.js +183 -0
- package/src/middleware/logging.js +64 -0
- package/src/middleware/mcp.js +187 -0
- package/src/middleware/rateLimiter.js +82 -0
- package/src/middleware/validation.js +241 -0
- package/src/models/credential.js +359 -0
- package/src/models/llmService.js +236 -0
- package/src/models/n8nIntegration.js +542 -0
- package/src/models/storage.js +196 -0
- package/src/models/tool.js +148 -0
- package/src/models/user.js +164 -0
- package/src/models/workflow.js +229 -0
- package/src/routes/toolDefinitions.js +62 -0
- package/src/routes/toolExecution.js +79 -0
- package/src/tools/__index.js +242 -0
- package/src/tools/connectionManagement.js +500 -0
- package/src/tools/n8nIntegration.js +370 -0
- package/src/tools/nodeDiscovery.js +488 -0
- package/src/tools/nodeManagement.js +674 -0
- package/src/tools/toolDefinitions.js +660 -0
- package/src/tools/workflowCreation.js +100 -0
- package/src/tools/workflowGenerator.js +152 -0
- package/src/tools/workflowStorage.js +113 -0
- package/src/tools/workflowTesting.js +285 -0
- package/src/utils/encryption.js +164 -0
- package/src/utils/logger.js +84 -0
- package/src/utils/mcp.js +85 -0
- package/src/utils/securityLogger.js +109 -0
- package/tests/auth.test.js +402 -0
- package/tests/authorize.test.js +208 -0
- package/tests/run-memory-tests.js +55 -0
- package/tests/run-tests.js +55 -0
- package/tests/server.test.js +203 -0
- package/tests/unit/add-ai-connections.test.js +385 -0
- package/tests/unit/connectionManagement.test.js +309 -0
- package/tests/unit/langchain-llm-format.test.js +259 -0
- package/tests/unit/memory-connection.test.js +140 -0
- package/tests/unit/memory-integration.test.js +253 -0
- package/tests/unit/n8nIntegration.test.js +291 -0
- package/tests/unit/nodeDiscovery.test.js +270 -0
- package/tests/unit/nodeManagement.test.js +522 -0
- package/tests/unit/utils/mcp-test-utils.js +94 -0
- package/tests/unit/workflowCreation.test.js +110 -0
- package/tests/unit/workflowTesting.test.js +269 -0
- package/tests/user.test.js +181 -0
- package/tsconfig.json +20 -0
- package/workflow_nodes/Brandfetch.json +85 -0
- package/workflow_nodes/WorkflowTrigger.json +28 -0
- package/workflow_nodes/actionNetwork.json +218 -0
- package/workflow_nodes/activeCampaign.json +722 -0
- package/workflow_nodes/activeCampaignTrigger.json +52 -0
- package/workflow_nodes/acuitySchedulingTrigger.json +8 -0
- package/workflow_nodes/adalo.json +123 -0
- package/workflow_nodes/affinity.json +203 -0
- package/workflow_nodes/affinityTrigger.json +124 -0
- package/workflow_nodes/aggregate.json +119 -0
- package/workflow_nodes/agileCrm.json +503 -0
- package/workflow_nodes/aiTransform.json +17 -0
- package/workflow_nodes/airtable.json +226 -0
- package/workflow_nodes/airtableTrigger.json +120 -0
- package/workflow_nodes/airtop.json +10 -0
- package/workflow_nodes/amqp.json +62 -0
- package/workflow_nodes/amqpTrigger.json +8 -0
- package/workflow_nodes/apiTemplateIo.json +147 -0
- package/workflow_nodes/asana.json +446 -0
- package/workflow_nodes/asanaTrigger.json +52 -0
- package/workflow_nodes/automizy.json +195 -0
- package/workflow_nodes/autopilot.json +287 -0
- package/workflow_nodes/autopilotTrigger.json +8 -0
- package/workflow_nodes/awsCertificateManager.json +223 -0
- package/workflow_nodes/awsComprehend.json +125 -0
- package/workflow_nodes/awsDynamoDb.json +251 -0
- package/workflow_nodes/awsElb.json +174 -0
- package/workflow_nodes/awsLambda.json +69 -0
- package/workflow_nodes/awsRekognition.json +191 -0
- package/workflow_nodes/awsS3.json +32 -0
- package/workflow_nodes/awsSes.json +302 -0
- package/workflow_nodes/awsSns.json +110 -0
- package/workflow_nodes/awsSnsTrigger.json +47 -0
- package/workflow_nodes/awsSqs.json +140 -0
- package/workflow_nodes/awsTextract.json +43 -0
- package/workflow_nodes/awsTranscribe.json +217 -0
- package/workflow_nodes/azureCosmosDb.json +8 -0
- package/workflow_nodes/azureStorage.json +17 -0
- package/workflow_nodes/bambooHr.json +8 -0
- package/workflow_nodes/bannerbear.json +126 -0
- package/workflow_nodes/baserow.json +277 -0
- package/workflow_nodes/beeminder.json +146 -0
- package/workflow_nodes/bitbucketTrigger.json +62 -0
- package/workflow_nodes/bitly.json +130 -0
- package/workflow_nodes/bitwarden.json +224 -0
- package/workflow_nodes/box.json +457 -0
- package/workflow_nodes/boxTrigger.json +8 -0
- package/workflow_nodes/brevo.json +41 -0
- package/workflow_nodes/brevoTrigger.json +145 -0
- package/workflow_nodes/bubble.json +212 -0
- package/workflow_nodes/calTrigger.json +91 -0
- package/workflow_nodes/calendlyTrigger.json +71 -0
- package/workflow_nodes/chargebee.json +217 -0
- package/workflow_nodes/chargebeeTrigger.json +187 -0
- package/workflow_nodes/circleCi.json +89 -0
- package/workflow_nodes/ciscoWebex.json +593 -0
- package/workflow_nodes/ciscoWebexTrigger.json +159 -0
- package/workflow_nodes/clearbit.json +138 -0
- package/workflow_nodes/clickUp.json +793 -0
- package/workflow_nodes/clickUpTrigger.json +188 -0
- package/workflow_nodes/clockify.json +372 -0
- package/workflow_nodes/clockifyTrigger.json +26 -0
- package/workflow_nodes/cloudflare.json +103 -0
- package/workflow_nodes/cockpit.json +161 -0
- package/workflow_nodes/coda.json +242 -0
- package/workflow_nodes/code.json +40 -0
- package/workflow_nodes/coinGecko.json +363 -0
- package/workflow_nodes/compareDatasets.json +14 -0
- package/workflow_nodes/compression.json +66 -0
- package/workflow_nodes/contentful.json +29 -0
- package/workflow_nodes/convertKit.json +159 -0
- package/workflow_nodes/convertKitTrigger.json +109 -0
- package/workflow_nodes/convertToFile.json +64 -0
- package/workflow_nodes/copper.json +239 -0
- package/workflow_nodes/copperTrigger.json +8 -0
- package/workflow_nodes/cortex.json +348 -0
- package/workflow_nodes/crateDb.json +90 -0
- package/workflow_nodes/cron.json +23 -0
- package/workflow_nodes/crowdDev.json +8 -0
- package/workflow_nodes/crowdDevTrigger.json +8 -0
- package/workflow_nodes/crypto.json +147 -0
- package/workflow_nodes/customerIo.json +206 -0
- package/workflow_nodes/customerIoTrigger.json +185 -0
- package/workflow_nodes/dateTime.json +39 -0
- package/workflow_nodes/debughelper.json +162 -0
- package/workflow_nodes/deepL.json +103 -0
- package/workflow_nodes/demio.json +187 -0
- package/workflow_nodes/dhl.json +53 -0
- package/workflow_nodes/discord.json +81 -0
- package/workflow_nodes/discourse.json +319 -0
- package/workflow_nodes/disqus.json +254 -0
- package/workflow_nodes/drift.json +112 -0
- package/workflow_nodes/dropbox.json +258 -0
- package/workflow_nodes/dropcontact.json +154 -0
- package/workflow_nodes/e2eTest.json +70 -0
- package/workflow_nodes/editImage.json +132 -0
- package/workflow_nodes/egoi.json +220 -0
- package/workflow_nodes/elasticSecurity.json +401 -0
- package/workflow_nodes/elasticsearch.json +422 -0
- package/workflow_nodes/emailReadImap.json +88 -0
- package/workflow_nodes/emailSend.json +38 -0
- package/workflow_nodes/emelia.json +201 -0
- package/workflow_nodes/emeliaTrigger.json +57 -0
- package/workflow_nodes/erpNext.json +139 -0
- package/workflow_nodes/errorTrigger.json +15 -0
- package/workflow_nodes/evaluationMetrics.json +21 -0
- package/workflow_nodes/eventbriteTrigger.json +125 -0
- package/workflow_nodes/executeCommand.json +25 -0
- package/workflow_nodes/executeWorkflow.json +102 -0
- package/workflow_nodes/executeWorkflowTrigger.json +65 -0
- package/workflow_nodes/executionData.json +35 -0
- package/workflow_nodes/extractFromFile.json +71 -0
- package/workflow_nodes/facebookGraphApi.json +234 -0
- package/workflow_nodes/facebookLeadAdsTrigger.json +8 -0
- package/workflow_nodes/facebookTrigger.json +112 -0
- package/workflow_nodes/figmaTrigger.json +8 -0
- package/workflow_nodes/filemaker.json +268 -0
- package/workflow_nodes/filter.json +24 -0
- package/workflow_nodes/flow.json +323 -0
- package/workflow_nodes/flowTrigger.json +52 -0
- package/workflow_nodes/form.json +25 -0
- package/workflow_nodes/formIoTrigger.json +59 -0
- package/workflow_nodes/formTrigger.json +8 -0
- package/workflow_nodes/formstackTrigger.json +8 -0
- package/workflow_nodes/freshdesk.json +584 -0
- package/workflow_nodes/freshservice.json +899 -0
- package/workflow_nodes/freshworksCrm.json +772 -0
- package/workflow_nodes/ftp.json +127 -0
- package/workflow_nodes/function.json +22 -0
- package/workflow_nodes/functionItem.json +22 -0
- package/workflow_nodes/gSuiteAdmin.json +562 -0
- package/workflow_nodes/getResponse.json +310 -0
- package/workflow_nodes/getResponseTrigger.json +82 -0
- package/workflow_nodes/ghost.json +290 -0
- package/workflow_nodes/git.json +184 -0
- package/workflow_nodes/github.json +732 -0
- package/workflow_nodes/githubTrigger.json +317 -0
- package/workflow_nodes/gitlab.json +544 -0
- package/workflow_nodes/gitlabTrigger.json +61 -0
- package/workflow_nodes/gmail.json +62 -0
- package/workflow_nodes/gmailTrigger.json +127 -0
- package/workflow_nodes/goToWebinar.json +430 -0
- package/workflow_nodes/gong.json +22 -0
- package/workflow_nodes/googleAds.json +116 -0
- package/workflow_nodes/googleAnalytics.json +28 -0
- package/workflow_nodes/googleBigQuery.json +38 -0
- package/workflow_nodes/googleBooks.json +154 -0
- package/workflow_nodes/googleBusinessProfile.json +277 -0
- package/workflow_nodes/googleBusinessProfileTrigger.json +55 -0
- package/workflow_nodes/googleCalendar.json +474 -0
- package/workflow_nodes/googleCalendarTrigger.json +72 -0
- package/workflow_nodes/googleChat.json +187 -0
- package/workflow_nodes/googleCloudNaturalLanguage.json +171 -0
- package/workflow_nodes/googleCloudStorage.json +466 -0
- package/workflow_nodes/googleContacts.json +481 -0
- package/workflow_nodes/googleDocs.json +312 -0
- package/workflow_nodes/googleDrive.json +920 -0
- package/workflow_nodes/googleDriveTrigger.json +181 -0
- package/workflow_nodes/googleFirebaseCloudFirestore.json +156 -0
- package/workflow_nodes/googleFirebaseRealtimeDatabase.json +75 -0
- package/workflow_nodes/googlePerspective.json +94 -0
- package/workflow_nodes/googleSheets.json +98 -0
- package/workflow_nodes/googleSheetsTrigger.json +192 -0
- package/workflow_nodes/googleSlides.json +186 -0
- package/workflow_nodes/googleTasks.json +198 -0
- package/workflow_nodes/googleTranslate.json +80 -0
- package/workflow_nodes/gotify.json +110 -0
- package/workflow_nodes/grafana.json +155 -0
- package/workflow_nodes/graphql.json +165 -0
- package/workflow_nodes/grist.json +13 -0
- package/workflow_nodes/gumroadTrigger.json +8 -0
- package/workflow_nodes/hackerNews.json +100 -0
- package/workflow_nodes/haloPSA.json +286 -0
- package/workflow_nodes/harvest.json +699 -0
- package/workflow_nodes/helpScout.json +629 -0
- package/workflow_nodes/helpScoutTrigger.json +8 -0
- package/workflow_nodes/highLevel.json +8 -0
- package/workflow_nodes/homeAssistant.json +201 -0
- package/workflow_nodes/html.json +118 -0
- package/workflow_nodes/htmlExtract.json +87 -0
- package/workflow_nodes/httpRequest.json +472 -0
- package/workflow_nodes/hubspot.json +62 -0
- package/workflow_nodes/hubspotTrigger.json +138 -0
- package/workflow_nodes/humanticAi.json +82 -0
- package/workflow_nodes/hunter.json +168 -0
- package/workflow_nodes/iCal.json +20 -0
- package/workflow_nodes/if.json +24 -0
- package/workflow_nodes/intercom.json +335 -0
- package/workflow_nodes/interval.json +8 -0
- package/workflow_nodes/invoiceNinja.json +882 -0
- package/workflow_nodes/invoiceNinjaTrigger.json +11 -0
- package/workflow_nodes/itemLists.json +313 -0
- package/workflow_nodes/iterable.json +168 -0
- package/workflow_nodes/jenkins.json +172 -0
- package/workflow_nodes/jira.json +529 -0
- package/workflow_nodes/jiraTrigger.json +308 -0
- package/workflow_nodes/jotFormTrigger.json +44 -0
- package/workflow_nodes/jwt.json +195 -0
- package/workflow_nodes/kafka.json +132 -0
- package/workflow_nodes/kafkaTrigger.json +11 -0
- package/workflow_nodes/keap.json +915 -0
- package/workflow_nodes/keapTrigger.json +37 -0
- package/workflow_nodes/kitemaker.json +153 -0
- package/workflow_nodes/koBoToolbox.json +337 -0
- package/workflow_nodes/koBoToolboxTrigger.json +8 -0
- package/workflow_nodes/langchain_Summarization Chain.json +60 -0
- package/workflow_nodes/langchain_agent.json +145 -0
- package/workflow_nodes/langchain_allowFileUploads.json +180 -0
- package/workflow_nodes/langchain_chainLlm.json +16 -0
- package/workflow_nodes/langchain_chainSummarization.json +119 -0
- package/workflow_nodes/langchain_code.json +62 -0
- package/workflow_nodes/langchain_documentBinaryInputLoader.json +8 -0
- package/workflow_nodes/langchain_documentDefaultDataLoader.json +8 -0
- package/workflow_nodes/langchain_documentGithubLoader.json +8 -0
- package/workflow_nodes/langchain_documentJsonInputLoader.json +8 -0
- package/workflow_nodes/langchain_embeddingDimensions.json +17 -0
- package/workflow_nodes/langchain_embeddingsAwsBedrock.json +8 -0
- package/workflow_nodes/langchain_embeddingsAzureOpenAi.json +151 -0
- package/workflow_nodes/langchain_embeddingsCohere.json +8 -0
- package/workflow_nodes/langchain_embeddingsGoogleGemini.json +8 -0
- package/workflow_nodes/langchain_embeddingsGoogleVertex.json +8 -0
- package/workflow_nodes/langchain_embeddingsHuggingFaceInference.json +8 -0
- package/workflow_nodes/langchain_embeddingsMistralCloud.json +8 -0
- package/workflow_nodes/langchain_embeddingsOllama.json +8 -0
- package/workflow_nodes/langchain_informationExtractor.json +81 -0
- package/workflow_nodes/langchain_lmChatAwsBedrock.json +8 -0
- package/workflow_nodes/langchain_lmChatAzureOpenAi.json +151 -0
- package/workflow_nodes/langchain_lmChatDeepSeek.json +10 -0
- package/workflow_nodes/langchain_lmChatGoogleGemini.json +31 -0
- package/workflow_nodes/langchain_lmChatGoogleVertex.json +32 -0
- package/workflow_nodes/langchain_lmChatGroq.json +8 -0
- package/workflow_nodes/langchain_lmChatMistralCloud.json +8 -0
- package/workflow_nodes/langchain_lmChatOllama.json +8 -0
- package/workflow_nodes/langchain_lmChatOpenAi.json +155 -0
- package/workflow_nodes/langchain_lmChatOpenRouter.json +10 -0
- package/workflow_nodes/langchain_lmChatXAiGrok.json +10 -0
- package/workflow_nodes/langchain_lmCohere.json +8 -0
- package/workflow_nodes/langchain_lmOllama.json +8 -0
- package/workflow_nodes/langchain_lmOpenAi.json +251 -0
- package/workflow_nodes/langchain_lmOpenHuggingFaceInference.json +8 -0
- package/workflow_nodes/langchain_manualChatTrigger.json +11 -0
- package/workflow_nodes/langchain_mcpClientTool.json +86 -0
- package/workflow_nodes/langchain_mcpTrigger.json +8 -0
- package/workflow_nodes/langchain_memoryBufferWindow.json +13 -0
- package/workflow_nodes/langchain_memoryChatRetriever.json +22 -0
- package/workflow_nodes/langchain_memoryManager.json +106 -0
- package/workflow_nodes/langchain_memoryMongoDbChat.json +10 -0
- package/workflow_nodes/langchain_memoryMotorhead.json +13 -0
- package/workflow_nodes/langchain_memoryPostgresChat.json +13 -0
- package/workflow_nodes/langchain_memoryRedisChat.json +15 -0
- package/workflow_nodes/langchain_memoryXata.json +14 -0
- package/workflow_nodes/langchain_memoryZep.json +13 -0
- package/workflow_nodes/langchain_model.json +155 -0
- package/workflow_nodes/langchain_mongoCollection.json +16 -0
- package/workflow_nodes/langchain_notice.json +22 -0
- package/workflow_nodes/langchain_openAiAssistant.json +132 -0
- package/workflow_nodes/langchain_options.json +17 -0
- package/workflow_nodes/langchain_outputParserAutofixing.json +8 -0
- package/workflow_nodes/langchain_outputParserItemList.json +8 -0
- package/workflow_nodes/langchain_outputParserStructured.json +12 -0
- package/workflow_nodes/langchain_pineconeNamespace.json +16 -0
- package/workflow_nodes/langchain_queryName.json +16 -0
- package/workflow_nodes/langchain_retrieverContextualCompression.json +8 -0
- package/workflow_nodes/langchain_retrieverMultiQuery.json +8 -0
- package/workflow_nodes/langchain_retrieverVectorStore.json +8 -0
- package/workflow_nodes/langchain_retrieverWorkflow.json +103 -0
- package/workflow_nodes/langchain_sentimentAnalysis.json +52 -0
- package/workflow_nodes/langchain_systemPromptTemplate.json +47 -0
- package/workflow_nodes/langchain_tableName.json +23 -0
- package/workflow_nodes/langchain_textClassifier.json +66 -0
- package/workflow_nodes/langchain_textSplitterCharacterTextSplitter.json +8 -0
- package/workflow_nodes/langchain_textSplitterRecursiveCharacterTextSplitter.json +8 -0
- package/workflow_nodes/langchain_textSplitterTokenSplitter.json +8 -0
- package/workflow_nodes/langchain_toolCalculator.json +8 -0
- package/workflow_nodes/langchain_toolCode.json +12 -0
- package/workflow_nodes/langchain_toolHttpRequest.json +232 -0
- package/workflow_nodes/langchain_toolSearXng.json +8 -0
- package/workflow_nodes/langchain_toolSerpApi.json +8 -0
- package/workflow_nodes/langchain_toolThink.json +8 -0
- package/workflow_nodes/langchain_toolVectorStore.json +11 -0
- package/workflow_nodes/langchain_toolWikipedia.json +8 -0
- package/workflow_nodes/langchain_toolWolframAlpha.json +8 -0
- package/workflow_nodes/langchain_toolWorkflow.json +8 -0
- package/workflow_nodes/langchain_vectorStoreInMemoryInsert.json +29 -0
- package/workflow_nodes/langchain_vectorStoreInMemoryLoad.json +8 -0
- package/workflow_nodes/langchain_vectorStorePineconeInsert.json +37 -0
- package/workflow_nodes/langchain_vectorStorePineconeLoad.json +8 -0
- package/workflow_nodes/langchain_vectorStoreSupabaseInsert.json +32 -0
- package/workflow_nodes/langchain_vectorStoreSupabaseLoad.json +8 -0
- package/workflow_nodes/langchain_vectorStoreZepInsert.json +46 -0
- package/workflow_nodes/langchain_vectorStoreZepLoad.json +8 -0
- package/workflow_nodes/ldap.json +182 -0
- package/workflow_nodes/lemlist.json +44 -0
- package/workflow_nodes/lemlistTrigger.json +45 -0
- package/workflow_nodes/limit.json +26 -0
- package/workflow_nodes/line.json +95 -0
- package/workflow_nodes/linear.json +151 -0
- package/workflow_nodes/linearTrigger.json +71 -0
- package/workflow_nodes/lingvaNex.json +66 -0
- package/workflow_nodes/linkedIn.json +142 -0
- package/workflow_nodes/localFileTrigger.json +120 -0
- package/workflow_nodes/lonescale.json +171 -0
- package/workflow_nodes/lonescaleTrigger.json +8 -0
- package/workflow_nodes/magento2.json +164 -0
- package/workflow_nodes/mailcheck.json +46 -0
- package/workflow_nodes/mailchimp.json +507 -0
- package/workflow_nodes/mailchimpTrigger.json +100 -0
- package/workflow_nodes/mailerLite.json +24 -0
- package/workflow_nodes/mailerLiteTrigger.json +74 -0
- package/workflow_nodes/mailgun.json +81 -0
- package/workflow_nodes/mailjet.json +201 -0
- package/workflow_nodes/mailjetTrigger.json +8 -0
- package/workflow_nodes/mandrill.json +372 -0
- package/workflow_nodes/manualTrigger.json +8 -0
- package/workflow_nodes/markdown.json +376 -0
- package/workflow_nodes/marketstack.json +126 -0
- package/workflow_nodes/matrix.json +264 -0
- package/workflow_nodes/mattermost.json +8 -0
- package/workflow_nodes/mautic.json +564 -0
- package/workflow_nodes/mauticTrigger.json +54 -0
- package/workflow_nodes/medium.json +209 -0
- package/workflow_nodes/merge.json +125 -0
- package/workflow_nodes/messageBird.json +182 -0
- package/workflow_nodes/metabase.json +175 -0
- package/workflow_nodes/microsoftDynamicsCrm.json +100 -0
- package/workflow_nodes/microsoftEntra.json +51 -0
- package/workflow_nodes/microsoftExcel.json +35 -0
- package/workflow_nodes/microsoftGraphSecurity.json +113 -0
- package/workflow_nodes/microsoftOneDrive.json +232 -0
- package/workflow_nodes/microsoftOneDriveTrigger.json +80 -0
- package/workflow_nodes/microsoftOutlook.json +40 -0
- package/workflow_nodes/microsoftOutlookTrigger.json +24 -0
- package/workflow_nodes/microsoftSql.json +81 -0
- package/workflow_nodes/microsoftTeams.json +36 -0
- package/workflow_nodes/microsoftToDo.json +181 -0
- package/workflow_nodes/mindee.json +86 -0
- package/workflow_nodes/misp.json +399 -0
- package/workflow_nodes/mocean.json +103 -0
- package/workflow_nodes/mondayCom.json +290 -0
- package/workflow_nodes/mongoDb.json +16 -0
- package/workflow_nodes/monicaCrm.json +543 -0
- package/workflow_nodes/moveBinaryData.json +121 -0
- package/workflow_nodes/mqtt.json +67 -0
- package/workflow_nodes/mqttTrigger.json +47 -0
- package/workflow_nodes/msg91.json +65 -0
- package/workflow_nodes/mySql.json +111 -0
- package/workflow_nodes/n8n.json +75 -0
- package/workflow_nodes/n8nTrigger.json +27 -0
- package/workflow_nodes/nasa.json +310 -0
- package/workflow_nodes/netlify.json +87 -0
- package/workflow_nodes/netlifyTrigger.json +68 -0
- package/workflow_nodes/netscalerAdc.json +243 -0
- package/workflow_nodes/nextCloud.json +312 -0
- package/workflow_nodes/noOp.json +8 -0
- package/workflow_nodes/nocoDb.json +276 -0
- package/workflow_nodes/notion.json +8 -0
- package/workflow_nodes/notionTrigger.json +75 -0
- package/workflow_nodes/npm.json +64 -0
- package/workflow_nodes/odoo.json +344 -0
- package/workflow_nodes/okta.json +97 -0
- package/workflow_nodes/oneSimpleApi.json +281 -0
- package/workflow_nodes/onfleet.json +316 -0
- package/workflow_nodes/onfleetTrigger.json +8 -0
- package/workflow_nodes/openAi.json +154 -0
- package/workflow_nodes/openThesaurus.json +81 -0
- package/workflow_nodes/openWeatherMap.json +129 -0
- package/workflow_nodes/orbit.json +375 -0
- package/workflow_nodes/oura.json +74 -0
- package/workflow_nodes/paddle.json +403 -0
- package/workflow_nodes/pagerDuty.json +351 -0
- package/workflow_nodes/payPal.json +196 -0
- package/workflow_nodes/payPalTrigger.json +40 -0
- package/workflow_nodes/peekalink.json +41 -0
- package/workflow_nodes/phantombuster.json +172 -0
- package/workflow_nodes/philipsHue.json +177 -0
- package/workflow_nodes/pipedrive.json +860 -0
- package/workflow_nodes/pipedriveTrigger.json +11 -0
- package/workflow_nodes/plivo.json +91 -0
- package/workflow_nodes/postHog.json +122 -0
- package/workflow_nodes/postbin.json +60 -0
- package/workflow_nodes/postgres.json +109 -0
- package/workflow_nodes/postgresTrigger.json +8 -0
- package/workflow_nodes/postmarkTrigger.json +72 -0
- package/workflow_nodes/profitWell.json +305 -0
- package/workflow_nodes/pushbullet.json +186 -0
- package/workflow_nodes/pushcut.json +75 -0
- package/workflow_nodes/pushcutTrigger.json +8 -0
- package/workflow_nodes/pushover.json +159 -0
- package/workflow_nodes/questDb.json +94 -0
- package/workflow_nodes/quickChart.json +188 -0
- package/workflow_nodes/quickbase.json +205 -0
- package/workflow_nodes/quickbooks.json +550 -0
- package/workflow_nodes/rabbitmq.json +165 -0
- package/workflow_nodes/rabbitmqTrigger.json +8 -0
- package/workflow_nodes/raindrop.json +216 -0
- package/workflow_nodes/readBinaryFile.json +26 -0
- package/workflow_nodes/readBinaryFiles.json +26 -0
- package/workflow_nodes/readPDF.json +31 -0
- package/workflow_nodes/readWriteFile.json +27 -0
- package/workflow_nodes/reddit.json +309 -0
- package/workflow_nodes/redis.json +183 -0
- package/workflow_nodes/redisTrigger.json +8 -0
- package/workflow_nodes/removeDuplicates.json +8 -0
- package/workflow_nodes/renameKeys.json +67 -0
- package/workflow_nodes/respondToWebhook.json +126 -0
- package/workflow_nodes/rocketchat.json +216 -0
- package/workflow_nodes/rssFeedRead.json +28 -0
- package/workflow_nodes/rssFeedReadTrigger.json +17 -0
- package/workflow_nodes/rundeck.json +79 -0
- package/workflow_nodes/s3.json +425 -0
- package/workflow_nodes/salesforce.json +1137 -0
- package/workflow_nodes/salesforceTrigger.json +122 -0
- package/workflow_nodes/salesmate.json +467 -0
- package/workflow_nodes/scheduleTrigger.json +270 -0
- package/workflow_nodes/seaTable.json +8 -0
- package/workflow_nodes/seaTableTrigger.json +87 -0
- package/workflow_nodes/securityScorecard.json +459 -0
- package/workflow_nodes/segment.json +219 -0
- package/workflow_nodes/sendGrid.json +359 -0
- package/workflow_nodes/sendy.json +225 -0
- package/workflow_nodes/sentryIo.json +426 -0
- package/workflow_nodes/serviceNow.json +544 -0
- package/workflow_nodes/set.json +124 -0
- package/workflow_nodes/shopify.json +707 -0
- package/workflow_nodes/shopifyTrigger.json +8 -0
- package/workflow_nodes/signl4.json +133 -0
- package/workflow_nodes/simulate.json +30 -0
- package/workflow_nodes/simulateTrigger.json +8 -0
- package/workflow_nodes/slack.json +62 -0
- package/workflow_nodes/slackTrigger.json +135 -0
- package/workflow_nodes/sms77.json +121 -0
- package/workflow_nodes/snowflake.json +65 -0
- package/workflow_nodes/sort.json +57 -0
- package/workflow_nodes/splitInBatches.json +30 -0
- package/workflow_nodes/splitOut.json +62 -0
- package/workflow_nodes/splunk.json +40 -0
- package/workflow_nodes/spontit.json +123 -0
- package/workflow_nodes/spotify.json +285 -0
- package/workflow_nodes/spreadsheetFile.json +8 -0
- package/workflow_nodes/sseTrigger.json +8 -0
- package/workflow_nodes/ssh.json +105 -0
- package/workflow_nodes/stackby.json +85 -0
- package/workflow_nodes/start.json +15 -0
- package/workflow_nodes/stickyNote.json +36 -0
- package/workflow_nodes/stopAndError.json +8 -0
- package/workflow_nodes/storyblok.json +138 -0
- package/workflow_nodes/strapi.json +138 -0
- package/workflow_nodes/strava.json +427 -0
- package/workflow_nodes/stravaTrigger.json +79 -0
- package/workflow_nodes/stripe.json +357 -0
- package/workflow_nodes/stripeTrigger.json +775 -0
- package/workflow_nodes/summarize.json +124 -0
- package/workflow_nodes/supabase.json +136 -0
- package/workflow_nodes/surveyMonkeyTrigger.json +160 -0
- package/workflow_nodes/switch.json +91 -0
- package/workflow_nodes/syncroMsp.json +8 -0
- package/workflow_nodes/taiga.json +340 -0
- package/workflow_nodes/taigaTrigger.json +81 -0
- package/workflow_nodes/tapfiliate.json +241 -0
- package/workflow_nodes/telegram.json +612 -0
- package/workflow_nodes/telegramTrigger.json +142 -0
- package/workflow_nodes/theHive.json +497 -0
- package/workflow_nodes/theHiveProject.json +8 -0
- package/workflow_nodes/theHiveProjectTrigger.json +162 -0
- package/workflow_nodes/theHiveTrigger.json +101 -0
- package/workflow_nodes/timescaleDb.json +95 -0
- package/workflow_nodes/todoist.json +285 -0
- package/workflow_nodes/togglTrigger.json +24 -0
- package/workflow_nodes/totp.json +86 -0
- package/workflow_nodes/travisCi.json +142 -0
- package/workflow_nodes/trello.json +609 -0
- package/workflow_nodes/trelloTrigger.json +8 -0
- package/workflow_nodes/twake.json +76 -0
- package/workflow_nodes/twilio.json +95 -0
- package/workflow_nodes/twilioTrigger.json +46 -0
- package/workflow_nodes/twist.json +376 -0
- package/workflow_nodes/twitter.json +40 -0
- package/workflow_nodes/typeformTrigger.json +62 -0
- package/workflow_nodes/unleashedSoftware.json +154 -0
- package/workflow_nodes/uplead.json +72 -0
- package/workflow_nodes/uproc.json +26 -0
- package/workflow_nodes/uptimeRobot.json +453 -0
- package/workflow_nodes/urlScanIo.json +113 -0
- package/workflow_nodes/venafiTlsProtectCloud.json +310 -0
- package/workflow_nodes/venafiTlsProtectCloudTrigger.json +38 -0
- package/workflow_nodes/venafiTlsProtectDatacenter.json +491 -0
- package/workflow_nodes/vero.json +158 -0
- package/workflow_nodes/vonage.json +125 -0
- package/workflow_nodes/wait.json +71 -0
- package/workflow_nodes/webflow.json +38 -0
- package/workflow_nodes/webflowTrigger.json +8 -0
- package/workflow_nodes/webhook.json +55 -0
- package/workflow_nodes/wekan.json +460 -0
- package/workflow_nodes/whatsApp.json +476 -0
- package/workflow_nodes/whatsAppTrigger.json +103 -0
- package/workflow_nodes/wise.json +330 -0
- package/workflow_nodes/wiseTrigger.json +8 -0
- package/workflow_nodes/wooCommerce.json +812 -0
- package/workflow_nodes/wooCommerceTrigger.json +8 -0
- package/workflow_nodes/wordpress.json +500 -0
- package/workflow_nodes/workableTrigger.json +51 -0
- package/workflow_nodes/writeBinaryFile.json +34 -0
- package/workflow_nodes/wufooTrigger.json +37 -0
- package/workflow_nodes/xero.json +530 -0
- package/workflow_nodes/xml.json +129 -0
- package/workflow_nodes/youTube.json +578 -0
- package/workflow_nodes/yourls.json +71 -0
- package/workflow_nodes/zammad.json +406 -0
- package/workflow_nodes/zendesk.json +526 -0
- package/workflow_nodes/zendeskTrigger.json +187 -0
- package/workflow_nodes/zohoCrm.json +721 -0
- package/workflow_nodes/zoom.json +507 -0
- package/workflow_nodes/zulip.json +371 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
---
|
|
2
|
+
description:
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
# MCP Server Implementation Best Practices
|
|
7
|
+
|
|
8
|
+
These guidelines ensure our MCP server follows the latest Model Context Protocol (2025) standards, providing a consistent API experience for AI model interactions.
|
|
9
|
+
|
|
10
|
+
## Core Architecture
|
|
11
|
+
|
|
12
|
+
- **Follow JSON-RPC 2.0 Message Format**
|
|
13
|
+
- All server responses must include `jsonrpc: "2.0"`, `id`, and either `result` or `error`
|
|
14
|
+
- Error objects must contain `code` and `message` properties
|
|
15
|
+
- Include proper request IDs in all responses
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
// ✅ DO: Format responses following JSON-RPC 2.0
|
|
19
|
+
const createJsonRpcResponse = (id, result) => ({
|
|
20
|
+
jsonrpc: "2.0",
|
|
21
|
+
id,
|
|
22
|
+
result
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const createJsonRpcError = (id, code, message) => ({
|
|
26
|
+
jsonrpc: "2.0",
|
|
27
|
+
id,
|
|
28
|
+
error: { code, message }
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// ❌ DON'T: Return arbitrary JSON structures
|
|
32
|
+
res.json({ success: true, data: result });
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- **Implement Proper Transport Layers**
|
|
36
|
+
- Support standard MCP transports (Stdio, HTTP, WebSockets)
|
|
37
|
+
- Transport selection should be configurable
|
|
38
|
+
- Handle connection lifecycle events properly
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
// ✅ DO: Use standardized transport implementations
|
|
42
|
+
const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio.js');
|
|
43
|
+
const transport = new StdioServerTransport();
|
|
44
|
+
server.connect(transport);
|
|
45
|
+
|
|
46
|
+
// ❌ DON'T: Create custom message formats
|
|
47
|
+
process.stdin.on('data', (data) => {
|
|
48
|
+
// Custom parsing logic...
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- **Implement Capability Negotiation**
|
|
53
|
+
- Explicitly declare supported capabilities (tools, resources, prompts, sampling)
|
|
54
|
+
- Follow the MCP specification version declaration
|
|
55
|
+
- Respond to capability request messages
|
|
56
|
+
|
|
57
|
+
```javascript
|
|
58
|
+
// ✅ DO: Properly declare server capabilities
|
|
59
|
+
app.post('/mcp/capabilities', (req, res) => {
|
|
60
|
+
res.status(200).json({
|
|
61
|
+
jsonrpc: "2.0",
|
|
62
|
+
id: req.body.id,
|
|
63
|
+
result: {
|
|
64
|
+
capabilities: {
|
|
65
|
+
tools: true,
|
|
66
|
+
resources: true,
|
|
67
|
+
prompts: false,
|
|
68
|
+
sampling: false
|
|
69
|
+
},
|
|
70
|
+
version: "2025-03-26"
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Tool Definitions
|
|
77
|
+
|
|
78
|
+
- **Standardize Tool Schemas**
|
|
79
|
+
- Each tool must have `name`, `description`, and `parameters`
|
|
80
|
+
- Parameter validation must follow JSON Schema (via Zod, Ajv, etc.)
|
|
81
|
+
- Include required vs. optional parameter designation
|
|
82
|
+
- Document expected inputs and outputs
|
|
83
|
+
|
|
84
|
+
```javascript
|
|
85
|
+
// ✅ DO: Use well-structured tool definitions
|
|
86
|
+
const createTool = (description, parameters, execute) => ({
|
|
87
|
+
description,
|
|
88
|
+
parameters: {
|
|
89
|
+
type: 'object',
|
|
90
|
+
properties: parameters,
|
|
91
|
+
required: Object.keys(parameters).filter(key => !parameters[key].optional)
|
|
92
|
+
},
|
|
93
|
+
execute,
|
|
94
|
+
required_on_execute: true,
|
|
95
|
+
categories: ['workflow'],
|
|
96
|
+
parallelizable: false
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// ❌ DON'T: Use loosely typed parameters
|
|
100
|
+
const simpleTool = {
|
|
101
|
+
run: (params) => {
|
|
102
|
+
// No validation before execution
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
- **Implement Comprehensive Parameter Validation**
|
|
108
|
+
- Validate all parameters before tool execution
|
|
109
|
+
- Provide descriptive error messages for invalid parameters
|
|
110
|
+
- Include type checking, bounds checking, and format validation
|
|
111
|
+
- Support nested objects and array validation
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
// ✅ DO: Validate parameters with detailed errors
|
|
115
|
+
const validate = ajv.compile(schema);
|
|
116
|
+
const valid = validate(params);
|
|
117
|
+
|
|
118
|
+
if (!valid) {
|
|
119
|
+
const errors = validate.errors.map(err =>
|
|
120
|
+
`${err.instancePath} ${err.message}`
|
|
121
|
+
).join('; ');
|
|
122
|
+
|
|
123
|
+
throw new Error(`Invalid parameters: ${errors}`);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// ❌ DON'T: Use loose validation or manual checks
|
|
127
|
+
if (!params.name) {
|
|
128
|
+
throw new Error('Name is required');
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Security
|
|
133
|
+
|
|
134
|
+
- **Implement Robust Authentication & Authorization**
|
|
135
|
+
- Authenticate all MCP requests
|
|
136
|
+
- Apply authorization rules for tool execution
|
|
137
|
+
- Log authentication failures
|
|
138
|
+
- Use refresh tokens and proper session management
|
|
139
|
+
|
|
140
|
+
```javascript
|
|
141
|
+
// ✅ DO: Implement proper auth with tool-specific authorization
|
|
142
|
+
const enhancedAuth = (req, res, next) => {
|
|
143
|
+
// Validate authentication
|
|
144
|
+
authenticate(req, res, (err) => {
|
|
145
|
+
if (err) return next(err);
|
|
146
|
+
|
|
147
|
+
// Add authorization check
|
|
148
|
+
const { toolInfo } = req;
|
|
149
|
+
if (toolInfo && !authorizeToolAccess(req.user, toolInfo)) {
|
|
150
|
+
return res.status(403).json({
|
|
151
|
+
error: {
|
|
152
|
+
message: 'Not authorized to use this tool',
|
|
153
|
+
code: 'UNAUTHORIZED_TOOL_ACCESS'
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
next();
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
// ❌ DON'T: Use simple global authentication without tool-specific authorization
|
|
162
|
+
app.use(basicAuthMiddleware);
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
- **Secure Configuration Management**
|
|
166
|
+
- Store secrets in environment variables or secure storage
|
|
167
|
+
- Support multiple environments (dev, staging, prod)
|
|
168
|
+
- Never hardcode credentials
|
|
169
|
+
- Use separate configuration files for non-sensitive settings
|
|
170
|
+
|
|
171
|
+
```javascript
|
|
172
|
+
// ✅ DO: Use environment variables for secrets
|
|
173
|
+
require('dotenv').config();
|
|
174
|
+
const apiKey = process.env.API_KEY;
|
|
175
|
+
|
|
176
|
+
// ❌ DON'T: Hardcode credentials
|
|
177
|
+
const apiKey = 'sk_live_abcdef123456';
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Error Handling
|
|
181
|
+
|
|
182
|
+
- **Implement Consistent Error Responses**
|
|
183
|
+
- Use standardized error codes
|
|
184
|
+
- Provide human-readable error messages
|
|
185
|
+
- Include debugging information in development
|
|
186
|
+
- Mask sensitive data in error responses
|
|
187
|
+
|
|
188
|
+
```javascript
|
|
189
|
+
// ✅ DO: Return structured error responses
|
|
190
|
+
const createErrorResponse = (message, code, status = 500) => {
|
|
191
|
+
logger.error(`MCP Error: ${code} - ${message}`);
|
|
192
|
+
|
|
193
|
+
return {
|
|
194
|
+
error: {
|
|
195
|
+
message,
|
|
196
|
+
code
|
|
197
|
+
},
|
|
198
|
+
status
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
// ❌ DON'T: Return inconsistent error formats
|
|
203
|
+
res.status(500).json({ message: "Something went wrong" });
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
- **Log Errors with Context**
|
|
207
|
+
- Include request context in error logs
|
|
208
|
+
- Log stack traces in development
|
|
209
|
+
- Use structured logging formats (JSON)
|
|
210
|
+
- Implement different log levels (debug, info, error)
|
|
211
|
+
|
|
212
|
+
```javascript
|
|
213
|
+
// ✅ DO: Log detailed error context
|
|
214
|
+
logger.error({
|
|
215
|
+
message: `Tool execution error: ${error.message}`,
|
|
216
|
+
toolName: req.toolInfo.name,
|
|
217
|
+
parameters: maskSensitiveData(req.toolInfo.parameters),
|
|
218
|
+
errorCode: error.code,
|
|
219
|
+
stack: process.env.NODE_ENV === 'development' ? error.stack : undefined
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// ❌ DON'T: Log minimal information
|
|
223
|
+
console.error("Error:", error.message);
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Performance & Scalability
|
|
227
|
+
|
|
228
|
+
- **Implement Rate Limiting**
|
|
229
|
+
- Limit requests per client/API key
|
|
230
|
+
- Apply graduated rate limits based on client tier
|
|
231
|
+
- Return standard 429 responses when limits exceeded
|
|
232
|
+
- Include rate limit information in response headers
|
|
233
|
+
|
|
234
|
+
```javascript
|
|
235
|
+
// ✅ DO: Implement proper rate limiting
|
|
236
|
+
app.use(rateLimit({
|
|
237
|
+
windowMs: 15 * 60 * 1000, // 15 minutes
|
|
238
|
+
max: 100, // limit each IP to 100 requests per windowMs
|
|
239
|
+
standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers
|
|
240
|
+
handler: (req, res) => {
|
|
241
|
+
const error = createErrorResponse(
|
|
242
|
+
'Too many requests, please try again later.',
|
|
243
|
+
'RATE_LIMIT_EXCEEDED',
|
|
244
|
+
429
|
|
245
|
+
);
|
|
246
|
+
res.status(error.status).json({ error: error.error });
|
|
247
|
+
}
|
|
248
|
+
}));
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
- **Optimize Tool Execution**
|
|
252
|
+
- Implement caching for frequently used tool results
|
|
253
|
+
- Use connection pooling for external API calls
|
|
254
|
+
- Apply timeouts for long-running operations
|
|
255
|
+
- Consider async execution for non-blocking operations
|
|
256
|
+
|
|
257
|
+
```javascript
|
|
258
|
+
// ✅ DO: Implement caching for expensive operations
|
|
259
|
+
const cache = new NodeCache({ stdTTL: 300 }); // 5 minute default TTL
|
|
260
|
+
|
|
261
|
+
const getCachedOrFetch = async (key, fetchFn) => {
|
|
262
|
+
const cached = cache.get(key);
|
|
263
|
+
if (cached) return cached;
|
|
264
|
+
|
|
265
|
+
const result = await fetchFn();
|
|
266
|
+
cache.set(key, result);
|
|
267
|
+
return result;
|
|
268
|
+
};
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## Testing & Reliability
|
|
272
|
+
|
|
273
|
+
- **Create Comprehensive Test Suites**
|
|
274
|
+
- Test all tool endpoints
|
|
275
|
+
- Include positive and negative test cases
|
|
276
|
+
- Test parameter validation logic
|
|
277
|
+
- Mock external dependencies
|
|
278
|
+
|
|
279
|
+
```javascript
|
|
280
|
+
// ✅ DO: Test success and error cases
|
|
281
|
+
it('should return 400 if tool name is missing', async () => {
|
|
282
|
+
const response = await request(app)
|
|
283
|
+
.post('/mcp/execute')
|
|
284
|
+
.send({ parameters: {} });
|
|
285
|
+
|
|
286
|
+
expect(response.status).toBe(400);
|
|
287
|
+
expect(response.body).toHaveProperty('error');
|
|
288
|
+
expect(response.body.error).toHaveProperty('code', 'MISSING_TOOL_NAME');
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
it('should process valid tool execution request', async () => {
|
|
292
|
+
const response = await request(app)
|
|
293
|
+
.post('/mcp/execute')
|
|
294
|
+
.send({
|
|
295
|
+
name: 'workflow_list',
|
|
296
|
+
parameters: { limit: 10 }
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
expect(response.status).toBe(200);
|
|
300
|
+
expect(response.body).toHaveProperty('tool', 'workflow_list');
|
|
301
|
+
});
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
- **Implement Health Checks**
|
|
305
|
+
- Create a health endpoint that verifies all dependencies
|
|
306
|
+
- Include version information in health response
|
|
307
|
+
- Check external service connectivity
|
|
308
|
+
- Implement readiness and liveness probes
|
|
309
|
+
|
|
310
|
+
```javascript
|
|
311
|
+
// ✅ DO: Implement detailed health checks
|
|
312
|
+
app.get('/health', async (req, res) => {
|
|
313
|
+
try {
|
|
314
|
+
// Check database connection
|
|
315
|
+
await db.ping();
|
|
316
|
+
|
|
317
|
+
// Check external API connectivity
|
|
318
|
+
await externalApi.status();
|
|
319
|
+
|
|
320
|
+
res.status(200).json({
|
|
321
|
+
status: 'ok',
|
|
322
|
+
version: '0.1.0',
|
|
323
|
+
uptime: process.uptime(),
|
|
324
|
+
timestamp: new Date().toISOString()
|
|
325
|
+
});
|
|
326
|
+
} catch (error) {
|
|
327
|
+
res.status(503).json({
|
|
328
|
+
status: 'error',
|
|
329
|
+
message: 'Service unavailable',
|
|
330
|
+
details: error.message
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
## Resources & Context
|
|
337
|
+
|
|
338
|
+
- **Implement Resource Endpoints**
|
|
339
|
+
- Expose useful context via resource endpoints
|
|
340
|
+
- Structure resources hierarchically
|
|
341
|
+
- Support resource retrieval by ID
|
|
342
|
+
- Include metadata with resources
|
|
343
|
+
|
|
344
|
+
```javascript
|
|
345
|
+
// ✅ DO: Implement proper resource endpoints
|
|
346
|
+
app.post('/mcp/resources/list', authenticate, (req, res) => {
|
|
347
|
+
const resources = [
|
|
348
|
+
{ id: 'workflow-templates', name: 'Workflow Templates', type: 'collection' },
|
|
349
|
+
{ id: 'node-types', name: 'Node Types', type: 'collection' },
|
|
350
|
+
{ id: 'integration-docs', name: 'Integration Documentation', type: 'document' }
|
|
351
|
+
];
|
|
352
|
+
|
|
353
|
+
const response = createJsonRpcResponse(req.body.id, { resources });
|
|
354
|
+
res.status(200).json(response);
|
|
355
|
+
});
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
- **Support Context Awareness**
|
|
359
|
+
- Allow tools to access contextual information
|
|
360
|
+
- Share context between related tool calls
|
|
361
|
+
- Maintain session state when appropriate
|
|
362
|
+
- Document context dependencies
|
|
363
|
+
|
|
364
|
+
```javascript
|
|
365
|
+
// ✅ DO: Implement context-aware tools
|
|
366
|
+
const executeWorkflow = async (params, context) => {
|
|
367
|
+
// Access the current user context
|
|
368
|
+
const userId = context.user.id;
|
|
369
|
+
|
|
370
|
+
// Access previously established session information
|
|
371
|
+
const sessionData = context.session.get('workflowData') || {};
|
|
372
|
+
|
|
373
|
+
// Store results for future tool calls
|
|
374
|
+
context.session.set('lastExecutionId', executionId);
|
|
375
|
+
|
|
376
|
+
return result;
|
|
377
|
+
};
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
## Documentation
|
|
381
|
+
|
|
382
|
+
- **Generate API Documentation**
|
|
383
|
+
- Create OpenAPI/Swagger documentation
|
|
384
|
+
- Document all tools and their parameters
|
|
385
|
+
- Include example requests and responses
|
|
386
|
+
- Provide error code references
|
|
387
|
+
|
|
388
|
+
```javascript
|
|
389
|
+
// ✅ DO: Use OpenAPI annotations for documentation
|
|
390
|
+
/**
|
|
391
|
+
* @openapi
|
|
392
|
+
* /mcp/execute:
|
|
393
|
+
* post:
|
|
394
|
+
* summary: Execute an MCP tool
|
|
395
|
+
* requestBody:
|
|
396
|
+
* required: true
|
|
397
|
+
* content:
|
|
398
|
+
* application/json:
|
|
399
|
+
* schema:
|
|
400
|
+
* type: object
|
|
401
|
+
* required:
|
|
402
|
+
* - name
|
|
403
|
+
* properties:
|
|
404
|
+
* name:
|
|
405
|
+
* type: string
|
|
406
|
+
* description: Tool name in format "category_action"
|
|
407
|
+
* parameters:
|
|
408
|
+
* type: object
|
|
409
|
+
* description: Tool-specific parameters
|
|
410
|
+
*/
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
- **Provide Clear Tool Documentation**
|
|
414
|
+
- Document each tool's purpose and behavior
|
|
415
|
+
- Explain parameter requirements clearly
|
|
416
|
+
- Provide usage examples
|
|
417
|
+
- Document potential errors and resolutions
|
|
418
|
+
|
|
419
|
+
```javascript
|
|
420
|
+
// ✅ DO: Document tools thoroughly
|
|
421
|
+
/**
|
|
422
|
+
* Create a new n8n workflow
|
|
423
|
+
*
|
|
424
|
+
* @param {Object} parameters - Tool parameters
|
|
425
|
+
* @param {string} parameters.name - Name of the workflow
|
|
426
|
+
* @param {boolean} [parameters.active=false] - Whether the workflow should be active
|
|
427
|
+
* @returns {Promise<Object>} Created workflow details
|
|
428
|
+
* @throws {Error} If workflow creation fails
|
|
429
|
+
*/
|
|
430
|
+
```
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Guidelines for continuously improving Cursor rules based on emerging code patterns and best practices.
|
|
3
|
+
globs: **/*
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
- **Rule Improvement Triggers:**
|
|
8
|
+
- New code patterns not covered by existing rules
|
|
9
|
+
- Repeated similar implementations across files
|
|
10
|
+
- Common error patterns that could be prevented
|
|
11
|
+
- New libraries or tools being used consistently
|
|
12
|
+
- Emerging best practices in the codebase
|
|
13
|
+
|
|
14
|
+
- **Analysis Process:**
|
|
15
|
+
- Compare new code with existing rules
|
|
16
|
+
- Identify patterns that should be standardized
|
|
17
|
+
- Look for references to external documentation
|
|
18
|
+
- Check for consistent error handling patterns
|
|
19
|
+
- Monitor test patterns and coverage
|
|
20
|
+
|
|
21
|
+
- **Rule Updates:**
|
|
22
|
+
- **Add New Rules When:**
|
|
23
|
+
- A new technology/pattern is used in 3+ files
|
|
24
|
+
- Common bugs could be prevented by a rule
|
|
25
|
+
- Code reviews repeatedly mention the same feedback
|
|
26
|
+
- New security or performance patterns emerge
|
|
27
|
+
|
|
28
|
+
- **Modify Existing Rules When:**
|
|
29
|
+
- Better examples exist in the codebase
|
|
30
|
+
- Additional edge cases are discovered
|
|
31
|
+
- Related rules have been updated
|
|
32
|
+
- Implementation details have changed
|
|
33
|
+
|
|
34
|
+
- **Example Pattern Recognition:**
|
|
35
|
+
```typescript
|
|
36
|
+
// If you see repeated patterns like:
|
|
37
|
+
const data = await prisma.user.findMany({
|
|
38
|
+
select: { id: true, email: true },
|
|
39
|
+
where: { status: 'ACTIVE' }
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Consider adding to [prisma.mdc](mdc:.cursor/rules/prisma.mdc):
|
|
43
|
+
// - Standard select fields
|
|
44
|
+
// - Common where conditions
|
|
45
|
+
// - Performance optimization patterns
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
- **Rule Quality Checks:**
|
|
49
|
+
- Rules should be actionable and specific
|
|
50
|
+
- Examples should come from actual code
|
|
51
|
+
- References should be up to date
|
|
52
|
+
- Patterns should be consistently enforced
|
|
53
|
+
|
|
54
|
+
- **Continuous Improvement:**
|
|
55
|
+
- Monitor code review comments
|
|
56
|
+
- Track common development questions
|
|
57
|
+
- Update rules after major refactors
|
|
58
|
+
- Add links to relevant documentation
|
|
59
|
+
- Cross-reference related rules
|
|
60
|
+
|
|
61
|
+
- **Rule Deprecation:**
|
|
62
|
+
- Mark outdated patterns as deprecated
|
|
63
|
+
- Remove rules that no longer apply
|
|
64
|
+
- Update references to deprecated rules
|
|
65
|
+
- Document migration paths for old patterns
|
|
66
|
+
|
|
67
|
+
- **Documentation Updates:**
|
|
68
|
+
- Keep examples synchronized with code
|
|
69
|
+
- Update references to external docs
|
|
70
|
+
- Maintain links between related rules
|
|
71
|
+
- Document breaking changes
|
|
72
|
+
Follow [cursor_rules.mdc](mdc:.cursor/rules/cursor_rules.mdc) for proper rule formatting and structure.
|