feat: add /v1/orchestrations for server-side MCP tool execution#7800
Conversation
|
Hi, @louis-jan |
|
@claytonlin1110 can you help elaborate how it works in these cases:
|
|
Another thought is that, clients suppose to work with chat/completions endpoint. So it could be a setting on GUI then clients don't have to support new endpoint? |
/v1/orchestrations only exposes MCP (server) tools to the model ; client-provided tools aren’t merged in yet. To support a mix, we'd union tool schemas, then route each tool_call: run MCP on the server, or return pending calls / accept client tool results on the next round.
The desktop UI can ask the user before calling MCP; that’s frontend, not the HTTP endpoint. /v1/orchestrations auto-executes MCP tool calls (no approval step). To add approval over the API, we'd need something like a two-phase flow (return tool calls -> client approves -> server runs) or server policy (allowlist / auto_execute: false). |
Yes. we can add a Settings toggle and a Jan-only field on POST /v1/chat/completions (e.g. jan_execute_tools: true). The local proxy would run server-side MCP orchestration and still return a normal chat completion; clients don’t need a new endpoint. The field should be handled only by Jan’s proxy and not forwarded to upstream providers. /v1/orchestrations can stay optional for scripts. |
|
That would be great @claytonlin1110 can you help me add this to chat/completions |
|
@claytonlin1110 help me fix the build errors, will test after this |
9815430 to
086bf80
Compare
|
@louis-jan Please re-run CI |
|
@claytonlin1110 can we make assistant_id optional? Context: As a user I want to make request to v1/orchestrations to have tools executed from server side, but I don't want and don't know how to put assistant_id in the payload. E.g. assistant id is not exposed on the GUI? |
|
@louis-jan |
|
Secretly was following this and glad it got in. It'd be nice to have the MCP whitelisting sooner rather than later. I'm hoping we can have a list of enabled MCPs for the local Jan user and a separate list for the orchestration. So I can stop randoms burning my Exa tokens, but they can have as many time-of-day reports as they want. I also think we need an Good work either way! |
Summary
This adds a new local API endpoint POST /v1/orchestrations that brings desktop-like tool execution to headless API clients: it loads assistant_id settings, runs a tool-calling loop, executes MCP tools on the server, and returns the final completion.
Fixes Issues
Self Checklist