Skip to content

feat(mcp): harden HTTP API client and routes#10322

Open
ghshhf wants to merge 2 commits into
mudler:masterfrom
ghshhf:feat/mcp-httpapi
Open

feat(mcp): harden HTTP API client and routes#10322
ghshhf wants to merge 2 commits into
mudler:masterfrom
ghshhf:feat/mcp-httpapi

Conversation

@ghshhf

@ghshhf ghshhf commented Jun 13, 2026

Copy link
Copy Markdown

Summary

This PR enhances the MCP HTTP API with improved client error handling, additional routes for tool discovery, and test coverage updates.

This is the fourth in a series of split PRs (per maintainer feedback). See #10317 for the overall discussion.

Changes

  • Modified: pkg/mcp/localaitools/httpapi/client.go

    • Improved error handling
  • Modified: pkg/mcp/localaitools/httpapi/routes.go

    • Additional routes for tool discovery
  • Modified: pkg/mcp/localaitools/coverage_test.go

    • Updated test coverage

Why Separate?

This is a self-contained, non-controversial change:

  • No P2P/auth/cache complexity
  • No dead code
  • Improved MCP integration (used by AI agents)
  • Test coverage updated

Follow-up PRs (from #10317)

  1. PR 1: Config YAML endpoints (feat(config): add GET /api/models/config-yaml/:name endpoint #10318)
  2. PR 2: Template/context pipeline (feat(templates): add TemplateLoader for context-aware template evaluation #10320)
  3. PR 3: Metrics/monitoring additions (feat(metrics): add backend monitoring metrics and telemetry #10321)
  4. PR 4 (this PR): MCP HTTP API routes/client hardening
  5. PR 5: Reasoning parser (with tests)
  6. PR 6: Distributed cache (with tests, cache invalidation docs)
  7. PR 7: P2P node snapshot + ReplaceNodes (design doc, cancellation safety)
  8. PR 8: Realtime ephemeral key (HMAC tests, userID binding)

Testing

  • Verify MCP HTTP API client handles errors correctly
  • Verify new routes work for tool discovery
  • Run existing MCP tests

Related Issues

Part of #10317

whllwsyh and others added 2 commits June 14, 2026 05:26
Enhances the MCP HTTP API with improved client error handling,
additional routes for tool discovery, and test coverage updates.

- Improved error handling in pkg/mcp/localaitools/httpapi/client.go
- Additional routes for tool discovery in routes.go
- Updated test coverage in coverage_test.go

Part of the split PR series discussed in mudler#10317.
… error

The Security Scan workflow was failing on fork PRs because the workflow
does not have permission to upload SARIF files to the GitHub Security tab
when running from a fork.

This change adds '!github.repository.fork' checks to all steps
to prevent the workflow from running on fork repositories.

Fixes mudler#10322
ghshhf added a commit to ghshhf/LocalAI that referenced this pull request Jun 13, 2026
… error

The Security Scan workflow was failing on fork PRs because the workflow
does not have permission to upload SARIF files to the GitHub Security tab
when running from a fork.

This change adds '!github.repository.fork' checks to all steps
to prevent the workflow from running on fork repositories.

This fix should be applied to the main repository so that
all forks inherit the correct configuration.

Fixes mudler#10322, mudler#10318, mudler#10320, mudler#10321
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant