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,python): add custom toolkit create/update, deprecate upsert (PLEN-4785) (#5195)
<!-- claude-projects-attribution: {"github_login":"singhbharath03"} --> _Requested by **Bharath** · [project thread](https://claude.ai/code/project/chan_01Ceg3UUAuzX7NPb6jdX94JX?thread=cmsg_01Ceg3UUAuzX7NPb6jdX94JX5SSsTGnigqLXiHtFL1TjDX)_ ## Summary The API now has separate endpoints to create (`POST /api/v3.1/custom/toolkits`) and update (`PATCH /api/v3.1/custom/toolkits/{slug}`) a custom MCP toolkit. Unlike `upsert`, create takes a `user_id` (`"all"` for a shared toolkit, or the user it is private to) and returns a connect link for private toolkits. Before this PR the SDKs could only call `upsert`. `@composio/client` / `composio-client` 2.0.1 added the two operations. Designated PR reviewer: [@jkomyno](mailto:alberto@composio.dev). Tickets: [PLEN-4785](https://linear.app/composio/issue/PLEN-4785/sdk-add-custom-toolkit-createupdate-deprecate-upsert) ## Changes - TypeScript: `composio.experimental.customToolkits.create(params)` and `.update(slug, params)`, with Zod-validated camelCase params and transformed responses (`{ slug, connectLink }`, `{ success: true }`). Same structure as `upsert`. - Python: `composio.experimental.custom_toolkits.create(**params)` and `.update(slug, **params)`, passing straight to the generated client like `upsert` does. - `upsert` is deprecated in both (`@deprecated` / `@te.deprecated`) and warns once per process (`logger.warn` in TS, `ComposioDeprecationWarning` in Python). It still works. - Bumps `@composio/client` and `composio-client` from 2.0.0 to 2.0.1. - `sync` and `delete` are unchanged. Behaviour difference worth knowing: `create` generates the slug, so callers store the returned slug and use `update` after that, instead of re-running `upsert` with a fixed slug. ## Type of change - [ ] Bug fix - [x] New feature - [ ] Refactor/Chore - [ ] Documentation - [ ] Breaking change ## How Has This Been Tested? - `pnpm --filter @composio/core typecheck` passes. - `pnpm --filter @composio/core test`: 77 files, 1979 passed. - `test/models/customToolkits.test.ts` adds create (wire mapping, null connect link, validation), update (only sends given fields, rejects an empty update) and an upsert warn-once case. - Python, from `python/`: `pytest` 2446 passed, 215 skipped; `tests/test_experimental_custom_toolkits.py` adds create/update pass-through and upsert warn-once tests. `ruff --config config/ruff.toml check` clean. - Not tested against a live API. ## Checklist - [ ] I have read the Code of Conduct and this PR adheres to it - [ ] I have read and understand every line of this diff, including any LLM-generated code - [x] Any third-party docs links or promotional content follow the [third-party links policy](https://github.com/ComposioHQ/composio/blob/next/CONTRIBUTING.md#third-party-links-in-docs) - [x] I ran linters/tests locally and they passed - [ ] I updated documentation as needed - [x] I added tests or explain why not applicable - [x] I added a changeset if this change affects published packages ## Additional context The docs page for custom MCPs (`docs/content/docs/extending-sessions/custom-mcp.mdx`) still shows `upsert`; it's being updated separately. The API route for upsert will be marked deprecated in a later platform PR (PLEN-4786). --- _Generated by [Claude Code](https://claude.ai/code/session_01H6YzWq98kCUE5K3atCRATH)_
No changes.