Skip to main content
Glama

list-projects

Retrieve all projects from n8n using a client ID. Requires an n8n Enterprise license with project management features enabled. Input must be in compact, single-line JSON format.

Instructions

List all projects from n8n. NOTE: Requires n8n Enterprise license with project management features enabled. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes

Implementation Reference

  • The main execution handler for the 'list-projects' MCP tool within the CallToolRequestSchema request handler's switch statement. It retrieves the stored N8nClient by clientId, calls listProjects() on it, formats and returns the projects data as JSON, or handles client not found and API errors.
    case "list-projects": { const { clientId } = args as { clientId: string }; const client = clients.get(clientId); if (!client) { return { content: [{ type: "text", text: "Client not initialized. Please run init-n8n first.", }], isError: true }; } try { const projects = await client.listProjects(); return { content: [{ type: "text", text: JSON.stringify(projects.data, null, 2), }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : "Unknown error occurred", }], isError: true }; } }
  • Core helper method in the N8nClient class that performs the HTTP GET request to the n8n /api/v1/projects endpoint to fetch the list of projects.
    async listProjects(): Promise<N8nProjectList> { return this.makeRequest<N8nProjectList>('/projects'); }
  • src/index.ts:508-517 (registration)
    Registration of the 'list-projects' tool in the static tools list returned by the ListToolsRequestSchema handler, including metadata and input schema.
    name: "list-projects", description: "List all projects from n8n. NOTE: Requires n8n Enterprise license with project management features enabled. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.", inputSchema: { type: "object", properties: { clientId: { type: "string" } }, required: ["clientId"] } },
  • TypeScript interface defining the structure of the n8n projects API response used by listProjects().
    interface N8nProjectList { data: N8nProject[]; nextCursor?: string; }
  • TypeScript interface defining the structure of an individual n8n project object.
    interface N8nProject { id: string; name: string; type?: string; }

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/illuminaresolutions/n8n-mcp-server'

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