RSPEED-2402: Enable MCP tool use on rlsapi /v1/infer endpoint#1113
Merged
tisnik merged 1 commit intolightspeed-core:mainfrom Feb 8, 2026
Merged
RSPEED-2402: Enable MCP tool use on rlsapi /v1/infer endpoint#1113tisnik merged 1 commit intolightspeed-core:mainfrom
tisnik merged 1 commit intolightspeed-core:mainfrom
Conversation
- Import get_mcp_tools from query_v2 endpoint module - Add tools parameter to retrieve_simple_response() - Pass MCP tool definitions to responses.create() - Build MCP tools from configuration in infer_endpoint() - Add unit tests for tools passthrough and default behavior - Add integration tests for MCP tools and no-MCP regression Signed-off-by: Major Hayden <major@redhat.com>
Contributor
WalkthroughThis pull request adds MCP (Model Context Protocol) tool support to the RLS API v1 retrieve flow. The Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant infer_endpoint
participant get_mcp_tools
participant retrieve_simple_response
participant LlamaStackClient as Llama Stack Client
Client->>infer_endpoint: POST /infer<br/>(question, instructions)
infer_endpoint->>get_mcp_tools: Call with<br/>configuration.mcp_servers
get_mcp_tools-->>infer_endpoint: Return tools list
infer_endpoint->>retrieve_simple_response: Call with<br/>(question, instructions, tools)
retrieve_simple_response->>LlamaStackClient: client.responses.create<br/>(..., tools=tools)
LlamaStackClient-->>retrieve_simple_response: Response with<br/>generated text
retrieve_simple_response-->>infer_endpoint: Return response text
infer_endpoint-->>Client: Return response
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly Related PRs
Suggested Labels
Suggested Reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
RSPEED-2402
Allow the rlsapi v1 (
/v1/infer) endpoint to use MCP servers transparently.The client sends a plain question and gets a plain text answer, but behind the
scenes the LLM can call MCP tools (e.g., a RAG knowledge base) to enrich its
response.
The query v2 endpoint already supports MCP. The rlsapi v1 endpoint uses the
same underlying
responses.create()API — it just never passed thetoolsparameter. This change closes that gap by reusing
get_mcp_tools()fromquery v2.
Type of change
Tools used to create PR
Related Tickets & Documents
Checklist before requesting a review
Testing
mcp_serversinlightspeed-stack.yaml:/v1/inferwith a question that benefits from tool use/v1/inferwith nomcp_serversconfigured — verifyidentical behavior to before this change (regression test)
Summary by CodeRabbit
Release Notes