Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions libs/arcade-core/arcade_core/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = No
super().__init__(id=id, scopes=scopes)


class PagerDuty(OAuth2):
"""Marks a tool as requiring PagerDuty authorization."""

provider_id: str = "pagerduty"

def __init__(self, *, id: Optional[str] = None, scopes: Optional[list[str]] = None): # noqa: A002
super().__init__(id=id, scopes=scopes)


class Reddit(OAuth2):
"""Marks a tool as requiring Reddit authorization."""

Expand Down
8 changes: 3 additions & 5 deletions libs/arcade-core/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
[project]
name = "arcade-core"
version = "4.0.0"
version = "4.1.0"
description = "Arcade Core - Core library for Arcade platform"
readme = "README.md"
license = {text = "MIT"}
authors = [
{name = "Arcade", email = "[email protected]"},
]
license = { text = "MIT" }
authors = [{ name = "Arcade", email = "[email protected]" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand Down
2 changes: 2 additions & 0 deletions libs/arcade-mcp-server/arcade_mcp_server/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Microsoft,
Notion,
OAuth2,
PagerDuty,
Reddit,
Slack,
Spotify,
Expand All @@ -36,6 +37,7 @@
"LinkedIn",
"Microsoft",
"Notion",
"PagerDuty",
"OAuth2",
"Reddit",
"Slack",
Expand Down
15 changes: 5 additions & 10 deletions libs/arcade-mcp-server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "arcade-mcp-server"
version = "1.13.0"
version = "1.14.0"
description = "Model Context Protocol (MCP) server framework for Arcade.dev"
readme = "README.md"
authors = [{ name = "Arcade.dev" }]
Expand All @@ -21,14 +21,14 @@ classifiers = [
]
requires-python = ">=3.10"
dependencies = [
"arcade-core>=4.0.0,<5.0.0",
"arcade-core>=4.1.0,<5.0.0",
"arcade-serve>=3.2.0,<4.0.0",
"arcade-tdk>=3.3.0,<4.0.0",
"arcade-tdk>=3.4.0,<4.0.0",
"arcadepy>=1.5.0",
"pydantic>=2.0.0",
"fastapi>=0.100.0",
"uvicorn>=0.30.0",
"watchfiles>=0.18.0", # included with uvicorn, but listed to be explicit
"watchfiles>=0.18.0", # included with uvicorn, but listed to be explicit
"sse-starlette>=2.0.0",
"starlette>=0.37.0",
"anyio>=4.0.0",
Expand All @@ -39,12 +39,7 @@ dependencies = [
]

[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"pytest-asyncio>=0.23.0",
"mypy>=1.0.0",
"ruff>=0.1.0",
]
dev = ["pytest>=8.0.0", "pytest-asyncio>=0.23.0", "mypy>=1.0.0", "ruff>=0.1.0"]

[tool.hatch.build.targets.wheel]
packages = ["arcade_mcp_server"]
2 changes: 2 additions & 0 deletions libs/arcade-tdk/arcade_tdk/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Microsoft,
Notion,
OAuth2,
PagerDuty,
Reddit,
Slack,
Spotify,
Expand All @@ -36,6 +37,7 @@
"LinkedIn",
"Microsoft",
"Notion",
"PagerDuty",
"OAuth2",
"Reddit",
"Slack",
Expand Down
13 changes: 4 additions & 9 deletions libs/arcade-tdk/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
[project]
name = "arcade-tdk"
version = "3.3.0"
version = "3.4.0"
description = "Arcade TDK - Toolkit Development Kit for building Arcade tools"
readme = "README.md"
license = {text = "MIT"}
authors = [
{name = "Arcade", email = "[email protected]"},
]
license = { text = "MIT" }
authors = [{ name = "Arcade", email = "[email protected]" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand All @@ -18,10 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3.13",
]
requires-python = ">=3.10"
dependencies = [
"arcade-core>=4.0.0,<5.0.0",
"pydantic>=2.7.0",
]
dependencies = ["arcade-core>=4.1.0,<5.0.0", "pydantic>=2.7.0"]

[project.optional-dependencies]
dev = [
Expand Down
24 changes: 23 additions & 1 deletion libs/tests/sdk/test_tool_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
from arcade_core.auth import AuthProviderType, Google
from arcade_tdk import tool
from arcade_tdk.auth import OAuth2
from arcade_tdk.auth import OAuth2, PagerDuty


def test_sync_function():
Expand Down Expand Up @@ -50,6 +50,13 @@ async def async_func(x, y):
"google",
"my_google_provider123",
),
(PagerDuty, {"scopes": ["test_scope", "another.scope"]}, "pagerduty", None),
(
PagerDuty,
{"id": "my_pagerduty_provider123", "scopes": ["test_scope", "another.scope"]},
"pagerduty",
"my_pagerduty_provider123",
),
],
)
def test_tool_decorator_with_auth_success(
Expand Down Expand Up @@ -102,6 +109,21 @@ def test_tool(x, y):
"scopes": ["test_scope", "another.scope"],
},
),
(
PagerDuty,
{
"provider_id": "my_example_provider_id_123",
"scopes": ["test_scope", "another.scope"],
},
),
(
PagerDuty,
{
"provider_id": "my_example_provider_id_123",
"id": "my_example_id_123",
"scopes": ["test_scope", "another.scope"],
},
),
],
)
def test_tool_decorator_with_auth_failure(auth_class, auth_kwargs):
Expand Down
29 changes: 28 additions & 1 deletion libs/tests/tool/test_create_tool_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from arcade_core.utils import snake_to_pascal_case
from arcade_tdk import tool
from arcade_tdk.annotations import Inferrable
from arcade_tdk.auth import Figma, GitHub, Google, OAuth2, Slack, X
from arcade_tdk.auth import Figma, GitHub, Google, OAuth2, PagerDuty, Slack, X


