Skip to content

Commit 4c1d01c

Browse files
authored
[MCP-266] Add Gumloop extension tests and fix CI (#12)
* [MCP-266] Add tests for Gumloop server extensions * Fix uv workspace config for gumloop-mcp package name
1 parent a4da230 commit 4c1d01c

File tree

15 files changed

+435
-122
lines changed

15 files changed

+435
-122
lines changed

examples/servers/simple-auth/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies = [
1010
"anyio>=4.5",
1111
"click>=8.2.0",
1212
"httpx>=0.27",
13-
"mcp",
13+
"gumloop-mcp",
1414
"pydantic>=2.0",
1515
"pydantic-settings>=2.5.2",
1616
"sse-starlette>=1.6.1",

examples/servers/simple-pagination/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ maintainers = [
99
{ name = "David Soria Parra", email = "[email protected]" },
1010
{ name = "Justin Spahr-Summers", email = "[email protected]" },
1111
]
12-
keywords = ["mcp", "llm", "automation", "pagination", "cursor"]
12+
keywords = ["gumloop-mcp", "llm", "automation", "pagination", "cursor"]
1313
license = { text = "MIT" }
1414
classifiers = [
1515
"Development Status :: 4 - Beta",
@@ -18,7 +18,7 @@ classifiers = [
1818
"Programming Language :: Python :: 3",
1919
"Programming Language :: Python :: 3.10",
2020
]
21-
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx>=0.27", "mcp"]
21+
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx>=0.27", "gumloop-mcp"]
2222

2323
[project.scripts]
2424
mcp-simple-pagination = "mcp_simple_pagination.server:main"

examples/servers/simple-prompt/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ maintainers = [
99
{ name = "David Soria Parra", email = "[email protected]" },
1010
{ name = "Justin Spahr-Summers", email = "[email protected]" },
1111
]
12-
keywords = ["mcp", "llm", "automation", "web", "fetch"]
12+
keywords = ["gumloop-mcp", "llm", "automation", "web", "fetch"]
1313
license = { text = "MIT" }
1414
classifiers = [
1515
"Development Status :: 4 - Beta",
@@ -18,7 +18,7 @@ classifiers = [
1818
"Programming Language :: Python :: 3",
1919
"Programming Language :: Python :: 3.10",
2020
]
21-
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx>=0.27", "mcp"]
21+
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx>=0.27", "gumloop-mcp"]
2222

2323
[project.scripts]
2424
mcp-simple-prompt = "mcp_simple_prompt.server:main"

examples/servers/simple-resource/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ maintainers = [
99
{ name = "David Soria Parra", email = "[email protected]" },
1010
{ name = "Justin Spahr-Summers", email = "[email protected]" },
1111
]
12-
keywords = ["mcp", "llm", "automation", "web", "fetch"]
12+
keywords = ["gumloop-mcp", "llm", "automation", "web", "fetch"]
1313
license = { text = "MIT" }
1414
classifiers = [
1515
"Development Status :: 4 - Beta",
@@ -18,7 +18,7 @@ classifiers = [
1818
"Programming Language :: Python :: 3",
1919
"Programming Language :: Python :: 3.10",
2020
]
21-
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx>=0.27", "mcp"]
21+
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx>=0.27", "gumloop-mcp"]
2222

2323
[project.scripts]
2424
mcp-simple-resource = "mcp_simple_resource.server:main"

examples/servers/simple-streamablehttp-stateless/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ description = "A simple MCP server exposing a StreamableHttp transport in statel
55
readme = "README.md"
66
requires-python = ">=3.10"
77
authors = [{ name = "Anthropic, PBC." }]
8-
keywords = ["mcp", "llm", "automation", "web", "fetch", "http", "streamable", "stateless"]
8+
keywords = ["gumloop-mcp", "llm", "automation", "web", "fetch", "http", "streamable", "stateless"]
99
license = { text = "MIT" }
10-
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx>=0.27", "mcp", "starlette", "uvicorn"]
10+
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx>=0.27", "gumloop-mcp", "starlette", "uvicorn"]
1111

1212
[project.scripts]
1313
mcp-simple-streamablehttp-stateless = "mcp_simple_streamablehttp_stateless.server:main"

examples/servers/simple-streamablehttp/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ description = "A simple MCP server exposing a StreamableHttp transport for testi
55
readme = "README.md"
66
requires-python = ">=3.10"
77
authors = [{ name = "Anthropic, PBC." }]
8-
keywords = ["mcp", "llm", "automation", "web", "fetch", "http", "streamable"]
8+
keywords = ["gumloop-mcp", "llm", "automation", "web", "fetch", "http", "streamable"]
99
license = { text = "MIT" }
10-
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx>=0.27", "mcp", "starlette", "uvicorn"]
10+
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx>=0.27", "gumloop-mcp", "starlette", "uvicorn"]
1111

1212
[project.scripts]
1313
mcp-simple-streamablehttp = "mcp_simple_streamablehttp.server:main"

examples/servers/simple-tool/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ maintainers = [
99
{ name = "David Soria Parra", email = "[email protected]" },
1010
{ name = "Justin Spahr-Summers", email = "[email protected]" },
1111
]
12-
keywords = ["mcp", "llm", "automation", "web", "fetch"]
12+
keywords = ["gumloop-mcp", "llm", "automation", "web", "fetch"]
1313
license = { text = "MIT" }
1414
classifiers = [
1515
"Development Status :: 4 - Beta",
@@ -18,7 +18,7 @@ classifiers = [
1818
"Programming Language :: Python :: 3",
1919
"Programming Language :: Python :: 3.10",
2020
]
21-
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx>=0.27", "mcp"]
21+
dependencies = ["anyio>=4.5", "click>=8.2.0", "httpx>=0.27", "gumloop-mcp"]
2222

2323
[project.scripts]
2424
mcp-simple-tool = "mcp_simple_tool.server:main"

examples/snippets/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
description = "MCP Example Snippets"
55
requires-python = ">=3.10"
66
dependencies = [
7-
"mcp",
7+
"gumloop-mcp",
88
]
99

1010
[build-system]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ max-statements = 102 # Default is 50
126126
members = ["examples/servers/*", "examples/snippets"]
127127

128128
[tool.uv.sources]
129-
mcp = { workspace = true }
129+
gumloop-mcp = { workspace = true }
130130

131131
[tool.pytest.ini_options]
132132
xfail_strict = true
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
"""Tests for Gumloop aggregate_tool_call_results config."""
2+
3+
import json
4+
5+
import pytest
6+
7+
from mcp.server import Server
8+
from mcp.shared.memory import create_connected_server_and_client_session
9+
from mcp.types import TextContent, Tool
10+
11+
12+
@pytest.mark.anyio
13+
async def test_aggregate_tool_call_results_enabled():
14+
"""When aggregate_tool_call_results=True, multiple content items combine into single JSON."""
15+
server = Server("test")
16+
server.config = {"aggregate_tool_call_results": True}
17+
18+
@server.list_tools()
19+
async def list_tools():
20+
return [Tool(name="multi", description="Multi", inputSchema={"type": "object", "properties": {}})]
21+
22+
@server.call_tool()
23+
async def call_tool(name: str, arguments: dict):
24+
return [TextContent(type="text", text="Result 1"), TextContent(type="text", text="Result 2")]
25+
26+
async with create_connected_server_and_client_session(server) as client:
27+
result = await client.call_tool("multi", {})
28+
29+
assert result.isError is False
30+
assert len(result.content) == 1
31+
parsed = json.loads(result.content[0].text)
32+
assert len(parsed) == 2
33+
assert parsed[0]["text"] == "Result 1"
34+
assert parsed[1]["text"] == "Result 2"
35+
36+
37+
@pytest.mark.anyio
38+
async def test_aggregate_tool_call_results_disabled():
39+
"""When aggregate_tool_call_results not set, multiple content items remain separate."""
40+
server = Server("test")
41+
42+
@server.list_tools()
43+
async def list_tools():
44+
return [Tool(name="multi", description="Multi", inputSchema={"type": "object", "properties": {}})]
45+
46+
@server.call_tool()
47+
async def call_tool(name: str, arguments: dict):
48+
return [TextContent(type="text", text="Result 1"), TextContent(type="text", text="Result 2")]
49+
50+
async with create_connected_server_and_client_session(server) as client:
51+
result = await client.call_tool("multi", {})
52+
53+
assert result.isError is False
54+
assert len(result.content) == 2
55+
assert result.content[0].text == "Result 1"
56+
assert result.content[1].text == "Result 2"

0 commit comments

Comments
 (0)