Skip to main content
Glama
DrBalls

n8n MCP Server

by DrBalls

n8n_check_connection

Verify API key validity and test connectivity to the n8n automation platform instance.

Instructions

Test the connection to the n8n instance.

Verifies that the API key is valid and the n8n instance is reachable.

Returns:

  • connected: Whether connection is successful

  • error: Error message if connection failed

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core logic for checking the n8n connection, which attempts to fetch a single workflow to verify API connectivity and credentials.
    export const checkConnection = async (): Promise<{ connected: boolean; version?: string; error?: string }> => {
      try {
        // Try to get workflows as a connection test
        await get('/workflows', { limit: 1 });
        return { connected: true };
      } catch (error) {
        const message = error instanceof Error ? error.message : 'Unknown error';
        return { connected: false, error: message };
      }
    };
  • Registration of the 'n8n_check_connection' tool in the MCP server, which invokes the `checkConnection` service function.
      server.registerTool(
        'n8n_check_connection',
        {
          title: 'Check n8n Connection',
          description: `Test the connection to the n8n instance.
    
    Verifies that the API key is valid and the n8n instance is reachable.
    
    Returns:
      - connected: Whether connection is successful
      - error: Error message if connection failed`,
          inputSchema: EmptySchema,
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false
          }
        },
        async () => {
          const result = await checkConnection();
          
          const text = result.connected
            ? '✅ Successfully connected to n8n!'
            : `❌ Connection failed: ${result.error}`;
          
          return {
            content: [{ type: 'text', text }],
            structuredContent: result

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DrBalls/n8n-mcp-server-v2'

If you have feedback or need assistance with the MCP directory API, please join our Discord server