@devries-cameron20 / composio-1 / commits / eaee9c6d4
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.

docs: consolidate MCP pages into Single Toolkit MCP

- Merge mcp-quickstart and mcp-server-management into one page - Add callout recommending Tool Router for most use cases - Include server management (list, get, update, delete) - Streamline code examples Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Sushmithamallesh committed Jan 25, 2026 at 23:13 UTC eaee9c6d4e8d62b0fe41e96a2f39dbc4173a86f3
4 files changed +356 -583
docs/content/docs/mcp/index.mdx new
+355
@@ -0,0 +1,355 @@
1 +---
2 +title: Single Toolkit MCP
3 +description: Create MCP servers for specific toolkits
4 +keywords: [mcp, model context protocol, single toolkit]
5 +---
6 +
7 +<Callout type="info">
8 +For most use cases, we recommend using [Tool Router](/docs/quickstart) which provides dynamic tool access without pre-configuring servers.
9 +</Callout>
10 +
11 +## Install the SDK
12 +
13 +<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
14 + <Tab value="Python">
15 +```bash
16 +pip install composio
17 +```
18 + </Tab>
19 + <Tab value="TypeScript">
20 +```bash
21 +npm install @composio/core
22 +```
23 + </Tab>
24 +</Tabs>
25 +
26 +## Create an MCP server
27 +
28 +<Steps>
29 + <Step>
30 + ### Initialize Composio
31 +
32 + <Tabs groupId="language" items={['Python', 'TypeScript']} persist>
33 + <Tab value="Python">
34 +```python
35 +from composio import Composio
36 +
37 +composio = Composio(api_key="YOUR_API_KEY")
38 +```
39 + </Tab>
40 + <Tab value="TypeScript">
41 +```typescript
42 +import { Composio } from '@composio/core';
43 +
44 +const composio = new Composio({
45 + apiKey: process.env.COMPOSIO_API_KEY
46 +});
47 +```
48 + </Tab>
49 + </Tabs>
50 + </Step>
51 +
52 + <Step>
53 + ### Create server configuration
54 +
55 + <Callout type="warn">
56 + **Before you begin:** [Create an auth configuration](/docs/auth-configuration/custom-auth-configs) for your toolkit.
57 + </Callout>
58 +
59 + <Tabs groupId="language" items={['Python', 'TypeScript']} persist>
60 + <Tab value="Python">
61 +```python
62 +server = composio.mcp.create(
63 + name="my-gmail-server",
64 + toolkits=[{
65 + "toolkit": "gmail",
66 + "auth_config": "ac_xyz123"
67 + }],
68 + allowed_tools=["GMAIL_FETCH_EMAILS", "GMAIL_SEND_EMAIL"]
69 +)
70 +
71 +print(f"Server created: {server.id}")
72 +```
73 + </Tab>
74 + <Tab value="TypeScript">
75 +```typescript
76 +import { Composio } from '@composio/core';
77 +const composio = new Composio({ apiKey: process.env.COMPOSIO_API_KEY });
78 +// ---cut---
79 +const server = await composio.mcp.create("my-gmail-server", {
80 + toolkits: [
81 + {
82 + authConfigId: "ac_xyz123",
83 + toolkit: "gmail"
84 + }
85 + ],
86 + allowedTools: ["GMAIL_FETCH_EMAILS", "GMAIL_SEND_EMAIL"]
87 +});
88 +
89 +console.log(`Server created: ${server.id}`);
90 +```
91 + </Tab>
92 + </Tabs>
93 +
94 + <Callout type="info">
95 + You can also create and manage MCP configs from the [Composio dashboard](https://platform.composio.dev?next_page=/mcp-configs).
96 + </Callout>
97 + </Step>
98 +
99 + <Step>
100 + ### Generate user URLs
101 +
102 + <Callout type="warn">
103 + Users must authenticate with the toolkits configured in your MCP server first. See [authentication](/docs/authentication) for details.
104 + </Callout>
105 +
106 + <Tabs groupId="language" items={['Python', 'TypeScript']} persist>
107 + <Tab value="Python">
108 +```python
109 +instance = composio.mcp.generate(user_id="user-123", mcp_config_id=server.id)
110 +
111 +print(f"MCP Server URL: {instance['url']}")
112 +```
113 + </Tab>
114 + <Tab value="TypeScript">
115 +```typescript
116 +import { Composio } from '@composio/core';
117 +const composio = new Composio({ apiKey: process.env.COMPOSIO_API_KEY });
118 +const server = { id: 'my-gmail-server' };
119 +// ---cut---
120 +const instance = await composio.mcp.generate("user-123", server.id);
121 +
122 +console.log("MCP Server URL:", instance.url);
123 +```
124 + </Tab>
125 + </Tabs>
126 + </Step>
127 +
128 + <Step>
129 + ### Use with AI providers
130 +
131 + <Tabs items={['OpenAI (Python)', 'Anthropic (Python)', 'Mastra (TypeScript)']}>
132 + <Tab value="OpenAI (Python)">
133 +```python
134 +from openai import OpenAI
135 +
136 +client = OpenAI(api_key="your-openai-api-key")
137 +
138 +mcp_server_url = "https://backend.composio.dev/v3/mcp/YOUR_SERVER_ID?user_id=YOUR_USER_ID"
139 +
140 +response = client.responses.create(
141 + model="gpt-5",
142 + tools=[{
143 + "type": "mcp",
144 + "server_label": "composio-server",
145 + "server_url": mcp_server_url,
146 + "require_approval": "never",
147 + }],
148 + input="What are my latest emails?",
149 +)
150 +
151 +print(response.output_text)
152 +```
153 + </Tab>
154 + <Tab value="Anthropic (Python)">
155 +```python
156 +from anthropic import Anthropic
157 +
158 +client = Anthropic(api_key="your-anthropic-api-key")
159 +
160 +mcp_server_url = "https://backend.composio.dev/v3/mcp/YOUR_SERVER_ID?user_id=YOUR_USER_ID"
161 +
162 +response = client.beta.messages.create(
163 + model="claude-sonnet-4-5",
164 + max_tokens=1000,
165 + messages=[{"role": "user", "content": "What are my latest emails?"}],
166 + mcp_servers=[{
167 + "type": "url",
168 + "url": mcp_server_url,
169 + "name": "composio-mcp-server"
170 + }],
171 + betas=["mcp-client-2025-04-04"]
172 +)
173 +
174 +print(response.content)
175 +```
176 + </Tab>
177 + <Tab value="Mastra (TypeScript)">
178 +```typescript
179 +import { MCPClient } from "@mastra/mcp";
180 +import { openai } from "@ai-sdk/openai";
181 +import { Agent } from "@mastra/core/agent";
182 +
183 +const MCP_URL = "https://backend.composio.dev/v3/mcp/YOUR_SERVER_ID?user_id=YOUR_USER_ID";
184 +
185 +const client = new MCPClient({
186 + id: "mcp-client",
187 + servers: {
188 + composio: { url: new URL(MCP_URL) },
189 + }
190 +});
191 +
192 +const agent = new Agent({
193 + id: "assistant",
194 + name: "Assistant",
195 + model: openai("gpt-4-turbo"),
196 + tools: await client.getTools()
197 +});
198 +
199 +const res = await agent.generate("What are my latest emails?");
200 +console.log(res.text);
201 +```
202 + </Tab>
203 + </Tabs>
204 + </Step>
205 +</Steps>
206 +
207 +## Server management
208 +
209 +### List servers
210 +
211 +<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
212 + <Tab value="Python">
213 +```python
214 +servers = composio.mcp.list()
215 +print(f"Found {len(servers['items'])} servers")
216 +
217 +# Filter by toolkit
218 +gmail_servers = composio.mcp.list(toolkits="gmail", limit=20)
219 +```
220 + </Tab>
221 + <Tab value="TypeScript">
222 +```typescript
223 +import { Composio } from '@composio/core';
224 +const composio = new Composio({ apiKey: 'your_api_key' });
225 +// ---cut---
226 +const servers = await composio.mcp.list({ limit: 10, page: 1 });
227 +console.log(`Found ${servers.items.length} servers`);
228 +
229 +// Filter by toolkit
230 +const gmailServers = await composio.mcp.list({ toolkits: ["gmail"] });
231 +```
232 + </Tab>
233 +</Tabs>
234 +
235 +### Get server details
236 +
237 +<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
238 + <Tab value="Python">
239 +```python
240 +server = composio.mcp.get("mcp_server_id")
241 +print(f"Server: {server.name}")
242 +```
243 + </Tab>
244 + <Tab value="TypeScript">
245 +```typescript
246 +import { Composio } from '@composio/core';
247 +const composio = new Composio({ apiKey: 'your_api_key' });
248 +// ---cut---
249 +const server = await composio.mcp.get("mcp_server_id");
250 +console.log(`Server: ${server.name}`);
251 +```
252 + </Tab>
253 +</Tabs>
254 +
255 +### Update a server
256 +
257 +<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
258 + <Tab value="Python">
259 +```python
260 +updated = composio.mcp.update(
261 + server_id="mcp_server_id",
262 + name="updated-name",
263 + allowed_tools=["GMAIL_FETCH_EMAILS", "GMAIL_SEARCH_EMAILS"]
264 +)
265 +```
266 + </Tab>
267 + <Tab value="TypeScript">
268 +```typescript
269 +import { Composio } from '@composio/core';
270 +const composio = new Composio({ apiKey: 'your_api_key' });
271 +// ---cut---
272 +const updated = await composio.mcp.update("mcp_server_id", {
273 + name: "updated-name",
274 + allowedTools: ["GMAIL_FETCH_EMAILS", "GMAIL_SEARCH_EMAILS"]
275 +});
276 +```
277 + </Tab>
278 +</Tabs>
279 +
280 +### Delete a server
281 +
282 +<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
283 + <Tab value="Python">
284 +```python
285 +result = composio.mcp.delete("mcp_server_id")
286 +if result['deleted']:
287 + print("Server deleted")
288 +```
289 + </Tab>
290 + <Tab value="TypeScript">
291 +```typescript
292 +import { Composio } from '@composio/core';
293 +const composio = new Composio({ apiKey: 'your_api_key' });
294 +// ---cut---
295 +const result = await composio.mcp.delete("mcp_server_id");
296 +if (result.deleted) {
297 + console.log("Server deleted");
298 +}
299 +```
300 + </Tab>
301 +</Tabs>
302 +
303 +### Multi-toolkit servers
304 +
305 +Combine multiple services in a single MCP server:
306 +
307 +<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
308 + <Tab value="Python">
309 +```python
310 +server = composio.mcp.create(
311 + name="productivity-suite",
312 + toolkits=[
313 + {"toolkit": "gmail", "auth_config": "ac_gmail"},
314 + {"toolkit": "slack", "auth_config": "ac_slack"},
315 + {"toolkit": "github", "auth_config": "ac_github"}
316 + ],
317 + allowed_tools=[
318 + "GMAIL_FETCH_EMAILS",
319 + "SLACK_SEND_MESSAGE",
320 + "GITHUB_CREATE_ISSUE"
321 + ]
322 +)
323 +```
324 + </Tab>
325 + <Tab value="TypeScript">
326 +```typescript
327 +import { Composio } from '@composio/core';
328 +const composio = new Composio({ apiKey: 'your_api_key' });
329 +// ---cut---
330 +const server = await composio.mcp.create("productivity-suite", {
331 + toolkits: [
332 + { authConfigId: "ac_gmail", toolkit: "gmail" },
333 + { authConfigId: "ac_slack", toolkit: "slack" },
334 + { authConfigId: "ac_github", toolkit: "github" }
335 + ],
336 + allowedTools: [
337 + "GMAIL_FETCH_EMAILS",
338 + "SLACK_SEND_MESSAGE",
339 + "GITHUB_CREATE_ISSUE"
340 + ]
341 +});
342 +```
343 + </Tab>
344 +</Tabs>
345 +
346 +## Next steps
347 +
348 +<Cards>
349 + <Card title="Providers" href="/docs/providers">
350 + Use with Anthropic, OpenAI, and other frameworks
351 + </Card>
352 + <Card title="Quickstart" href="/docs/quickstart">
353 + Build an agent with Tool Router (recommended)
354 + </Card>
355 +</Cards>
docs/content/docs/mcp/mcp-quickstart.mdx deleted
-272
@@ -1,272 +0,0 @@
1 ----
2 -title: Quickstart
3 -description: Create your first MCP server
4 -keywords: [mcp, model context protocol]
5 ----
6 -
7 -[Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP) is an open-source standard for connecting AI applications to external tools. All the 500+ tools available in Composio are also available as MCP servers.
8 -
9 -Composio lets you create MCP servers that handle authentication (OAuth, API keys), generate unique URLs for each user, and control which tools are exposed. You can combine multiple toolkits in a single server.
10 -
11 -<Callout type="info">
12 -Composio MCP servers only support Streamable HTTP transport.
13 -</Callout>
14 -
15 -## Install the SDK
16 -
17 -First, install the Composio SDK for your preferred language:
18 -
19 -<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
20 - <Tab value="Python">
21 -```bash
22 -pip install composio
23 -```
24 - </Tab>
25 - <Tab value="TypeScript">
26 -```bash
27 -npm install @composio/core
28 -```
29 - </Tab>
30 -</Tabs>
31 -
32 -## Create an MCP server
33 -
34 -<Steps>
35 - <Step>
36 - ### Initialize Composio
37 -
38 - <Tabs groupId="language" items={['Python', 'TypeScript']} persist>
39 - <Tab value="Python">
40 -```python
41 -from composio import Composio
42 -
43 -# Initialize Composio
44 -composio = Composio(api_key="YOUR_API_KEY")
45 -```
46 - </Tab>
47 - <Tab value="TypeScript">
48 -```typescript
49 -import { Composio } from '@composio/core';
50 -
51 -// Initialize Composio
52 -const composio = new Composio({
53 - apiKey: process.env.COMPOSIO_API_KEY
54 -});
55 -```
56 - </Tab>
57 - </Tabs>
58 - </Step>
59 -
60 - <Step>
61 - ### Create server configuration
62 -
63 - <Callout type="warn">
64 - **Before you begin:** [Create an auth configuration](/docs/authenticating-tools#creating-an-auth-config) for your toolkit.
65 - </Callout>
66 -
67 - Create an MCP server with your auth config. You can also set list of specific tools to enable across all toolkits.
68 -
69 - <Tabs groupId="language" items={['Python', 'TypeScript']} persist>
70 - <Tab value="Python">
71 -```python
72 -# Create MCP server with multiple toolkits
73 -server = composio.mcp.create(
74 - name="mcp-config-73840", # Pick a unique name for your MCP server
75 - toolkits=[
76 - {
77 - "toolkit": "gmail",
78 - "auth_config": "ac_xyz123" # Your Gmail auth config ID
79 - },
80 - {
81 - "toolkit": "googlecalendar",
82 - "auth_config": "ac_abc456" # Your Google Calendar auth config ID
83 - }
84 - ],
85 - allowed_tools=["GMAIL_FETCH_EMAILS", "GMAIL_SEND_EMAIL", "GOOGLECALENDAR_EVENTS_LIST"]
86 -)
87 -
88 -print(f"Server created: {server.id}")
89 -print(server.id)
90 -```
91 - </Tab>
92 - <Tab value="TypeScript">
93 -```typescript
94 -import { Composio } from '@composio/core';
95 -const composio = new Composio({ apiKey: process.env.COMPOSIO_API_KEY });
96 -// ---cut---
97 -// Create MCP server with multiple toolkits
98 -const server = await composio.mcp.create("mcp-config-73840", { // Pick a unique name for your MCP server
99 - toolkits: [
100 - {
101 - authConfigId: "ac_xyz123", // Your Gmail auth config ID
102 - toolkit: "gmail"
103 - },
104 - {
105 - authConfigId: "ac_abc456", // Your Google Calendar auth config ID
106 - toolkit: "googlecalendar"
107 - }
108 - ],
109 - allowedTools: ["GMAIL_FETCH_EMAILS", "GMAIL_SEND_EMAIL", "GOOGLECALENDAR_EVENTS_LIST"]
110 -});
111 -
112 -console.log(`Server created: ${server.id}`);
113 -console.log(server.id);
114 -```
115 - </Tab>
116 - </Tabs>
117 -
118 - <Callout type="info">
119 - **Alternative:** You can also create and manage MCP configs directly from the [Composio dashboard → MCP Configs](https://platform.composio.dev?next_page=/mcp-configs).
120 - </Callout>
121 - </Step>
122 -
123 - <Step>
124 - ### Generate user URLs
125 -
126 - <Callout type="warn">
127 - **Before generating URLs:** Users must authenticate with the toolkits configured in your MCP server. See [hosted authentication](/docs/authenticating-tools#hosted-authentication-connect-link) for how to connect user accounts.
128 - </Callout>
129 -
130 - Get server URLs for your users to connect:
131 -
132 - <Tabs groupId="language" items={['Python', 'TypeScript']} persist>
133 - <Tab value="Python">
134 -```python
135 -# Generate server instance for user
136 -instance = composio.mcp.generate(user_id="user-73840", mcp_config_id=server.id) # Use the user ID for which you created the connected account
137 -
138 -print(f"MCP Server URL: {instance['url']}")
139 -```
140 - </Tab>
141 - <Tab value="TypeScript">
142 -```typescript
143 -import { Composio } from '@composio/core';
144 -const composio = new Composio({ apiKey: process.env.COMPOSIO_API_KEY });
145 -const server = { id: 'mcp-config-73840' };
146 -// ---cut---
147 -// Generate server instance for user
148 -const instance = await composio.mcp.generate("user-73840", server.id); // Use the user ID for which you created the connected account
149 -
150 -console.log("MCP Server URL:", instance.url);
151 -```
152 - </Tab>
153 - </Tabs>
154 -
155 - <Callout type="info">
156 - If users haven't authenticated, the MCP server will still generate a URL but tools requiring authentication won't work until the user connects their accounts.
157 - </Callout>
158 - </Step>
159 -
160 - <Step>
161 - ### Use with AI providers
162 -
163 - Use the MCP server URL with your AI provider:
164 -
165 - <Tabs items={['OpenAI (Python)', 'Anthropic (Python)', 'Mastra (TypeScript)']}>
166 - <Tab value="OpenAI (Python)">
167 -```python
168 -from openai import OpenAI
169 -
170 -# Initialize OpenAI client
171 -client = OpenAI(api_key="your-openai-api-key")
172 -
173 -# Use the MCP server URL you generated
174 -mcp_server_url = "https://backend.composio.dev/v3/mcp/YOUR_SERVER_ID?include_composio_helper_actions=true&user_id=YOUR_USER_ID"
175 -
176 -# Use MCP with OpenAI Responses API
177 -response = client.responses.create(
178 - model="gpt-5",
179 - tools=[
180 - {
181 - "type": "mcp",
182 - "server_label": "composio-server",
183 - "server_description": "Composio MCP server for Gmail and Calendar integrations",
184 - "server_url": mcp_server_url,
185 - "require_approval": "never",
186 - },
187 - ],
188 - input="What meetings do I have tomorrow? Also check if I have any urgent emails",
189 -)
190 -
191 -print("OpenAI MCP Response:", response.output_text)
192 -```
193 - </Tab>
194 - <Tab value="Anthropic (Python)">
195 -```python
196 -from anthropic import Anthropic
197 -
198 -# Initialize Anthropic client
199 -client = Anthropic(api_key="your-anthropic-api-key")
200 -
201 -# Use the MCP server URL you generated
202 -mcp_server_url = "https://backend.composio.dev/v3/mcp/YOUR_SERVER_ID?include_composio_helper_actions=true&user_id=YOUR_USER_ID"
203 -
204 -# Use MCP with Anthropic (beta feature)
205 -response = client.beta.messages.create(
206 - model="claude-sonnet-4-5",
207 - system="You are a helpful assistant with access to various tools through MCP. Use these tools to help the user. Do not ask for confirmation before using the tools.",
208 - max_tokens=1000,
209 - messages=[{
210 - "role": "user",
211 - "content": "What meetings do I have tomorrow? Also check if I have any urgent emails"
212 - }],
213 - mcp_servers=[{
214 - "type": "url",
215 - "url": mcp_server_url,
216 - "name": "composio-gmail-calendar-mcp-server"
217 - }],
218 - betas=["mcp-client-2025-04-04"] # Enable MCP beta
219 -)
220 -
221 -print(response.content)
222 -```
223 - </Tab>
224 - <Tab value="Mastra (TypeScript)">
225 -```typescript
226 -import { MCPClient } from "@mastra/mcp";
227 -import { openai } from "@ai-sdk/openai";
228 -import { Agent } from "@mastra/core/agent";
229 -
230 -// Use the MCP server URL you generated
231 -const MCP_URL = "https://backend.composio.dev/v3/mcp/YOUR_SERVER_ID?include_composio_helper_actions=true&user_id=YOUR_USER_ID";
232 -
233 -export const client = new MCPClient({
234 - id: "docs-mcp-client",
235 - servers: {
236 - composio: { url: new URL(MCP_URL) },
237 - }
238 -});
239 -
240 -export const agent = new Agent({
241 - id: "assistant",
242 - name: "Assistant",
243 - description: "Helpful AI with MCP tools",
244 - instructions: "Use the MCP tools to answer.",
245 - model: openai("gpt-4-turbo"),
246 - tools: await client.getTools()
247 -});
248 -
249 -(async () => {
250 - const res = await agent.generate("What meetings do I have tomorrow? Also check if I have any urgent emails");
251 - console.log(res.text);
252 -})();
253 -```
254 - </Tab>
255 - </Tabs>
256 - </Step>
257 -</Steps>
258 -
259 -## Next steps
260 -
261 -<Cards>
262 - <Card title="Server management" href="/docs/mcp/mcp-server-management">
263 - Create and manage MCP servers
264 - </Card>
265 - <Card title="Providers" href="/docs/providers">
266 - Use with Anthropic, OpenAI, and other frameworks
267 - </Card>
268 -</Cards>
269 -
270 -<Callout type="info">
271 -Need help? Join our [Discord](https://discord.com/invite/composio) or [raise an issue on GitHub](https://github.com/ComposioHQ/composio/issues/new?labels=bug).
272 -</Callout>
docs/content/docs/mcp/mcp-server-management.mdx deleted
-309
@@ -1,309 +0,0 @@
1 ----
2 -title: Server management
3 -description: Create, update, and manage MCP servers
4 -keywords: [create server, update server, delete server]
5 ----
6 -
7 -This guide covers all server management operations for MCP servers.
8 -
9 -## Create a server
10 -
11 -<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
12 - <Tab value="Python">
13 -```python
14 -server = composio.mcp.create(
15 - name="my-gmail-server",
16 - toolkits=[{
17 - "toolkit": "gmail",
18 - "auth_config": "ac_xyz123"
19 - }],
20 - allowed_tools=["GMAIL_FETCH_EMAILS", "GMAIL_SEND_EMAIL"]
21 -)
22 -
23 -print(f"Created server: {server.id}")
24 -```
25 - </Tab>
26 - <Tab value="TypeScript">
27 -```typescript
28 -import { Composio } from '@composio/core';
29 -const composio = new Composio({ apiKey: 'your_api_key' });
30 -// ---cut---
31 -const server = await composio.mcp.create(
32 - "my-gmail-server",
33 - {
34 - toolkits: [
35 - {
36 - authConfigId: "ac_xyz123",
37 - toolkit: "gmail"
38 - }
39 - ],
40 - allowedTools: ["GMAIL_FETCH_EMAILS", "GMAIL_SEND_EMAIL"],
41 - manuallyManageConnections: false
42 - }
43 -);
44 -
45 -console.log(`Created server: ${server.id}`);
46 -```
47 - </Tab>
48 -</Tabs>
49 -
50 -## List servers
51 -
52 -Find and filter your MCP servers.
53 -
54 -<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
55 - <Tab value="Python">
56 -```python
57 -# List all servers
58 -servers = composio.mcp.list()
59 -print(f"Found {len(servers['items'])} servers")
60 -
61 -# Filter by toolkit
62 -gmail_servers = composio.mcp.list(
63 - toolkits="gmail",
64 - limit=20
65 -)
66 -
67 -# Filter by name
68 -production_servers = composio.mcp.list(
69 - name="production"
70 -)
71 -```
72 - </Tab>
73 - <Tab value="TypeScript">
74 -```typescript
75 -import { Composio } from '@composio/core';
76 -const composio = new Composio({ apiKey: 'your_api_key' });
77 -// ---cut---
78 -// List all servers
79 -const servers = await composio.mcp.list({
80 - limit: 10,
81 - page: 1,
82 - authConfigs: [],
83 - toolkits: []
84 -});
85 -console.log(`Found ${servers.items.length} servers`);
86 -
87 -// Filter by toolkit
88 -const gmailServers = await composio.mcp.list({
89 - limit: 20,
90 - page: 1,
91 - authConfigs: [],
92 - toolkits: ["gmail"]
93 -});
94 -
95 -// Filter by name
96 -const productionServers = await composio.mcp.list({
97 - limit: 10,
98 - page: 1,
99 - authConfigs: [],
100 - toolkits: [],
101 - name: "production"
102 -});
103 -```
104 - </Tab>
105 -</Tabs>
106 -
107 -## Get server details
108 -
109 -<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
110 - <Tab value="Python">
111 -```python
112 -# Get by ID
113 -server = composio.mcp.get("mcp_server_id")
114 -print(f"Server name: {server.name}")
115 -print(f"Toolkits: {server.toolkits}")
116 -```
117 - </Tab>
118 - <Tab value="TypeScript">
119 -```typescript
120 -import { Composio } from '@composio/core';
121 -const composio = new Composio({ apiKey: 'your_api_key' });
122 -// ---cut---
123 -// Get by ID
124 -const server = await composio.mcp.get("mcp_server_id");
125 -
126 -console.log(`Server: ${server.name}`);
127 -console.log(`Toolkits: ${server.toolkits}`);
128 -```
129 - </Tab>
130 -</Tabs>
131 -
132 -## Update a server
133 -
134 -Modify server configuration, tools, or auth configs.
135 -
136 -<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
137 - <Tab value="Python">
138 -```python
139 -updated = composio.mcp.update(
140 - server_id="mcp_server_id",
141 - name="updated-name",
142 - allowed_tools=["GMAIL_FETCH_EMAILS", "GMAIL_SEARCH_EMAILS"]
143 -)
144 -```
145 - </Tab>
146 - <Tab value="TypeScript">
147 -```typescript
148 -import { Composio } from '@composio/core';
149 -const composio = new Composio({ apiKey: 'your_api_key' });
150 -// ---cut---
151 -const updated = await composio.mcp.update(
152 - "mcp_server_id",
153 - {
154 - name: "updated-name",
155 - toolkits: [
156 - {
157 - toolkit: "gmail",
158 - authConfigId: "ac_new_config"
159 - }
160 - ],
161 - allowedTools: ["GMAIL_FETCH_EMAILS", "GMAIL_SEARCH_EMAILS"],
162 - manuallyManageConnections: false
163 - }
164 -);
165 -
166 -console.log(updated);
167 -```
168 - </Tab>
169 -</Tabs>
170 -
171 -## Delete a server
172 -
173 -<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
174 - <Tab value="Python">
175 -```python
176 -result = composio.mcp.delete("mcp_server_id")
177 -if result['deleted']:
178 - print("Server deleted successfully")
179 -```
180 - </Tab>
181 - <Tab value="TypeScript">
182 -```typescript
183 -import { Composio } from '@composio/core';
184 -const composio = new Composio({ apiKey: 'your_api_key' });
185 -// ---cut---
186 -const result = await composio.mcp.delete("mcp_server_id");
187 -if (result.deleted) {
188 - console.log("Server deleted successfully");
189 -}
190 -```
191 - </Tab>
192 -</Tabs>
193 -
194 -## Multi-toolkit servers
195 -
196 -Combine multiple services in a single MCP server.
197 -
198 -<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
199 - <Tab value="Python">
200 -```python
201 -server = composio.mcp.create(
202 - name="productivity-suite",
203 - toolkits=[
204 - {"toolkit": "gmail", "auth_config": "ac_gmail"},
205 - {"toolkit": "slack", "auth_config": "ac_slack"},
206 - {"toolkit": "github", "auth_config": "ac_github"}
207 - ],
208 - allowed_tools=[
209 - "GMAIL_FETCH_EMAILS",
210 - "SLACK_SEND_MESSAGE",
211 - "GITHUB_CREATE_ISSUE"
212 - ]
213 -)
214 -```
215 - </Tab>
216 - <Tab value="TypeScript">
217 -```typescript
218 -import { Composio } from '@composio/core';
219 -const composio = new Composio({ apiKey: 'your_api_key' });
220 -// ---cut---
221 -const server = await composio.mcp.create(
222 - "productivity-suite",
223 - {
224 - toolkits: [
225 - {
226 - authConfigId: "ac_gmail",
227 - toolkit: "gmail"
228 - },
229 - {
230 - authConfigId: "ac_slack",
231 - toolkit: "slack"
232 - },
233 - {
234 - authConfigId: "ac_github",
235 - toolkit: "github"
236 - }
237 - ],
238 - allowedTools: [
239 - "GMAIL_FETCH_EMAILS",
240 - "SLACK_SEND_MESSAGE",
241 - "GITHUB_CREATE_ISSUE"
242 - ],
243 - manuallyManageConnections: false
244 - }
245 -);
246 -```
247 - </Tab>
248 -</Tabs>
249 -
250 -## Generate user URLs
251 -
252 -After creating a server, generate unique URLs for each user.
253 -
254 -<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
255 - <Tab value="Python">
256 -```python
257 -# Generate instance for user
258 -instance = server.generate("user@example.com")
259 -
260 -print(f"URL: {instance['url']}")
261 -print(f"Tools: {instance['allowed_tools']}")
262 -
263 -# Chat-based authentication is enabled by default
264 -# Set manually_manage_connections=True to disable it:
265 -instance_manual = server.generate(
266 - "user@example.com",
267 - manually_manage_connections=True
268 -)
269 -```
270 - </Tab>
271 - <Tab value="TypeScript">
272 -```typescript
273 -import { Composio } from '@composio/core';
274 -const composio = new Composio({ apiKey: 'your_api_key' });
275 -// ---cut---
276 -// Generate instance for user
277 -const instance = await composio.mcp.generate(
278 - "user@example.com",
279 - "mcp_server_id"
280 -);
281 -
282 -console.log("URL:", instance.url);
283 -console.log("Tools:", instance.allowedTools);
284 -
285 -// Chat-based authentication is enabled by default
286 -// Set manuallyManageConnections: true to disable it:
287 -const instanceManual = await composio.mcp.generate(
288 - "user@example.com",
289 - "mcp_server_id",
290 - { manuallyManageConnections: true }
291 -);
292 -```
293 - </Tab>
294 -</Tabs>
295 -
296 -<Callout type="info">
297 -**Chat-based authentication:**
298 -- **TypeScript**: Enabled by default (set `manuallyManageConnections=false` or omit it)
299 -- **Python**: Enabled by default (set `manually_manage_connections=False` or omit it)
300 -
301 -When enabled, the agent can authenticate users dynamically during conversation if they're missing required connections. Set `manuallyManageConnections=true` (TypeScript) or `manually_manage_connections=True` (Python) to disable it.
302 -</Callout>
303 -
304 -## Best practices
305 -
306 -- **Use descriptive names** - Makes servers easy to find
307 -- **Limit tools appropriately** - Only include necessary tools
308 -- **Reuse servers** - Don't create duplicates for same configuration
309 -- **Store server IDs** - Keep track of created server IDs
docs/content/docs/mcp/meta.json
+1 -2
@@ -1,7 +1,6 @@
1 {
2 "title": "MCP",
3 "pages": [
4 - "mcp-quickstart",
5 - "mcp-server-management"
4 + "index"
5 ]
6 }