@devries-cameron20 / composio-1 / commits / 79b4912d3
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

feat(core): update owned clients to `2.0.0-rc.14` (#4863)

This PR: - moves `@composio/client` and `composio-client` from `2.0.0-rc.13` to `2.0.0-rc.14` (https://github.com/ComposioHQ/composio-client/pull/83), covering the TypeScript SDK, Python SDK, and CLI - accepts the new `createHint` and `updateHint` Session tool tags in TypeScript and Python (`ToolRouterTag`); rc.14 breaks the TS typecheck and Python mypy without this - adds the experimental `instant.returnPricesInSearch` / `return_prices_in_search` Session option, and exposes `instantAccount.prices` / `instant_account.prices` (keyed by tool slug) in Session search results - replaces the client's new `managed_auth_by_composio` deprecation notice on `mcp.generate()` with an SDK-level one pointing to Session MCP endpoints; the field is still sent, so generated URLs keep their connection-management tools - renames the unreleased changeset to `owned-client-rc14.md` and documents the price option in `instant-tools.mdx` ## Context rc.14 refreshes the Apollo contract (https://github.com/ComposioHQ/composio-client/pull/82). Its release notes flag that both SDKs' hardcoded four-tag lists reject the refreshed client types. The client now warns whenever `managed_auth_by_composio` is sent. The SDK sends it on every default `mcp.generate()` call, so users would see a notice naming `client.mcp.generate.url`, a call they never make. Dropping the field would remove `include_composio_helper_actions` from existing URLs, so the SDK keeps sending it and warns once per process in its own terms. - TypeScript silences the client's notice for this call only, with `withOptions({ logLevel: 'error' })`. A test fails if the client's notice reaches the logger. - Python has no per-call switch, and `warnings.catch_warnings` would reset every module's record of warnings already shown on each call. So the client's notice still appears once per client instance, next to the SDK's once-per-process notice. `manually_manage_connections=True` omits the field (the API default is `false`), so callers who opt out see no notice. A subprocess test under Python's default filters checks that repeated calls neither repeat the notice nor make other warnings show again. rc.14 also makes `return_prices_in_search` a required field of the Session `instant` config in responses. I could not verify against production that the API already returns it. If it does not, the Python client falls back to a plain dict for `session.config.instant`. `uv.lock` gains 31 dependency-marker lines that mean the same thing. They come from the pinned uv `0.8.19` re-resolving the lock; `uv lock --check` passes. Verified locally: - TypeScript core: typecheck including type tests passes; 1817 tests passed, plus 2 expected failures - CLI: typecheck passes; 1400 tests passed, 1 skipped - Python: `nox -s chk` passes; 2452 tests passed - 62 Python provider tests (gemini, google, crewai, argument serialization) fail identically on `next` with rc.13, because local provider installs are stale

Alberto Schiabel committed Oct 14, 2026 at 20:31 UTC 79b4912d3fbe80c32a6b3f51d41e9766d6cab121
23 files changed +402 -56
.changeset/owned-client-rc13.md deleted
-6
@@ -1,6 +0,0 @@
1 ----
2 -'@composio/core': patch
3 -'@composio/slim': patch
4 ----
5 -
6 -Update the owned API client to `@composio/client@2.0.0-rc.13`. OAuth connection data types now accept a `null` `id_token`.
.changeset/owned-client-rc14.md new
+6
@@ -0,0 +1,6 @@
1 +---
2 +'@composio/core': patch
3 +'@composio/slim': patch
4 +---
5 +
6 +Update the owned API client to `@composio/client@2.0.0-rc.14`. OAuth connection data types now accept a `null` `id_token`. Session tag filters accept the `createHint` and `updateHint` tags. The experimental `instant.returnPricesInSearch` Session option returns each Instant tool's price in Session search results, under `toolkitConnectionStatuses[].instantAccount.prices`. `composio.mcp.generate()` now warns once that its URLs rely on the deprecated `include_composio_helper_actions` query parameter; switch to a Session's MCP endpoint.
docs/content/docs/instant-tools.mdx
+2
@@ -188,6 +188,8 @@ Instant uses shared provider accounts, so tools exposing account history or othe
188
189 Session search returns `instant_account.allowed_tool_slugs` (`instantAccount.allowedToolSlugs` in TypeScript) for a toolkit served by an Instant account. Other tools in that toolkit need your own connection.
190
191 +To also see each tool's price in search results, set the experimental `return_prices_in_search` option (`returnPricesInSearch` in TypeScript) in the Session's `instant` policy. Prices appear under `instant_account.prices` (`instantAccount.prices`), keyed by tool slug.
192 +
193 To select Instant explicitly, pass `account="instant_account"` to Python `session.execute()`, or `{ account: "instant_account" }` as TypeScript execution options. On a single-account project, this must match an active connection for the toolkit in the Session. Project policy, Session policy, and tool eligibility still apply. A failed call does not fall back to another account.
194
195 Composio-managed auth is different: Composio supplies the OAuth app credentials, but your user still connects their own account. It does not establish Instant support.
pnpm-lock.yaml
+9 -9
@@ -28,8 +28,8 @@ catalogs:
28 specifier: ^5.20261009.1
29 version: 5.20261009.1
30 '@composio/client':
31 - specifier: 2.0.0-rc.13
32 - version: 2.0.0-rc.13
31 + specifier: 2.0.0-rc.14
32 + version: 2.0.0-rc.14
33 '@effect/language-service':
34 specifier: ^0.87.4
35 version: 0.87.4
@@ -968,7 +968,7 @@ importers:
968 dependencies:
969 '@composio/client':
970 specifier: 'catalog:'
971 - version: 2.0.0-rc.13(effect@4.0.3)
971 + version: 2.0.0-rc.14(effect@4.0.3)
972 '@composio/core':
973 specifier: workspace:*
974 version: link:../../packages/core
@@ -1216,7 +1216,7 @@ importers:
1216 version: link:../cli-keyring
1217 '@composio/client':
1218 specifier: 'catalog:'
1219 - version: 2.0.0-rc.13(effect@4.0.3)
1219 + version: 2.0.0-rc.14(effect@4.0.3)
1220 '@composio/core':
1221 specifier: workspace:*
1222 version: link:../core
@@ -1322,7 +1322,7 @@ importers:
1322 dependencies:
1323 '@composio/client':
1324 specifier: 'catalog:'
1325 - version: 2.0.0-rc.13(effect@4.0.3)
1325 + version: 2.0.0-rc.14(effect@4.0.3)
1326 '@composio/json-schema-to-zod':
1327 specifier: workspace:*
1328 version: link:../json-schema-to-zod
@@ -1727,7 +1727,7 @@ importers:
1727 dependencies:
1728 '@composio/client':
1729 specifier: 'catalog:'
1730 - version: 2.0.0-rc.13(effect@4.0.3)
1730 + version: 2.0.0-rc.14(effect@4.0.3)
1731 '@composio/json-schema-to-zod':
1732 specifier: workspace:*
1733 version: link:../json-schema-to-zod
@@ -2289,8 +2289,8 @@ packages:
2289 resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==}
2290 engines: {node: '>=0.1.90'}
2291
2292 - '@composio/client@2.0.0-rc.13':
2293 - resolution: {integrity: sha512-3tDSJjpFL8gi0EBLAQ3BvAxPitzguDduyRw0JQvCtfeR96ZY0up0DKuxheSN3phUrhLi97QJgPKAa5Hq0WCIfA==}
2292 + '@composio/client@2.0.0-rc.14':
2293 + resolution: {integrity: sha512-AI8peOJpZjIZOC5+7uWeaQSgjwU9XsMHLXmHLrO3xE4qREb17pT1rb64AcaY9N4VFAevg321yLGA08RKCmcWDw==}
2294 engines: {node: '>=22'}
2295 peerDependencies:
2296 effect: '*'
@@ -7486,7 +7486,7 @@ snapshots:
7486 '@colors/colors@1.5.0':
7487 optional: true
7488
7489 - '@composio/client@2.0.0-rc.13(effect@4.0.3)':
7489 + '@composio/client@2.0.0-rc.14(effect@4.0.3)':
7490 optionalDependencies:
7491 effect: 4.0.3
7492
pnpm-workspace.yaml
+1 -1
@@ -33,7 +33,7 @@ catalog:
33 '@clack/prompts': '^1.8.1'
34 '@cloudflare/vitest-pool-workers': 0.23.0
35 '@cloudflare/workers-types': ^5.20261009.1
36 - '@composio/client': 2.0.0-rc.13
36 + '@composio/client': 2.0.0-rc.14
37 '@effect/language-service': ^0.87.4
38 '@effect/platform-bun': 4.0.3
39 '@effect/vitest': 4.0.3
python/composio/core/models/mcp.py
+30 -2
@@ -7,13 +7,15 @@ This module provides MCP server operations
7 from __future__ import annotations
8
9 import typing as t
10 +import warnings
11
12 import typing_extensions as te
13 +from composio_client import omit
14 from composio_client.types.mcp.custom_create_response import CustomCreateResponse
15
16 from composio.client import HttpClient
17 from composio.core.models.base import Resource
16 -from composio.exceptions import ValidationError
18 +from composio.exceptions import ComposioDeprecationWarning, ValidationError
19 from composio.utils.pydantic import none_to_omit
20
21 # Data Types (matching TypeScript specification)
@@ -101,6 +103,22 @@ def _add_generate_method(
103 return t.cast(MCPCreateResponse, response)
104
105
106 +# ``managed_auth_by_composio`` is deprecated upstream, but dropping it would strip
107 +# the connection-management tools from generated URLs. Keep sending it and warn
108 +# once per process in SDK terms. The API client still raises its own notice once
109 +# per client instance: it has no per-call switch, and ``warnings.catch_warnings``
110 +# would reset every module's "already shown" registry on each call.
111 +_MANAGED_AUTH_DEPRECATION = (
112 + "composio.mcp.generate() returns URLs that rely on the deprecated "
113 + "include_composio_helper_actions query parameter, which the API will remove "
114 + "in a future version. Switch to a session MCP endpoint: "
115 + "composio.create(user_id, mcp=True) exposes session.mcp.url with "
116 + "connection-management tools built in. "
117 + "https://docs.composio.dev/docs/sessions-via-mcp"
118 +)
119 +_managed_auth_deprecation_warned = False
120 +
121 +
122 class MCP(Resource):
123 """
124 MCP (Model Control Protocol) class.
@@ -472,10 +490,20 @@ class MCP(Resource):
490 server_details = self._client.mcp.retrieve(mcp_config_id)
491
492 # Generate server URLs (matching TS: this.client.mcp.generate.url)
493 + managed_auth_by_composio = not manually_manage_connections
494 + global _managed_auth_deprecation_warned
495 + if managed_auth_by_composio and not _managed_auth_deprecation_warned:
496 + _managed_auth_deprecation_warned = True
497 + # 3: past ``Resource``'s trace wrapper to the caller's line.
498 + warnings.warn(
499 + _MANAGED_AUTH_DEPRECATION, ComposioDeprecationWarning, stacklevel=3
500 + )
501 + # The API defaults the field to false, so opting out omits it and
502 + # raises no client notice.
503 url_response = self._client.mcp.generate.url(
504 mcp_server_id=mcp_config_id,
505 user_ids=[user_id],
478 - managed_auth_by_composio=False if manually_manage_connections else True,
506 + managed_auth_by_composio=True if managed_auth_by_composio else omit,
507 )
508
509 # Get the generated URL (matching TS: urlResponse.user_ids_url[0])
python/composio/core/models/tool_router.py
+9 -3
@@ -116,7 +116,12 @@ def _origin(url: str, role: str) -> str:
116
117 # Type alias for MCP tag literals
118 ToolRouterTag = t.Literal[
119 - "readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"
119 + "readOnlyHint",
120 + "createHint",
121 + "updateHint",
122 + "destructiveHint",
123 + "idempotentHint",
124 + "openWorldHint",
125 ]
126
127 # Type alias for sandbox compute tier on the session sandbox
@@ -836,8 +841,9 @@ class ToolRouter(Resource, t.Generic[TTool, TToolCollection]):
841 Example: ['readOnlyHint', 'idempotentHint']
842 - ToolRouterTagsEnableDisableConfig: Dict with 'enable' and/or 'disable' keys.
843 Example: {'enable': ['readOnlyHint'], 'disable': ['destructiveHint']}
839 - Available tag values: 'readOnlyHint', 'destructiveHint',
840 - 'idempotentHint', 'openWorldHint'.
844 + Available tag values: 'readOnlyHint', 'createHint',
845 + 'updateHint', 'destructiveHint', 'idempotentHint',
846 + 'openWorldHint'.
847 Toolkit-level tags override this global setting.
848 :param manage_connections: Optional connection management configuration. Can be:
849 - bool: Simple boolean to enable/disable.
python/composio/core/models/tool_router_session.py
+5 -1
@@ -156,6 +156,9 @@ class ToolRouterInstantConfig(te.TypedDict, total=False):
156 toolkits: t.Union[ToolRouterInstantEnable, ToolRouterInstantDisable]
157 tools: t.Dict[str, t.Union[ToolRouterInstantEnable, ToolRouterInstantDisable]]
158 return_instant_charge: bool
159 + return_prices_in_search: bool
160 + """Experimental. Show each Instant tool's price in Session search results,
161 + under ``instant_account.prices``. Controls visibility only."""
162
163
164 class ToolRouterProxyExecuteConfig(te.TypedDict):
@@ -192,7 +195,8 @@ ToolRouterSessionMetaToolSlug = t.Literal[
195 ToolRouterSessionSearchResponse = session_search_response.SessionSearchResponse
196 """Session search result. A toolkit served by a Composio Instant account
197 lists the covered tools at ``instant_account.allowed_tool_slugs`` on its
195 -connection status."""
198 +connection status, and their prices at ``instant_account.prices`` when the
199 +Session sets ``instant.return_prices_in_search``."""
200
201
202 class ToolRouterUpdateManageConnectionsConfig(te.TypedDict, total=False):
python/pyproject.toml
+1 -1
@@ -7,7 +7,7 @@ requires-python = ">=3.10,<4"
7 dependencies = [
8 "pysher>=1.0.8",
9 "pydantic>=2.11.9",
10 - "composio-client==2.0.0rc13",
10 + "composio-client==2.0.0rc14",
11 "typing-extensions>=4.16.0",
12 "openai>=2.48.0",
13 "json-schema-to-pydantic>=0.4.11",
python/setup.py
+1 -1
@@ -25,7 +25,7 @@ setup(
25 install_requires=[
26 "pysher>=1.0.8",
27 "pydantic>=2.11.9",
28 - "composio-client==2.0.0rc13",
28 + "composio-client==2.0.0rc14",
29 "typing-extensions>=4.16.0",
30 "openai>=2.48.0",
31 "json-schema-to-pydantic>=0.4.11",
python/tests/test_mcp.py
+134
@@ -10,10 +10,19 @@ Regression coverage for the hackathon Area 5 (MCP lifecycle) findings:
10 - ``create`` uses the non-deprecated ``allowed_tools`` field.
11 """
12
13 +import json
14 +import subprocess
15 +import sys
16 +import typing as t
17 +import warnings
18 from unittest.mock import Mock
19
20 +import httpx
21 import pytest
22
23 +from composio import ComposioDeprecationWarning
24 +from composio.client import HttpClient
25 +from composio.core.models import mcp as mcp_module
26 from composio.core.models.mcp import MCP
27
28
@@ -111,3 +120,128 @@ def test_create_inverts_manually_manage_connections(mcp):
120 mcp._client.mcp.custom.create.call_args.kwargs["managed_auth_via_composio"]
121 is True
122 )
123 +
124 +
125 +def _transport_mcp(requests: t.Optional[t.List[httpx.Request]] = None) -> MCP:
126 + def handler(request: httpx.Request) -> httpx.Response:
127 + if requests is not None:
128 + requests.append(request)
129 + if request.url.path.endswith("/generate"):
130 + return httpx.Response(
131 + 200,
132 + json={
133 + "mcp_url": "https://mcp.test",
134 + "connected_account_urls": [],
135 + "user_ids_url": ["https://mcp.test/u"],
136 + },
137 + )
138 + return httpx.Response(
139 + 200,
140 + json={
141 + "id": "mcp_123",
142 + "name": "server",
143 + "allowed_tools": [],
144 + "auth_config_ids": [],
145 + },
146 + )
147 +
148 + client = HttpClient(
149 + provider="test",
150 + api_key="ak_test",
151 + base_url="https://backend.composio.dev",
152 + http_client=httpx.Client(transport=httpx.MockTransport(handler)),
153 + )
154 + return MCP(client)
155 +
156 +
157 +@pytest.fixture
158 +def fresh_managed_auth_notice(monkeypatch):
159 + monkeypatch.setattr(mcp_module, "_managed_auth_deprecation_warned", False)
160 +
161 +
162 +def _sdk_notices(caught):
163 + return [
164 + w
165 + for w in caught
166 + if w.category is ComposioDeprecationWarning
167 + and "include_composio_helper_actions" in str(w.message)
168 + ]
169 +
170 +
171 +def test_generate_warns_once_per_process(fresh_managed_auth_notice):
172 + """The SDK still sends `managed_auth_by_composio` (deprecated upstream) and
173 + explains it once in SDK terms, even across call sites and instances."""
174 + first, second = _transport_mcp(), _transport_mcp()
175 +
176 + with warnings.catch_warnings(record=True) as caught:
177 + warnings.simplefilter("always")
178 + server = first.generate("user_123", "mcp_123")
179 + first.generate("user_123", "mcp_123")
180 + second.generate("user_123", "mcp_123")
181 +
182 + assert server["url"] == "https://mcp.test/u"
183 + notices = _sdk_notices(caught)
184 + assert len(notices) == 1
185 + assert notices[0].filename == __file__
186 +
187 +
188 +def test_generate_without_managed_auth_omits_field_and_does_not_warn(
189 + fresh_managed_auth_notice,
190 +):
191 + requests: t.List[httpx.Request] = []
192 + mcp = _transport_mcp(requests)
193 +
194 + with warnings.catch_warnings(record=True) as caught:
195 + warnings.simplefilter("always")
196 + mcp.generate("user_123", "mcp_123", manually_manage_connections=True)
197 +
198 + assert caught == []
199 + body = json.loads(requests[-1].content)
200 + assert "managed_auth_by_composio" not in body
201 +
202 +
203 +_DEFAULT_FILTERS_SCRIPT = """
204 +import warnings
205 +
206 +import httpx
207 +
208 +from composio.client import HttpClient
209 +from composio.core.models.mcp import MCP
210 +
211 +
212 +def handler(request):
213 + if request.url.path.endswith("/generate"):
214 + return httpx.Response(
215 + 200, json={"mcp_url": "u", "connected_account_urls": [], "user_ids_url": ["x"]}
216 + )
217 + return httpx.Response(
218 + 200, json={"id": "m", "name": "s", "allowed_tools": [], "auth_config_ids": []}
219 + )
220 +
221 +
222 +mcp = MCP(
223 + HttpClient(
224 + provider="test",
225 + api_key="ak_test",
226 + base_url="https://backend.composio.dev",
227 + http_client=httpx.Client(transport=httpx.MockTransport(handler)),
228 + )
229 +)
230 +for _ in range(3):
231 + warnings.warn("unrelated notice", UserWarning)
232 + mcp.generate("u", "m")
233 +"""
234 +
235 +
236 +def test_generate_keeps_default_warning_deduplication():
237 + """Under Python's default filters, repeated calls neither repeat the SDK
238 + notice nor make an unrelated once-per-line warning show again."""
239 + result = subprocess.run(
240 + [sys.executable, "-c", _DEFAULT_FILTERS_SCRIPT],
241 + capture_output=True,
242 + text=True,
243 + check=True,
244 + )
245 +
246 + assert result.stderr.count("include_composio_helper_actions") == 1
247 + assert result.stderr.count("unrelated notice") == 1
python/tests/test_tool_router.py
+22 -3
@@ -2308,7 +2308,10 @@ def _session_json(mcp_url: str) -> t.Dict[str, t.Any]:
2308 "mcp": {"type": "http", "url": mcp_url},
2309 "config": {
2310 "user_id": "user_123",
2311 - "instant": {"return_instant_charge": True},
2311 + "instant": {
2312 + "return_instant_charge": True,
2313 + "return_prices_in_search": True,
2314 + },
2315 "execute": {},
2316 "search": {},
2317 "preload": {"tools": []},
@@ -2330,7 +2333,10 @@ def _search_json() -> t.Dict[str, t.Any]:
2333 "description": "Search",
2334 "has_active_connection": True,
2335 "status_message": "Instant account available",
2333 - "instant_account": {"allowed_tool_slugs": ["EXA_SEARCH"]},
2336 + "instant_account": {
2337 + "allowed_tool_slugs": ["EXA_SEARCH"],
2338 + "prices": {"EXA_SEARCH": {"description": "$0.01 per call"}},
2339 + },
2340 }
2341 ],
2342 "next_steps_guidance": [],
@@ -2347,7 +2353,14 @@ class TestInstantContractTransport:
2353 """Exercise new wire fields through the pinned generated client."""
2354
2355 @pytest.mark.parametrize(
2350 - "policy", [False, {}, {"return_instant_charge": True}, None]
2356 + "policy",
2357 + [
2358 + False,
2359 + {},
2360 + {"return_instant_charge": True},
2361 + {"return_prices_in_search": True},
2362 + None,
2363 + ],
2364 )
2365 def test_create_and_patch_send_new_policy(self, policy):
2366 client, requests = _transport_client(
@@ -2362,6 +2375,7 @@ class TestInstantContractTransport:
2375 assert body["instant"] == policy
2376 assert not isinstance(session.config.instant, bool)
2377 assert session.config.instant.return_instant_charge is True
2378 + assert session.config.instant.return_prices_in_search is True
2379
2380 if policy is None:
2381 session.update(expected_config_version=3)
@@ -2375,6 +2389,7 @@ class TestInstantContractTransport:
2389 assert body["instant"] == policy
2390 assert not isinstance(session.config.instant, bool)
2391 assert session.config.instant.return_instant_charge is True
2392 + assert session.config.instant.return_prices_in_search is True
2393
2394 attached = router.use(session_id="session_123")
2395 assert not isinstance(attached.config.instant, bool)
@@ -2418,6 +2433,10 @@ class TestInstantContractTransport:
2433 status = session.search(query="search").toolkit_connection_statuses[0]
2434 assert status.instant_account is not None
2435 assert status.instant_account.allowed_tool_slugs == ["EXA_SEARCH"]
2436 + assert status.instant_account.prices is not None
2437 + assert status.instant_account.prices["EXA_SEARCH"].description == (
2438 + "$0.01 per call"
2439 + )
2440 assert "hosted_account" not in status.model_dump()
2441
2442 def test_search_keeps_lenient_generated_response(self):
ts/packages/cli/AGENTS.md
+1 -1
@@ -110,7 +110,7 @@ Steps 3–4 (and the TypeScript compiler they need) ship as the `generation-runt
110
111 ### Key Dependencies
112
113 -`effect` (pinned `4.0.3`; `@effect/cli` and `@effect/platform` no longer exist as separate packages — folded into `effect`'s barrel and `effect/{cli,http,process}`), `@effect/platform-bun`, `@effect/vitest` (same exact pin), `@clack/prompts` (terminal UI — stderr by default), `picocolors`, `@composio/client` (owned Composio API client, `2.0.0-rc.13` via the workspace catalog), `@composio/core` (types), `@composio/ts-builders` (AST gen), `@composio/cli-keyring` (OS credential store), `@composio/json-schema-to-effect-schema`, `semver`, `open`, `extract-zip`.
113 +`effect` (pinned `4.0.3`; `@effect/cli` and `@effect/platform` no longer exist as separate packages — folded into `effect`'s barrel and `effect/{cli,http,process}`), `@effect/platform-bun`, `@effect/vitest` (same exact pin), `@clack/prompts` (terminal UI — stderr by default), `picocolors`, `@composio/client` (owned Composio API client, `2.0.0-rc.14` via the workspace catalog), `@composio/core` (types), `@composio/ts-builders` (AST gen), `@composio/cli-keyring` (OS credential store), `@composio/json-schema-to-effect-schema`, `semver`, `open`, `extract-zip`.
114
115 ## Output Conventions: Composable CLI Output
116
ts/packages/core/src/lib/toolRouterParams.ts
+3
@@ -220,6 +220,9 @@ export const transformToolRouterInstantParams = (
220 ...(config.returnInstantCharge !== undefined && {
221 return_instant_charge: config.returnInstantCharge,
222 }),
223 + ...(config.returnPricesInSearch !== undefined && {
224 + return_prices_in_search: config.returnPricesInSearch,
225 + }),
226 };
227 };
228
ts/packages/core/src/models/MCP.ts
+20 -1
@@ -24,6 +24,7 @@ import { McpUpdateResponse } from '@composio/client/resources.js';
24 import { McpRetrieveResponse } from '@composio/client/resources';
25 import { ComposioRequestOptions } from '../types/requestOptions.types';
26 import { withCancellation } from '../utils/cancellation';
27 +import logger from '../utils/logger';
28
29 function transformMCPItemResponse(response: McpUpdateResponse | McpRetrieveResponse): MCPItem {
30 return transform(response)
@@ -40,6 +41,19 @@ function transformMCPItemResponse(response: McpUpdateResponse | McpRetrieveRespo
41 toolkits: raw.toolkits,
42 }));
43 }
44 +
45 +// `managed_auth_by_composio` is deprecated upstream, but dropping it would strip
46 +// the connection-management tools from generated URLs. Keep sending it, silence
47 +// the API client's notice (it names an internal call), and warn once per process
48 +// in SDK terms instead.
49 +const MANAGED_AUTH_DEPRECATION =
50 + '[Deprecation] composio.mcp.generate() returns URLs that rely on the deprecated ' +
51 + 'include_composio_helper_actions query parameter, which the API will remove in a ' +
52 + 'future version. Switch to a session MCP endpoint: composio.create(userId, { mcp: true }) ' +
53 + 'exposes session.mcp.url with connection-management tools built in. ' +
54 + 'https://docs.composio.dev/docs/sessions-via-mcp';
55 +let _managedAuthDeprecationWarned = false;
56 +
57 /**
58 * MCP (Model Control Protocol) class
59 * Handles MCP server operations.
@@ -465,8 +479,13 @@ export class MCP {
479 user_ids: [userId],
480 managed_auth_by_composio: options?.manuallyManageConnections ? false : true,
481 };
482 + if (urlBody.managed_auth_by_composio && !_managedAuthDeprecationWarned) {
483 + _managedAuthDeprecationWarned = true;
484 + logger.warn(MANAGED_AUTH_DEPRECATION);
485 + }
486 const urlResponse = await withCancellation(
469 - () => this.client.mcp.generate.url(urlBody, requestOptions),
487 + () =>
488 + this.client.withOptions({ logLevel: 'error' }).mcp.generate.url(urlBody, requestOptions),
489 requestOptions?.signal
490 );
491
ts/packages/core/src/types/toolRouter.types.ts
+34 -2
@@ -132,6 +132,12 @@ export const ToolRouterInstantSchema = z.union([
132 * usage on a Session set to `false`.
133 */
134 returnInstantCharge: z.boolean().optional(),
135 + /**
136 + * Experimental. Show each Instant tool's price in Session search
137 + * results, under `toolkitConnectionStatuses[].instantAccount.prices`.
138 + * Controls visibility only.
139 + */
140 + returnPricesInSearch: z.boolean().optional(),
141 })
142 .strict(),
143 ]);
@@ -150,7 +156,16 @@ export const ToolRouterManageConnectionsConfigSchema = z.object({
156
157 // Tags
158 export const ToolRouterTagsParamSchema = z
153 - .array(z.enum(['readOnlyHint', 'destructiveHint', 'idempotentHint', 'openWorldHint']))
159 + .array(
160 + z.enum([
161 + 'readOnlyHint',
162 + 'createHint',
163 + 'updateHint',
164 + 'destructiveHint',
165 + 'idempotentHint',
166 + 'openWorldHint',
167 + ])
168 + )
169 .describe('The tags to filter the tools by');
170 export const ToolRouterTagsEnableDisableSchema = z
171 .object({
@@ -643,7 +658,24 @@ const ToolRouterSessionSearchToolkitConnectionStatusSchema = z.object({
658 connectionDetails: z.record(z.string(), z.unknown()).optional(),
659 currentUserInfo: z.record(z.string(), z.unknown()).optional(),
660 /** Present when the toolkit runs on a Composio Instant account; only these tools run on it. */
646 - instantAccount: z.object({ allowedToolSlugs: z.array(z.string()) }).optional(),
661 + instantAccount: z
662 + .object({
663 + allowedToolSlugs: z.array(z.string()),
664 + /**
665 + * Price of each tool, keyed by tool slug. Present only when the Session
666 + * sets `instant.returnPricesInSearch`.
667 + */
668 + prices: z
669 + .record(
670 + z.string(),
671 + z.object({
672 + description: z.string().optional(),
673 + discount: z.string().nullable().optional(),
674 + })
675 + )
676 + .optional(),
677 + })
678 + .optional(),
679 });
680
681 export const ToolRouterSessionSearchResponseSchema = z.object({
ts/packages/core/src/utils/transformers/toolRouterResponseTransform.ts
+8 -2
@@ -103,7 +103,10 @@ interface RawToolkitConnectionStatus {
103 status_message: string;
104 connection_details?: Record<string, unknown>;
105 current_user_info?: Record<string, unknown>;
106 - instant_account?: { allowed_tool_slugs: string[] };
106 + instant_account?: {
107 + allowed_tool_slugs: string[];
108 + prices?: Record<string, { description?: string; discount?: string | null }>;
109 + };
110 }
111
112 interface RawSearchResponse {
@@ -162,7 +165,10 @@ function transformToolkitConnectionStatus(raw: RawToolkitConnectionStatus) {
165 connectionDetails: raw.connection_details,
166 currentUserInfo: raw.current_user_info,
167 ...(raw.instant_account !== undefined && {
165 - instantAccount: { allowedToolSlugs: raw.instant_account.allowed_tool_slugs },
168 + instantAccount: {
169 + allowedToolSlugs: raw.instant_account.allowed_tool_slugs,
170 + ...(raw.instant_account.prices !== undefined && { prices: raw.instant_account.prices }),
171 + },
172 }),
173 };
174 }
ts/packages/core/test/lib/toolRouterParams.test.ts
+12 -2
@@ -186,9 +186,19 @@ describe('transformToolRouterUpdateParams', () => {
186 it('maps the experimental Instant usage policy without changing other session settings', () => {
187 expect(
188 transformToolRouterUpdateParams({
189 - instant: { toolkits: { disable: ['exa'] }, returnInstantCharge: true },
189 + instant: {
190 + toolkits: { disable: ['exa'] },
191 + returnInstantCharge: true,
192 + returnPricesInSearch: true,
193 + },
194 })
191 - ).toEqual({ instant: { toolkits: { disable: ['exa'] }, return_instant_charge: true } });
195 + ).toEqual({
196 + instant: {
197 + toolkits: { disable: ['exa'] },
198 + return_instant_charge: true,
199 + return_prices_in_search: true,
200 + },
201 + });
202 expect(transformToolRouterUpdateParams({ instant: false })).toEqual({
203 instant: false,
204 });
ts/packages/core/test/models/mcp.deprecation.test.ts new
+37
@@ -0,0 +1,37 @@
1 +import { describe, it, expect, vi } from 'vitest';
2 +import ComposioClient from '@composio/client';
3 +import { MCP } from '../../src/models/MCP';
4 +import logger from '../../src/utils/logger';
5 +
6 +vi.mock('../../src/telemetry/Telemetry', () => ({
7 + telemetry: { instrument: vi.fn() },
8 +}));
9 +
10 +const json = (body: unknown) =>
11 + new Response(JSON.stringify(body), { headers: { 'content-type': 'application/json' } });
12 +
13 +describe('MCP.generate managed auth deprecation', () => {
14 + it('replaces the API client notice with one SDK notice per process', async () => {
15 + const clientLogger = { error: vi.fn(), warn: vi.fn(), info: vi.fn(), debug: vi.fn() };
16 + const client = new ComposioClient({
17 + apiKey: 'test-api-key',
18 + baseURL: 'https://backend.composio.test',
19 + logger: clientLogger,
20 + logLevel: 'warn',
21 + fetch: async input =>
22 + String(input).includes('/generate')
23 + ? json({ mcp_url: 'https://mcp.test', connected_account_urls: [], user_ids_url: ['u'] })
24 + : json({ id: 'mcp_123', name: 'server', allowed_tools: [], auth_config_ids: [] }),
25 + });
26 + const sdkWarn = vi.spyOn(logger, 'warn').mockImplementation(() => {});
27 + const mcp = new MCP(client);
28 +
29 + await mcp.generate('user123', 'mcp_123');
30 + await mcp.generate('user123', 'mcp_123');
31 + await mcp.generate('user123', 'mcp_123', { manuallyManageConnections: true });
32 +
33 + expect(clientLogger.warn).not.toHaveBeenCalled();
34 + expect(sdkWarn).toHaveBeenCalledTimes(1);
35 + expect(sdkWarn.mock.calls[0][0]).toContain('include_composio_helper_actions');
36 + });
37 +});
ts/packages/core/test/models/mcp.test.ts
+3
@@ -27,6 +27,9 @@ const createMockClient = () => ({
27 url: vi.fn(),
28 },
29 },
30 + withOptions() {
31 + return this;
32 + },
33 });
34
35 describe('MCP', () => {
ts/packages/core/test/utils/toolRouterResponseTransform.test.ts
+33
@@ -3,6 +3,7 @@ import {
3 transformSearchResponse,
4 transformExecuteResponse,
5 } from '../../src/utils/transformers/toolRouterResponseTransform';
6 +import { ToolRouterSessionSearchResponseSchema } from '../../src/types/toolRouter.types';
7
8 describe('toolRouterResponseTransform', () => {
9 describe('transformSearchResponse', () => {
@@ -171,6 +172,38 @@ describe('toolRouterResponseTransform', () => {
172 expect(instantAccount.instantAccount).toEqual({ allowedToolSlugs: ['EXA_SEARCH'] });
173 expect(notInstantAccount).not.toHaveProperty('instantAccount');
174 });
175 +
176 + it('keeps Instant tool prices keyed by the original tool slug', () => {
177 + const prices = { EXA_SEARCH: { description: '$0.01 per call', discount: null } };
178 + const raw = {
179 + success: true,
180 + error: null,
181 + results: [],
182 + tool_schemas: {},
183 + toolkit_connection_statuses: [
184 + {
185 + toolkit: 'exa',
186 + description: 'Exa',
187 + has_active_connection: true,
188 + status_message: 'Connected via the Composio Instant account.',
189 + instant_account: { allowed_tool_slugs: ['EXA_SEARCH'], prices },
190 + },
191 + ],
192 + next_steps_guidance: [],
193 + session: { id: 'trs_1', generate_id: false, instructions: 'Use session' },
194 + time_info: {
195 + current_time_utc: '2025-03-09T12:00:00.000Z',
196 + current_time_utc_epoch_seconds: 1741521600,
197 + message: 'UTC',
198 + },
199 + };
200 +
201 + const parsed = ToolRouterSessionSearchResponseSchema.parse(transformSearchResponse(raw));
202 + expect(parsed.toolkitConnectionStatuses[0].instantAccount).toEqual({
203 + allowedToolSlugs: ['EXA_SEARCH'],
204 + prices,
205 + });
206 + });
207 });
208
209 describe('transformExecuteResponse', () => {
ts/packages/core/type-tests/instant-contract.test-d.ts
+11 -1
@@ -6,7 +6,11 @@ declare const composio: Composio;
6 async function instantContract(): Promise<void> {
7 const session = await composio.create('user_123', {
8 toolkits: ['exa'],
9 - instant: { toolkits: { enable: ['exa'] }, returnInstantCharge: true },
9 + instant: {
10 + toolkits: { enable: ['exa'] },
11 + returnInstantCharge: true,
12 + returnPricesInSearch: true,
13 + },
14 });
15 await composio.sessions.create('user_123', {
16 toolkits: ['exa', 'firecrawl'],
@@ -15,11 +19,17 @@ async function instantContract(): Promise<void> {
19 tools: { exa: { enable: ['EXA_SEARCH'] } },
20 },
21 });
22 + const { toolkitConnectionStatuses } = await session.search({ query: 'search the web' });
23 + const price: string | undefined =
24 + toolkitConnectionStatuses[0]?.instantAccount?.prices?.EXA_SEARCH?.description;
25 + void price;
26 await session.update({ instant: false });
27 await session.execute('EXA_SEARCH', {}, { account: 'instant_account' });
28 if (session.config.instant) {
29 const returnsCharge: boolean = session.config.instant.return_instant_charge;
30 void returnsCharge;
31 + const returnsPrices: boolean = session.config.instant.return_prices_in_search;
32 + void returnsPrices;
33 }
34
35 const { items } = await session.listConfigHistory();
uv.lock
+20 -20
@@ -820,7 +820,7 @@ dev = [
820
821 [package.metadata]
822 requires-dist = [
823 - { name = "composio-client", specifier = "==2.0.0rc13" },
823 + { name = "composio-client", specifier = "==2.0.0rc14" },
824 { name = "json-schema-to-pydantic", specifier = ">=0.4.11" },
825 { name = "jsonschema", specifier = ">=4.23.0" },
826 { name = "openai", specifier = ">=2.48.0" },
@@ -866,16 +866,16 @@ requires-dist = [
866
867 [[package]]
868 name = "composio-client"
869 -version = "2.0.0rc13"
869 +version = "2.0.0rc14"
870 source = { registry = "https://pypi.org/simple" }
871 dependencies = [
872 { name = "httpx" },
873 { name = "pydantic" },
874 { name = "typing-extensions" },
875 ]
876 -sdist = { url = "https://files.pythonhosted.org/packages/7f/f3/de31873dec713e93dd75a6114134f03174243d790a9e22587ee48b75a8ed/composio_client-2.0.0rc13.tar.gz", hash = "sha256:0cf6a85f228d8699a8bba7160423d269c344eba4cb4ff2d474392c139d87ecbc", size = 616824, upload-time = "2026-10-13T19:17:09.749Z" }
876 +sdist = { url = "https://files.pythonhosted.org/packages/31/a3/a856ba17fa20d2a0ab1317d4dba99e875a5d27eb105125e12f259f1756ea/composio_client-2.0.0rc14.tar.gz", hash = "sha256:7eb1454107cff344870a9ff9c0ef0f41a45ff99050e1eb48394070cd6bce6bdc", size = 618158, upload-time = "2026-10-14T15:06:51.783Z" }
877 wheels = [
878 - { url = "https://files.pythonhosted.org/packages/23/c9/914bc53134a558f46c943523aca3c1f3f0be96b0fede4fb75f1bea51d1b9/composio_client-2.0.0rc13-py3-none-any.whl", hash = "sha256:06faa7ba90f66eef70c3d4a9f82c1740c7b21f9b295d82c113c9872fb7a6d09e", size = 445147, upload-time = "2026-10-13T19:17:07.863Z" },
878 + { url = "https://files.pythonhosted.org/packages/93/e9/f5f9c8f686ee16ba0e1bedb647e1f83fbc6ba2694e22cbcab52fe73f9f6f/composio_client-2.0.0rc14-py3-none-any.whl", hash = "sha256:90f84bd4e624c9cd403c1aa2b6bc52b8a0229ab860d45458ca661196cb8b1048", size = 445953, upload-time = "2026-10-14T15:06:49.914Z" },
879 ]
880
881 [[package]]
@@ -1216,7 +1216,7 @@ name = "exceptiongroup"
1216 version = "1.3.1"
1217 source = { registry = "https://pypi.org/simple" }
1218 dependencies = [
1219 - { name = "typing-extensions" },
1219 + { name = "typing-extensions", marker = "python_full_version < '3.11'" },
1220 ]
1221 sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" }
1222 wheels = [
@@ -1867,8 +1867,8 @@ name = "httpcore2"
1867 version = "2.13.0"
1868 source = { registry = "https://pypi.org/simple" }
1869 dependencies = [
1870 - { name = "h11" },
1871 - { name = "truststore" },
1870 + { name = "h11", marker = "python_full_version != '3.12.*' or sys_platform != 'emscripten'" },
1871 + { name = "truststore", marker = "python_full_version != '3.12.*' or sys_platform != 'emscripten'" },
1872 ]
1873 sdist = { url = "https://files.pythonhosted.org/packages/15/8c/e925b1c92018abb3a1863ce1549d76d2381e334d21d65d4ac8f65dabd78a/httpcore2-2.13.0.tar.gz", hash = "sha256:2adc8be4fb285fbcd6d894298db3b52c177e74b6674eda3a76bd36be3292a3db", size = 67740, upload-time = "2026-09-14T14:18:04.717Z" }
1874 wheels = [
@@ -2123,7 +2123,7 @@ name = "importlib-metadata"
2123 version = "9.0.1"
2124 source = { registry = "https://pypi.org/simple" }
2125 dependencies = [
2126 - { name = "zipp" },
2126 + { name = "zipp", marker = "python_full_version < '3.12'" },
2127 ]
2128 sdist = { url = "https://files.pythonhosted.org/packages/6f/7e/1e7e8dc30634b93ebb3d58a3dea569ad146e656218d3960ab04f62047b29/importlib_metadata-9.0.1.tar.gz", hash = "sha256:ab830580bc0ef3db61ce8fae716389e5462b67e033018bab6d8f80ef17172f99", size = 59124, upload-time = "2026-08-28T15:30:34.646Z" }
2129 wheels = [
@@ -3495,11 +3495,11 @@ resolution-markers = [
3495 "python_full_version < '3.11'",
3496 ]
3497 dependencies = [
3498 - { name = "flatbuffers" },
3499 - { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" } },
3500 - { name = "packaging" },
3501 - { name = "protobuf" },
3502 - { name = "sympy" },
3498 + { name = "flatbuffers", marker = "python_full_version < '3.11'" },
3499 + { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" },
3500 + { name = "packaging", marker = "python_full_version < '3.11'" },
3501 + { name = "protobuf", marker = "python_full_version < '3.11'" },
3502 + { name = "sympy", marker = "python_full_version < '3.11'" },
3503 ]
3504 wheels = [
3505 { url = "https://files.pythonhosted.org/packages/15/41/3253db975a90c3ce1d475e2a230773a21cd7998537f0657947df6fb79861/onnxruntime-1.24.3-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:3e6456801c66b095c5cd68e690ca25db970ea5202bd0c5b84a2c3ef7731c5a3c", size = 17332766, upload-time = "2026-03-05T17:18:59.714Z" },
@@ -3541,11 +3541,11 @@ resolution-markers = [
3541 "python_full_version == '3.11.*'",
3542 ]
3543 dependencies = [
3544 - { name = "flatbuffers" },
3545 - { name = "numpy", version = "2.4.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.12'" },
3544 + { name = "flatbuffers", marker = "python_full_version >= '3.11'" },
3545 + { name = "numpy", version = "2.4.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version == '3.11.*'" },
3546 { name = "numpy", version = "2.5.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" },
3547 - { name = "packaging" },
3548 - { name = "protobuf" },
3547 + { name = "packaging", marker = "python_full_version >= '3.11'" },
3548 + { name = "protobuf", marker = "python_full_version >= '3.11'" },
3549 ]
3550 wheels = [
3551 { url = "https://files.pythonhosted.org/packages/73/b6/e2fa6dfc8c3cd19639d452c3120fb0e02f5176b4e24ecabb24b5362be725/onnxruntime-1.30.0-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:f36c87ec504f4f328e968ee322e4ba9682abe66280b3425625afcbed5333fed7", size = 21533037, upload-time = "2026-09-10T16:31:03.582Z" },
@@ -5464,8 +5464,8 @@ name = "secretstorage"
5464 version = "3.5.0"
5465 source = { registry = "https://pypi.org/simple" }
5466 dependencies = [
5467 - { name = "cryptography" },
5468 - { name = "jeepney" },
5467 + { name = "cryptography", marker = "python_full_version != '3.12.*' or sys_platform != 'emscripten'" },
5468 + { name = "jeepney", marker = "python_full_version != '3.12.*' or sys_platform != 'emscripten'" },
5469 ]
5470 sdist = { url = "https://files.pythonhosted.org/packages/1c/03/e834bcd866f2f8a49a85eaff47340affa3bfa391ee9912a952a1faa68c7b/secretstorage-3.5.0.tar.gz", hash = "sha256:f04b8e4689cbce351744d5537bf6b1329c6fc68f91fa666f60a380edddcd11be", size = 19884, upload-time = "2025-11-23T19:02:53.191Z" }
5471 wheels = [
@@ -5548,7 +5548,7 @@ name = "sympy"
5548 version = "1.14.0"
5549 source = { registry = "https://pypi.org/simple" }
5550 dependencies = [
5551 - { name = "mpmath" },
5551 + { name = "mpmath", marker = "python_full_version < '3.11'" },
5552 ]
5553 sdist = { url = "https://files.pythonhosted.org/packages/83/d3/803453b36afefb7c2bb238361cd4ae6125a569b4db67cd9e79846ba2d68c/sympy-1.14.0.tar.gz", hash = "sha256:d3d3fe8df1e5a0b42f0e7bdf50541697dbe7d23746e894990c030e2b05e72517", size = 7793921, upload-time = "2025-04-27T18:05:01.611Z" }
5554 wheels = [