Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 22:00 UTC
feat: add video and update sdk
Utkarsh Dixit committed
Jul 10, 2025 at 11:00 UTC
a7187dcfcb8c914439e0dd3557253b7789f6a928
6 files changed
+88
-10
fern/pages/src/mcp/developers.mdx
+2
@@ -6,6 +6,8 @@ keywords: ""
6
hide-nav-links: true
7
---
8
9
+<iframe width="100%" height="420" style="border-radius: 12px" src="https://www.youtube.com/embed/kp9CQboTUvs?si=ZgXTlIAe_RCtNk6z" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
10
+
11
Composio MCP lets you build custom MCP servers that your users can connect to and use to perform actions.
12
You can manage these servers via our [Dashboard](https://app.composio.dev), or use the [SDK/API](/api-reference/mcp) for greater control and flexibility.
13
pnpm-lock.yaml
+19
-3
@@ -9299,6 +9299,14 @@ snapshots:
9299
chai: 5.2.0
9300
tinyrainbow: 2.0.0
9301
9302
+ '@vitest/mocker@3.2.4(vite@6.3.5(@types/node@20.19.1)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0))':
9303
+ dependencies:
9304
+ '@vitest/spy': 3.2.4
9305
+ estree-walker: 3.0.3
9306
+ magic-string: 0.30.17
9307
+ optionalDependencies:
9308
+ vite: 6.3.5(@types/node@20.19.1)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0)
9309
+
9310
'@vitest/mocker@3.2.4(vite@6.3.5(@types/node@22.15.32)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0))':
9311
dependencies:
9312
'@vitest/spy': 3.2.4
@@ -9307,6 +9315,14 @@ snapshots:
9315
optionalDependencies:
9316
vite: 6.3.5(@types/node@22.15.32)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0)
9317
9318
+ '@vitest/mocker@3.2.4(vite@6.3.5(@types/node@24.0.3)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0))':
9319
+ dependencies:
9320
+ '@vitest/spy': 3.2.4
9321
+ estree-walker: 3.0.3
9322
+ magic-string: 0.30.17
9323
+ optionalDependencies:
9324
+ vite: 6.3.5(@types/node@24.0.3)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0)
9325
+
9326
'@vitest/pretty-format@3.2.4':
9327
dependencies:
9328
tinyrainbow: 2.0.0
@@ -9336,7 +9352,7 @@ snapshots:
9352
sirv: 3.0.1
9353
tinyglobby: 0.2.14
9354
tinyrainbow: 2.0.0
9339
- vitest: 3.2.4(@types/node@22.15.32)(@vitest/ui@3.2.4)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0)
9355
+ vitest: 3.2.4(@types/node@24.0.3)(@vitest/ui@3.2.4)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0)
9356
9357
'@vitest/utils@3.2.4':
9358
dependencies:
@@ -12167,7 +12183,7 @@ snapshots:
12183
dependencies:
12184
'@types/chai': 5.2.2
12185
'@vitest/expect': 3.2.4
12170
- '@vitest/mocker': 3.2.4(vite@6.3.5(@types/node@22.15.32)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0))
12186
+ '@vitest/mocker': 3.2.4(vite@6.3.5(@types/node@20.19.1)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0))
12187
'@vitest/pretty-format': 3.2.4
12188
'@vitest/runner': 3.2.4
12189
'@vitest/snapshot': 3.2.4
@@ -12251,7 +12267,7 @@ snapshots:
12267
dependencies:
12268
'@types/chai': 5.2.2
12269
'@vitest/expect': 3.2.4
12254
- '@vitest/mocker': 3.2.4(vite@6.3.5(@types/node@22.15.32)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0))
12270
+ '@vitest/mocker': 3.2.4(vite@6.3.5(@types/node@24.0.3)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0))
12271
'@vitest/pretty-format': 3.2.4
12272
'@vitest/runner': 3.2.4
12273
'@vitest/snapshot': 3.2.4
ts/packages/core/src/models/MCP.ts
+57
-6
@@ -139,11 +139,57 @@ export class MCP<T = McpServerGetResponse> {
139
140
// Check if server with this name already exists
141
try {
142
- await this.getByName(name);
142
+ const mcpServer = await this.getByName(name);
143
+ const authConfigs = mcpServer.authConfigIds?.sort()!;
144
+ const sortedCurrentAuthConfigs = serverConfig.map(config => config.authConfigId).sort();
145
+ if (
146
+ authConfigs.length > 0 &&
147
+ !authConfigs.every((config, index) => config === sortedCurrentAuthConfigs[index])
148
+ ) {
149
+ throw new ValidationError(
150
+ 'MCP server with this name already exists with different auth configs',
151
+ {
152
+ meta: { serverName: name },
153
+ }
154
+ );
155
+ }
156
// If we reach here, server exists
144
- throw new ValidationError('MCP server with this name already exists', {
145
- meta: { serverName: name },
157
+ const tools = mcpServer.tools?.sort()!;
158
+ const sortedCurrentTools = serverConfig.flatMap(config => config.allowedTools).sort();
159
+ console.log(tools, sortedCurrentTools, 'tools');
160
+ if (tools?.length > 0 && !tools.every((tool, index) => tool === sortedCurrentTools[index])) {
161
+ throw new ValidationError('MCP server with this name already exists with different tools', {
162
+ meta: { serverName: name },
163
+ });
164
+ }
165
+
166
+ // Get toolkits from auth configs
167
+ const authConfigDetails = await Promise.all(
168
+ serverConfig.map(config => this.client.authConfigs.retrieve(config.authConfigId))
169
+ );
170
+ const toolkits = authConfigDetails.map(config => config.toolkit.slug);
171
+
172
+ const camelCaseResponse = transformMcpCreateResponse({
173
+ id: mcpServer.id,
174
+ name: mcpServer.name,
175
+ auth_config_ids: serverConfig.map(config => config.authConfigId),
176
+ allowed_tools: serverConfig.flatMap(config => config.allowedTools),
177
+ managed_auth_via_composio: options.isChatAuth || false,
178
+ commands: mcpServer.commands!,
179
+ created_at: mcpServer.createdAt!,
180
+ updated_at: mcpServer.updatedAt!,
181
+ mcp_url: mcpServer.mcpUrl!,
182
});
183
+
184
+ return {
185
+ ...camelCaseResponse,
186
+ toolkits,
187
+ getServer: async (params: MCPGetServerParams): Promise<T> => {
188
+ return this.getServer(camelCaseResponse.id, params.userId || '', {
189
+ isChatAuth: options.isChatAuth,
190
+ });
191
+ },
192
+ } as McpServerCreateResponse<T>;
193
} catch (error) {
194
// If error is not about server not found, re-throw it
195
if (error instanceof ValidationError && !error.message.includes('not found')) {
@@ -420,8 +466,9 @@ export class MCP<T = McpServerGetResponse> {
466
try {
467
data = await this.client.mcp.generate.url({
468
user_ids: [userId],
423
- connected_account_ids: connectedAccountIds,
424
- mcp_server_id: id,
469
+ // @TODO(utkarsh-dixit): Add support for this later
470
+ connected_account_ids: [],
471
+ mcp_server_id: serverId,
472
managed_auth_by_composio:
473
options?.isChatAuth ?? serverDetails.managedAuthViaComposio ?? false,
474
});
@@ -535,7 +582,10 @@ export class MCP<T = McpServerGetResponse> {
582
}
583
584
// Validate the retrieve response
538
- const retrieveResponseResult = McpRetrieveResponseSchema.safeParse(retrieveResponse);
585
+ const retrieveResponseResult = McpRetrieveResponseSchema.safeParse({
586
+ ...retrieveResponse,
587
+ mcpUrl: retrieveResponse.mcp_url,
588
+ });
589
if (retrieveResponseResult.error) {
590
throw new ValidationError('Failed to parse MCP server retrieve response', {
591
cause: retrieveResponseResult.error,
@@ -784,6 +834,7 @@ export class MCP<T = McpServerGetResponse> {
834
limit: 10,
835
});
836
} catch (error) {
837
+ console.error(error);
838
throw new ValidationError('Failed to search MCP servers by name', {
839
cause: error,
840
});
ts/packages/core/src/types/mcp.types.ts
+6
@@ -294,6 +294,12 @@ export const McpRetrieveResponseSchema = z.object({
294
tools: z.array(z.string()).optional(),
295
managedAuthViaComposio: z.boolean().optional(),
296
authConfigIds: z.array(z.string()).optional(),
297
+ mcpUrl: z.string(),
298
+ commands: z.object({
299
+ claude: z.string(),
300
+ cursor: z.string(),
301
+ windsurf: z.string(),
302
+ }),
303
});
304
305
// Snake_case retrieve response schema (for API)
ts/packages/core/src/utils/transformers/mcp.ts
+3
-1
@@ -84,9 +84,11 @@ export function transformMcpRetrieveResponse(
84
updatedAt: response.updated_at,
85
status: (response as unknown as Record<string, unknown>).status,
86
toolkits: response.toolkits,
87
- tools: (response as unknown as Record<string, unknown>).tools,
87
+ tools: response.allowed_tools,
88
managedAuthViaComposio: response.managed_auth_via_composio,
89
authConfigIds: response.auth_config_ids,
90
+ mcpUrl: response.mcp_url,
91
+ commands: response.commands,
92
});
93
94
if (!result.success) {
ts/packages/providers/openai/src/OpenAIResponsesProvider.ts
+1
@@ -86,6 +86,7 @@ export class OpenAIResponsesProvider extends BaseNonAgenticProvider<
86
* @returns OpenAI-specific MCP server response format
87
*/
88
wrapMcpServerResponse(data: McpUrlResponse): OpenAiMcpTool[] {
89
+ console.log('Wrapping MCP server response', data);
90
return data.map(item => ({
91
type: 'mcp',
92
server_label: item.name,