Skip to content

Commit d5907a8

Browse files
authored
fix(agno): restore MCP functionality (#94)
Latest mcp-gateway no longer supports stdio over TCP. Since SSE doesn't seem to work on agno either, use streaming-http instead. Also, add a missing depends_on from the agents image to the MCP gateway.
1 parent 204ab37 commit d5907a8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

agno/agent/playground.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ async def create_mcp_tools(tools_list: list[str], entity_type: str) -> list[Tool
7979
transport: str = ""
8080
if gateway_url.startswith("http://") or gateway_url.startswith("https://"):
8181
url = gateway_url
82-
transport = "sse"
83-
print(f"DEBUG: {entity_type} connecting to MCP gateway via SSE {url}")
82+
transport = "streamable-http"
83+
print(
84+
f"DEBUG: {entity_type} connecting to MCP gateway via streamable-http {url}"
85+
)
8486
else:
8587
# Assume it's a TCP endpoint
8688
tcp_endpoint = gateway_url

agno/compose.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ services:
88
- "7777:7777"
99
environment:
1010
# point agents at the MCP gateway
11-
- MCPGATEWAY_URL=mcp-gateway:8811
11+
- MCPGATEWAY_URL=http://mcp-gateway:8811
12+
depends_on:
13+
- mcp-gateway
1214
volumes:
1315
# mount the agents file
1416
- ./agents.yaml:/agents.yaml
@@ -34,6 +36,7 @@ services:
3436
# use docker API socket to start MCP servers
3537
use_api_socket: true
3638
command:
39+
- --transport=streaming
3740
# securely embed secrets into the gateway
3841
- --secrets=/run/secrets/mcp_secret
3942
# add any MCP servers you want to use

0 commit comments

Comments
 (0)