mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-18 12:29:47 +00:00
add model context protocol provider (#665)
# What does this PR do? Changes: * Adds a new API to discover tools available on a runtime * Adds a new model context protocol provider ## Test Plan ``` # clone python sdk for mcp and start the simple-tool server uv run mcp-simple-tool --transport sse --port 56000 curl -X POST 'http://localhost:5000/alpha/toolgroups/register' \ -H 'Content-Type: application/json' \ -d '{ "tool_group": { "name": "simple_mcp_group", "type": "model_context_protocol", "endpoint": {"uri": "http://localhost:56000/sse"} }, "provider_id": "model-context-protocol" }' curl -X POST 'http://localhost:5000/alpha/tool-runtime/invoke' \ -H 'Content-Type: application/json' \ -d '{ "tool_id": "fetch", "args": { "url": "http://google.com/" } }' ```
This commit is contained in:
parent
dc21e14f64
commit
e95c168bc0
8 changed files with 160 additions and 10 deletions
|
|
@ -393,3 +393,8 @@ class ToolRuntimeRouter(ToolRuntime):
|
|||
tool_id=tool_id,
|
||||
args=args,
|
||||
)
|
||||
|
||||
async def discover_tools(self, tool_group: ToolGroup) -> List[Tool]:
|
||||
return await self.routing_table.get_provider_impl(
|
||||
tool_group.name
|
||||
).discover_tools(tool_group)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue