Provide and use Model Context Protocol

The idea is:

Anthropic published a new spec for AI to discover available tools via their model context protocol.

Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you’re building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.

Let n8n:

  • consume MCP servers via JSON-RCP
  • act as a MCP server for other workflows or other consumers

My use case:

I think it would be beneficial to add this because:

Instead of tools needing to be known at the time of building workflows, the amount of tools available to a consumer is contingent to a context provider evolving.

This means, if n8n AI nodes could leverage MCP, the efficiency and ways to solve problems with AI could progressively be enhanced.

Any resources to support this?

Are you willing to work on this?

kinda :slight_smile:

I had the same idea :smiley:

In the future, I imagine that instead of building all the “tools” by itself, n8n will interact with “tools” by using MCP. That way it can leverage the existing works of others

5 Likes

That is a great idea. Integrating with MCP servers will definitely leverage AI automations more!

2 Likes

Let me share another idea related to MCP server, aside from MCP servers as tools.

If a n8n workflow acts as a MCP server, we can integrate our own custom AI-powered tools with n8n. Sometimes, it would be great to implement a custom AI-powered app for internal use of companies. If we leverage n8n outside of the platform in custom AI tools, that would be awesome.

5 Likes

The other benefit to n8n is that this opens up the entire world of existing MCP servers to be AI plugins into n8n, without having to write any code other than the MCP client integration. Check out directories of MCP servers like https://mcp.so/ and Open-Source MCP servers | Glama

6 Likes

Yes, when I learned about MCP, my first reaction was whether it could go together with n8n to build better products, so I found my way here.

4 Likes

Found an MCP server that’ll allow MCP clients to use n8n workflows as tools

I won’t have time to try it for at least a few days. If anyone does, pls report back :pray: :pray: :pray:

5 Likes

Great, I have the same idea as you
n8n urgently needs support for MCP

2 Likes

I just created an account on this forum to say yes we really need this. Who’s building?

4 Likes

I like this analogy with USB connector.
MCP is a kind of USB, a universal software connector for data, apps, file system, repositories.

3 Likes

I created a node for clients. I’ll work on servers next. However feel free to contribute.

14 Likes

@nerding-io amazing, this should be included in official nodes asap, thank you

3 Likes

This is amazing @nerding-io, thank you! I’m trying to get it to run now but getting
Unrecognized node type: n8n-nodes-mcp.mcpClientTool

Any ideas? I’ve tried to follow the installation steps, I’m hosting on elest.io

  1. Install community node
  2. Install Brave Search package on server using npm install -g @modelcontextprotocol/server-brave-search
  3. Create credentials through the mcp node in n8n

Any ideas on where I went wrong? Would love to get this working

1 Like

You need to add the env variable described at the end of the repo docs, to the docker compose file in Elest.io and then restart the server - had the same issue today and got it working

2 Likes

thanks Daniel!! I literally just came back here to respond to my own message. For anyone facing the same issue – it’s this environment variable: # Enable community nodes as tools
- N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true

3 Likes

One more - are you able to use multiple tools/mcp servers from a single MCP tool?

As in, have a single listTools which collectively lists all tools and parameters of those tools that you have access to (i.e. have installed mcp servers for), then AI node determines which tool to use given the user query, it then inputs that into the executeTool with the appropriate parameters and executes it?

So two ‘tools’ but really - many many tools

1 Like

Thanks @Simon_Coton glad you got the env var sorted out.

I also have it in the README with instructions for Docker, and local. In retrospect I shouldn’t have put it at the bottom.

3 Likes

@Simon_Coton for the “many many tools” I dont fully understand.

It sounds like you want a proxy MCP server that connects to many different MCP servers. So you could like list all the tools you have and execute.

Would it be easier to break that up into multiple agents? Like have an agent list your tools, send that to another agent to execute based with a expression.

Something like this? (might need structured output)

I you are asking for it to all be in one node I think that a limitation to the tool since you are require to name it.

Maybe I’m misunderstanding though. I just like to keep my Agents limited to a single primary task, then have a multi agent orchestration.

2 Likes

Thanks for the response! I think what you are showing is along the right lines.

So I’m looking for

  1. One tool to list all tools (i.e. tells me all mcp servers I’m connected to and the appropriate tools available) -e.g. shows me brave_search, weather Api, Airtable etc methods all in one response. Can I do that through the non SSE method? Can I do that with hosting on elest.io & if so, how?
  2. my agent can then pass to the next agent which has a tool connected (just one) that is executeTool but the parameters + tool credentials + tool is selected dynamically - I see that it looks like you’re doing that by connecting to an SSE mcp account, is that correct? How can I do this on elest.io as that’d be awesome?

Perhaps it’s my limited understanding of the SSE method as well as MCPs, but right now I’m connecting an executeTool directly with credentials used to install a specific tool e.g. Brave, so I therefore would have to create a second tool for the weather API, another for Airtable MCP etc, have I misunderstood that?

Thanks so much! Excited to get this working, I’ll publish a video about it once I do :grinning:

2 Likes

@Simon_Coton yea I understand what you are asking. There’s a couple different asks in the request so I think this will take a tiered approach. I dont know if it can all be done directly in n8n.

Let me dig into it and hit you up.

I’ll have an intro video coming out tomorrow. As for any feature updates if you wanna collab or socialize that would be awesome.

2 Likes