Skip to content

Conversation

mudler
Copy link
Owner

@mudler mudler commented Oct 3, 2025

Description

This PR fixes #6380

Notes for Reviewers

To test, add for instance in a model config the following section:

mcp:
  stdio: |
    {
      "mcpServers": {
        "searxng": {
          "command": "docker",
          "args": [
            "run", "-i", "--rm",
            "quay.io/mudler/tests:duckduckgo-localai"
          ],
        }
      }
    }

Afterwards, you should be able to call the mcp endpoint (/mcp/v1/chat/completions - which uses the agent to answer, accessing the tools made available from the MCP servers configured) with:

curl http://localhost:8080/mcp/v1/chat/completions -H "Content-Type: application/json" -d '{
  "model": "qwen3-4b",
  "messages": [{"role": "user", "content": "what are the latest news about Trump?"}]
}'

Signed commits

  • Yes, I signed my commits.

Copy link

netlify bot commented Oct 3, 2025

Deploy Preview for localai ready!

Name Link
🔨 Latest commit bb30555
🔍 Latest deploy log https://app.netlify.com/projects/localai/deploys/68e2736bbe97cb0008abb308
😎 Deploy Preview https://deploy-preview-6381--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mudler mudler force-pushed the mcp_completions branch 2 times, most recently from bb5e579 to 103e20d Compare October 3, 2025 21:42
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
mudler added 2 commits October 4, 2025 22:06
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@mudler mudler added enhancement New feature or request and removed dependencies labels Oct 4, 2025
@mudler mudler changed the title Add Agentic MCP support feat: Add Agentic MCP support with a new chat/completion endpoint Oct 4, 2025
@mudler mudler marked this pull request as ready for review October 4, 2025 21:44
mudler added 2 commits October 5, 2025 09:22
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

for _, server := range stdio.Servers {
log.Debug().Msgf("[MCP stdio server] Configuration : %+v", server)
command := exec.Command(server.Command, server.Args...)

Check failure

Code scanning / gosec

Subprocess launched with variable Error

Subprocess launched with a potential tainted input or cmd arguments
}

func (t *MCPTool) Close() {
t.session.Close()

Check warning

Code scanning / gosec

Errors unhandled Warning

Errors unhandled
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@github-actions github-actions bot added kind/documentation Improvements or additions to documentation dependencies labels Oct 5, 2025
@mudler mudler removed kind/documentation Improvements or additions to documentation dependencies labels Oct 5, 2025
@github-actions github-actions bot added kind/documentation Improvements or additions to documentation dependencies labels Oct 5, 2025
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@mudler mudler merged commit 60b6472 into master Oct 5, 2025
28 of 30 checks passed
@mudler mudler deleted the mcp_completions branch October 5, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies enhancement New feature or request kind/documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP support and responses API

1 participant