### Tests on @tool decorator
Expand Down Expand Up @@ -159,6 +159,17 @@ def func_with_x_requirement():
pass


@tool(
desc="A function that requires PagerDuty authorization",
requires_auth=PagerDuty(
id="my_pagerduty_provider123",
scopes=["read", "write"],
),
)
def func_with_pagerduty_auth_requirement():
pass


### Tests on input params
@tool(desc="A function with a non-inferrable input parameter")
def func_with_non_inferrable_param(param1: Annotated[str, "First param", Inferrable(False)]):
Expand Down Expand Up @@ -507,6 +518,22 @@ def func_with_complex_return() -> dict[str, str]:
)
},
),
pytest.param(
func_with_pagerduty_auth_requirement,
{
"requirements": ToolRequirements(
authorization=ToolAuthRequirement(
provider_id="pagerduty",
provider_type="oauth2",
id="my_pagerduty_provider123",
oauth2=OAuth2Requirement(
scopes=["read", "write"],
),
)
)
},
id="func_with_pagerduty_auth_requirement",
),
# Tests on input params
pytest.param(
func_with_non_inferrable_param,
Expand Down
29 changes: 10 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
[project]
name = "arcade-mcp"
version = "1.7.0"
version = "1.7.1"
description = "Arcade.dev - Tool Calling platform for Agents"
readme = "README.md"
license = {file = "LICENSE"}
authors = [
{name = "Arcade", email = "[email protected]"},
]
license = { file = "LICENSE" }
authors = [{ name = "Arcade", email = "[email protected]" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand All @@ -21,8 +19,8 @@ requires-python = ">=3.10"

dependencies = [
# CLI dependencies
"arcade-mcp-server>=1.13.0,<2.0.0",
"arcade-core>=4.0.0,<5.0.0",
"arcade-mcp-server>=1.14.0,<2.0.0",
"arcade-core>=4.1.0,<5.0.0",
"typer==0.10.0",
"rich>=14.0.0,<15.0.0",
"Jinja2==3.1.6",
Expand All @@ -43,11 +41,11 @@ all = [
"pytz>=2024.1",
"python-dateutil>=2.8.2",
# mcp
"arcade-mcp-server>=1.13.0,<2.0.0",
"arcade-mcp-server>=1.14.0,<2.0.0",
# serve
"arcade-serve>=3.2.0,<4.0.0",
# tdk
"arcade-tdk>=3.3.0,<4.0.0",
"arcade-tdk>=3.4.0,<4.0.0",
]
# Evals also depends on arcade-core and openai, but they are already required deps
evals = [
Expand Down Expand Up @@ -89,10 +87,7 @@ requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = [
"libs/arcade-cli/arcade_cli",
"libs/arcade-evals/arcade_evals",
]
packages = ["libs/arcade-cli/arcade_cli", "libs/arcade-evals/arcade_evals"]

[tool.uv.workspace]
members = [
Expand All @@ -113,7 +108,7 @@ warn_unused_ignores = true
show_error_codes = true
ignore_missing_imports = true
exclude = [
'.*{{.*}}.*' # Ignore files that have names that use Jinja template syntax
'.*{{.*}}.*', # Ignore files that have names that use Jinja template syntax
]

[tool.pytest.ini_options]
Expand All @@ -133,11 +128,7 @@ addopts = [

[tool.coverage.run]
source = ["libs"]
omit = [
"*/tests/*",
"*/test_*",
"*/__pycache__/*",
]
omit = ["*/tests/*", "*/test_*", "*/__pycache__/*"]
parallel = true
patch = ["subprocess"]

Expand Down