mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(MCP Client Tool Node): Add MCP Client Tool Node to connect to MCP servers over SSE (#14464)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in> Co-authored-by: JP van Oosten <jp@n8n.io>
This commit is contained in:
@@ -6,6 +6,7 @@ import type {
|
||||
SimplifiedNodeType,
|
||||
} from '@/Interface';
|
||||
import {
|
||||
AI_CATEGORY_MCP_NODES,
|
||||
AI_CATEGORY_ROOT_NODES,
|
||||
AI_CATEGORY_TOOLS,
|
||||
AI_CODE_NODE_TYPE,
|
||||
@@ -222,16 +223,17 @@ export const useViewStacks = defineStore('nodeCreatorViewStacks', () => {
|
||||
const aiSubNodes = difference(aiNodes, aiRootNodes);
|
||||
|
||||
aiSubNodes.forEach((node) => {
|
||||
const section = node.properties.codex?.subcategories?.[AI_SUBCATEGORY]?.[0];
|
||||
const subcategories = node.properties.codex?.subcategories ?? {};
|
||||
const section = subcategories[AI_SUBCATEGORY]?.[0];
|
||||
|
||||
if (section) {
|
||||
const subSection = node.properties.codex?.subcategories?.[section]?.[0];
|
||||
const subSection = subcategories[section]?.[0];
|
||||
const sectionKey = subSection ?? section;
|
||||
const currentItems = sectionsMap.get(sectionKey)?.items ?? [];
|
||||
const isSubnodesSection =
|
||||
!node.properties.codex?.subcategories?.[AI_SUBCATEGORY].includes(
|
||||
AI_CATEGORY_ROOT_NODES,
|
||||
);
|
||||
const isSubnodesSection = !(
|
||||
subcategories[AI_SUBCATEGORY].includes(AI_CATEGORY_ROOT_NODES) ||
|
||||
subcategories[AI_SUBCATEGORY].includes(AI_CATEGORY_MCP_NODES)
|
||||
);
|
||||
|
||||
let title = section;
|
||||
if (isSubnodesSection) {
|
||||
|
||||
@@ -57,12 +57,18 @@ export function subcategorizeItems(items: SimplifiedNodeType[]) {
|
||||
// Only some subcategories are allowed
|
||||
let subcategories: string[] = [DEFAULT_SUBCATEGORY];
|
||||
|
||||
WHITE_LISTED_SUBCATEGORIES.forEach((category) => {
|
||||
const matchedSubcategories = WHITE_LISTED_SUBCATEGORIES.flatMap((category) => {
|
||||
if (item.codex?.categories?.includes(category)) {
|
||||
subcategories = item.codex?.subcategories?.[category] ?? [];
|
||||
return item.codex?.subcategories?.[category] ?? [];
|
||||
}
|
||||
|
||||
return [];
|
||||
});
|
||||
|
||||
if (matchedSubcategories.length > 0) {
|
||||
subcategories = matchedSubcategories;
|
||||
}
|
||||
|
||||
subcategories.forEach((subcategory: string) => {
|
||||
if (!acc[subcategory]) {
|
||||
acc[subcategory] = [];
|
||||
|
||||
Reference in New Issue
Block a user