Initial commit of n8n MCP Server

A Model Context Protocol (MCP) server that integrates with n8n, providing tools for workflow and execution management via the n8n API.
This commit is contained in:
leonardsellem
2025-03-12 17:12:35 +01:00
commit 2cd565cfa6
79 changed files with 19654 additions and 0 deletions

33
tests/test-setup.ts Normal file
View File

@@ -0,0 +1,33 @@
/**
* Global test setup for n8n MCP Server tests
*/
import { beforeEach, afterEach, jest } from '@jest/globals';
// Reset environment variables before each test
beforeEach(() => {
process.env = {
...process.env,
NODE_ENV: 'test'
};
});
// Clean up after each test
afterEach(() => {
jest.resetAllMocks();
jest.clearAllMocks();
});
export const mockEnv = (envVars: Record<string, string>) => {
const originalEnv = process.env;
beforeEach(() => {
process.env = {
...originalEnv,
...envVars
};
});
afterEach(() => {
process.env = originalEnv;
});
};