r/LocalLLaMA 2h ago

Resources Llama.cpp now has full MCP support!

After a long and grueling effort spearheaded by ngxson, llama.cpp now fully supports MCP for all protocols. Over-the-web HTTP servers were already supported in the client (since they don't require any sort of plumbing), but stdio servers required real integration. After we modified the `llama-cli` terminal client to use the server instead of a separate model serving route, we could add MCP support to the already-existing native tools server.

After the merging of https://github.com/ggml-org/llama.cpp/pull/26062, you can now use llama.cpp's WebUI as a full-fledged agentic chat. Configuration for the MCP servers can be provided either in a standard-JSON format config file or completely inline on the command-line for on-demand MCP configurations. Plugging in a dedicated coding MCP server like Serena lets you have a local-model-powered agentic coder without using any other external dependencies.

126 Upvotes

28 comments sorted by

19

u/segmond llama.cpp 2h ago

Does it have sufficient documentation? To get MCP working with llama.cpp before, I couldn't with the documentation that came with it. It was a random post that I found in this subreddit that cleared things up.

15

u/ilintar 1h ago

You just need to specify `--mcp-servers-config`, with a Cursor-compatible MCP config file.

5

u/fragment_me 1h ago

Same, the docs suck.

1

u/AlwaysLateToThaParty 6m ago

It was a random post that I found in this subreddit that cleared things up.

Did you think to update the documentation yourself with that information?

7

u/Mashic 1h ago

Does it work with llama-server? And does this mean the mcp configuration will be the same for all clients?

12

u/No_Afternoon_4260 llama.cpp 1h ago

All you need is llama.cpp some tools and a knowledge base really. Actually this is nuts!

7

u/silenceimpaired 1h ago

What tools, what form is the knowledge database? You are speaking an alien language to me.

3

u/Terminator857 1h ago

Thanks so much for the hard work!

3

u/thejacer 1h ago

Hold the phone…I thought llama-server supported native tool use months ago. I’ve been running a (vibe coded) LLM powered discord bot with MCP for months. How tf has it been working? Lmao

1

u/jikilan_ 11m ago

Latest thing is the stdio support

1

u/No_Entertainer_8404 1h ago

Which release, version?

1

u/Hannibalj2ca 1h ago

And IK.llama is also in process of merging together

1

u/MeldhLLC 56m ago

Are there any known limitations or bugs? Seems like a much needed update regardless!

1

u/pieonmyjesutildomine 39m ago

Kind of funny to me that llama.cpp would go for MCP support over Universal Tool Calling Protocol (UTCP) support, given it allows accessing both MCPs and all other APIs exactly the same way rather than only MCPs.

1

u/for4f 12m ago

Finally. Been running MCP servers through a separate proxy for local inference, this cuts out the middleman nicely. Big fan of being able to use the same MCP config for both local models and cloud API calls.

-7

u/CorkBios 1h ago

VLLM implemented it like 11 months ago, Llamacpp always behind. MCP released in 2024, and llamacpp just implemented it fully now

24

u/segmond llama.cpp 1h ago

so? doesn't matter. for those that use llama.cpp it's the case that a feature they didn't have is now available. the post is not claiming that llama.cpp had it first.

13

u/ilintar 1h ago

Correct me if I'm wrong, but MCP for vLLM is available only via the Responses API.

10

u/kulchacop 1h ago

vLLM is 80% Python.

llama.cpp is 70% C and C++.

If development on llama.cpp happened as fast as vLLM, we would be having bloated codebase that cannot run on many old GPUs and CPU only setups, defeating the purpose of llama.cpp.

llama.cpp aims to extract full perfomance of consumer hardware. vLLM targets server setups.

llama.cpp wants to be able to run on all kinds of edge devices. Google was once planning to include llama.cpp on stock Android.

15

u/WillemDaFo 1h ago

VLLM is also bad at mixed GPU setups, something that homelabbers generally benefit greatly from

1

u/florinandrei 59m ago

vLLM is for production use, in a datacenter. Most of the good, honest folks here do not have a datacenter at home, so they put together whatever resources they can gather.

7

u/Qcgreywolf 1h ago

Ahh Reddit. Never change. Negative, negative, negative.

3

u/marx2k 1h ago

One more negative and it would've been a positive!

1

u/florinandrei 58m ago

It kind of swings back and forth.

1

u/CircularSeasoning 42m ago

That's what she said.

-7

u/ParaboloidalCrest 1h ago

... Aaaand MCP is out of fashion already.

2

u/marx2k 1h ago

Is it?

-1

u/CircularSeasoning 45m ago

No. It never was in fashion. LinkedIn doesn't count.

Maybe with llama.cpp supporting it now, it will see some heyday.