You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, llama-server has no knowledge about tools or MCP, all the logic is implemented on webui client side. This introduce a lot of duplicated code if we want to also support MCP and tools on llama-cli
The plan is to allow user to use built-in tools and MCP tools from llama-cli by having a mcp.json file
Possible Refactor Approaches
Tool registry will allow having 2 types of tools:
Built-in tools, served in OAI-compat schema
MCP tools: this will reflect just the server URL, NOT a list of tools from that server. The client will be responsible for extracting tools from this server (on webui, we already had this logic; on CLI, we will need to implement this logic)
For MCP tools, we support both streaming HTTP and stdio protocols, using http://, https:// and stdio:// protocols respectively
Client call POST /tools to effectively "proxy" the request to the destination MCP server/stdio
Example of a list returned from GET /tools:
read_file: built-in tool
edit_file: built-in tool
list_files: built-in tool
huggingface-mcp: MCP server
python-interpreter: MCP stdio
Reacted by Richard Février, Slavik, Erik Scholz, David Wen Riccardi-Zhu, Penguin-Guru and Pascal
Reacted by Stanislav Ursache, David Wen Riccardi-Zhu, iridium87 and Pascal
Reacted by Pascal, Antoine Viallon, Stanislav Ursache, Thomas Stocker and David Wen Riccardi-Zhu
Okay, so actually I was thinking of directly listing the tools from MCP servers etc. because that allows us to unify everything behind a single framework. I've been thinking about this quite a bit and this actually eases the implementation of skills since we can add tools like skill:<skillname>:run with the skill script path. Generally using the source:toolname approach is enough to disambiguate and also helps with accidental tool conflicts. Plus this makes the whole tool gathering / tool execution phase much less tedious since the registry basically handles the request and then delegates to the proper handler (MCP / builtin / skill).
Okay, so actually I was thinking of directly listing the tools from MCP servers etc.
My initial plan looks somewhat like this, but I doubt if it will require a lot of changes in web UI in the short term.
Nevertheless, I think the first step could be to implement the C++ MCP client inside the CLI first, then investigate if it's possible for web UI to reuse that later on.
Re skills, I think it can be done completely separate to MCP stuff. Skill scripts can be exposed as tools, much like built-in tools. Skills and and resources related to skills can be discovered via doing a scan inside an user-defined directory
I think that from WebUI's perspective we'd simply switch from the MCP Servers selector/enabler dropdown to Tools Selector component and we'd list built-in tools in the same tree as the JSON Schema originating tools as well as MCP originating tools:
TOOLS
-- Built-in
---- read_file
---- edit_file
---- list_files
-- Hugging Face MCP
---- tool_1
---- tool_2
-- Some other MCP
...
-- JSON Schema
---- tool_x
---- tool_y
More detailed MCP configuration would be handled in the MCP section in Settings.
@pwilkin@allozaur small update for you, so the plan is much clearer now:
For the first step, we will add support for built-in tools to server + web UI. I'll push the PR shortly and that will contain tools inspired by vscode's agent impl like grep_file, edit_file, glob, etc. This allows working with large file / large directory without using up model's context
The 2nd step would be to support this on CLI. Since tools are in OAI format, this will completely bypass MCP stuff, thus will be trivial to implement
Next step is to allow loading mcp.json which contains stdio and HTTP MCP servers. The /cors-proxy endpoint will be refactored such that it allows tunneling both HTTP and stdio. Web UI will need to adapt to this change
Then, we will need to implement C++ MCP client on CLI. That should mostly the same as MCP for llama-cli #19373 , so just asking if you're OK with moving your changes to the new API @pwilkin ? I will give you more details when we arrive at step 3
Note that I'm not having strong opinion about whether we should leave C++ MCP client inside CLI, or bring it to server, but let's come back to this point a bit later
Yeah, looks fine. Should I upload what I did on the registry until now? It's mostly a vibed prototype, but most of it aligns with this vision pretty well.
Is there any possibility the tool registry could enable user-defined tools? Emacs' gptel mode allows for this; with Go I've mapped YAML / JSON to ExecCommand.
Activity
pwilkin commentedon Mar 17, 2026
Okay, so actually I was thinking of directly listing the tools from MCP servers etc. because that allows us to unify everything behind a single framework. I've been thinking about this quite a bit and this actually eases the implementation of skills since we can add tools like
skill:<skillname>:runwith the skill script path. Generally using thesource:toolnameapproach is enough to disambiguate and also helps with accidental tool conflicts. Plus this makes the whole tool gathering / tool execution phase much less tedious since the registry basically handles the request and then delegates to the proper handler (MCP / builtin / skill).ngxson commentedon Mar 18, 2026
My initial plan looks somewhat like this, but I doubt if it will require a lot of changes in web UI in the short term.
Nevertheless, I think the first step could be to implement the C++ MCP client inside the CLI first, then investigate if it's possible for web UI to reuse that later on.
Re skills, I think it can be done completely separate to MCP stuff. Skill scripts can be exposed as tools, much like built-in tools. Skills and and resources related to skills can be discovered via doing a scan inside an user-defined directory
allozaur commentedon Mar 19, 2026
I think that from WebUI's perspective we'd simply switch from the MCP Servers selector/enabler dropdown to Tools Selector component and we'd list built-in tools in the same tree as the JSON Schema originating tools as well as MCP originating tools:
More detailed MCP configuration would be handled in the MCP section in Settings.
ngxson commentedon Mar 19, 2026
@pwilkin @allozaur small update for you, so the plan is much clearer now:
mcp.jsonwhich contains stdio and HTTP MCP servers. The/cors-proxyendpoint will be refactored such that it allows tunneling both HTTP and stdio. Web UI will need to adapt to this changeNote that I'm not having strong opinion about whether we should leave C++ MCP client inside CLI, or bring it to server, but let's come back to this point a bit later
pwilkin commentedon Mar 19, 2026
Yeah, looks fine. Should I upload what I did on the registry until now? It's mostly a vibed prototype, but most of it aligns with this vision pretty well.
ngxson commentedon Mar 19, 2026
Hmm yeah if you have a branch, you can give me a link, I can have a quick look (so no need to create a new PR)
4 remaining items
dwrz commentedon Apr 30, 2026
Excited to see the built-in tools -- thank you.
Is there any possibility the tool registry could enable user-defined tools? Emacs'
gptelmode allows for this; with Go I've mapped YAML / JSON toExecCommand.niutech commentedon Jun 12, 2026
@pwilkin Is there any PR?
pwilkin commentedon Jun 12, 2026
@niutech we're setting up the proper backend structures first.
github-actions commentedon Jul 31, 2026
This issue was closed because it has been inactive for 14 days since being marked as stale.
niutech commentedon Jul 31, 2026
@pwilkin Why was it closed when it is on the roadmap?