# How to integrate Turbot pipes MCP with LlamaIndex

```json
{
  "title": "How to integrate Turbot pipes MCP with LlamaIndex",
  "toolkit": "Turbot pipes",
  "toolkit_slug": "turbot_pipes",
  "framework": "LlamaIndex",
  "framework_slug": "llama-index",
  "url": "https://composio.dev/toolkits/turbot_pipes/framework/llama-index",
  "markdown_url": "https://composio.dev/toolkits/turbot_pipes/framework/llama-index.md",
  "updated_at": "2026-05-12T10:29:09.596Z"
}
```

## Introduction

This guide walks you through connecting Turbot pipes to LlamaIndex using the Composio tool router. By the end, you'll have a working Turbot pipes agent that can show all recent activity logs for your account, list all workspaces i have access to, retrieve your current organization details through natural language commands.
This guide will help you understand how to give your LlamaIndex agent real control over a Turbot pipes account through Composio's Turbot pipes MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Turbot pipes with

- [OpenAI Agents SDK](https://composio.dev/toolkits/turbot_pipes/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/turbot_pipes/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/turbot_pipes/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/turbot_pipes/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/turbot_pipes/framework/codex)
- [OpenClaw](https://composio.dev/toolkits/turbot_pipes/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/turbot_pipes/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/turbot_pipes/framework/cli)
- [Google ADK](https://composio.dev/toolkits/turbot_pipes/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/turbot_pipes/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/turbot_pipes/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/turbot_pipes/framework/mastra-ai)
- [CrewAI](https://composio.dev/toolkits/turbot_pipes/framework/crew-ai)

## TL;DR

Here's what you'll learn:
- Set your OpenAI and Composio API keys
- Install LlamaIndex and Composio packages
- Create a Composio Tool Router session for Turbot pipes
- Connect LlamaIndex to the Turbot pipes MCP server
- Build a Turbot pipes-powered agent using LlamaIndex
- Interact with Turbot pipes through natural language

## What is LlamaIndex?

LlamaIndex is a data framework for building LLM applications. It provides tools for connecting LLMs to external data sources and services through agents and tools.
Key features include:
- ReAct Agent: Reasoning and acting pattern for tool-using agents
- MCP Tools: Native support for Model Context Protocol
- Context Management: Maintain conversation context across interactions
- Async Support: Built for async/await patterns

## What is the Turbot pipes MCP server, and what's possible with it?

The Turbot pipes MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Turbot pipes account. It provides structured and secure access to your Turbot Pipes platform, so your agent can perform actions like retrieving activity logs, managing workspaces, exploring identities, viewing organizations, and handling notification endpoints on your behalf.
- Activity monitoring and auditing: Ask your agent to fetch detailed activity logs for your account, helping you track user actions and audit changes across your Turbot Pipes environment.
- Workspace and organization management: Retrieve and list all organizations and workspaces associated with your account to keep tabs on your team’s collaboration spaces and resources.
- Identity exploration and avatar retrieval: Let your agent search identities, fetch details by handle, and even grab profile avatars—useful for user management and directory automation.
- Notification endpoint discovery: Quickly list all user notifiers set up for your account, so you can manage or audit where and how notifications are delivered.
- Account and connection insights: Access detailed information about the authenticated actor and their connections to maintain visibility and control over account access and linked integrations.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `TURBOT_PIPES_ACTOR_GET` | Get Authenticated Actor | Tool to retrieve the authenticated actor. Use when you need details about the currently authenticated actor after obtaining a valid token. |
| `TURBOT_PIPES_ACTOR_LIST_ACTIVITY` | List Actor Activity | Tool to list activities for the authenticated actor. Use when you need detailed activity logs with optional filtering and pagination. |
| `TURBOT_PIPES_ACTOR_LIST_CONNECTIONS` | List actor connections | Tool to list connections associated with the authenticated actor. Use after confirming authentication to retrieve the actor's connection list. |
| `TURBOT_PIPES_ACTOR_LIST_ORGS` | List Actor Organizations | Tool to list organizations associated with the authenticated actor. Use when you have a valid access token. |
| `TURBOT_PIPES_ACTOR_LIST_WORKSPACES` | List Actor Workspaces | Tool to list workspaces for the authenticated actor. Use when you need to retrieve all workspaces the actor has access to. |
| `TURBOT_PIPES_AUTH_LOGIN_TOKEN_EMAIL_CREATE` | Start login via Email | Tool to start login process by sending a confirmation code to a user's email. Use when initiating a passwordless email login flow. |
| `TURBOT_PIPES_CREATE_AUTH_SIGNUP` | Create User Signup | Tool to create a new user account via signup. Use when registering a new user with their email address. |
| `TURBOT_PIPES_CREATE_ORG_CONNECTION` | Create org connection | Tool to create a new connection for an organization. Use when you need to establish a new connection with a specific plugin (e.g., AWS, GCP, Azure) in an organization. |
| `TURBOT_PIPES_CREATE_ORG_CONNECTION_FOLDER` | Create Org Connection Folder | Tool to create a new connection folder for an organization. Use when you need to create a connection folder in an org to organize connections. |
| `TURBOT_PIPES_CREATE_ORG_WORKSPACE_AGGREGATOR` | Create Org Workspace Aggregator | Tool to create an aggregator for a workspace of an organization. Use when you need to add a new aggregator to a specific organization's workspace. |
| `TURBOT_PIPES_CREATE_ORG_WORKSPACE_CONNECTION` | Create Org Workspace Connection | Tool to create a connection on an org workspace or associate an existing org connection to the workspace. Use when you need to create or link a connection to an organization's workspace. |
| `TURBOT_PIPES_CREATE_ORG_WORKSPACE_CONNECTION_FOLDER` | Create Org Workspace Connection Folder | Tool to create a connection folder in a workspace of an organization. Use when you need to organize connections into folders within an org workspace. |
| `TURBOT_PIPES_CREATE_ORG_WORKSPACE_QUERY` | Create Org Workspace Query | Tool to execute a SQL query in an org workspace using POST method. Use when you need to run queries against Turbot Pipes workspaces. Results are limited to 5000 rows or 30 seconds of execution time. |
| `TURBOT_PIPES_CREATE_ORG_WORKSPACE_SNAPSHOT` | Create Org Workspace Snapshot | Tool to create a new workspace snapshot for an organization. Use when you need to save a point-in-time capture of dashboard data, layouts, and panels for a workspace. |
| `TURBOT_PIPES_CREATE_USER_AI_KEY` | Create User AI Key | Tool to create a new AI provider API key at the user level. Use when you need to configure AI provider credentials for a specific user in Turbot Pipes. |
| `TURBOT_PIPES_CREATE_USER_CONNECTION` | Create User Connection | Tool to create a new connection for a user. Use when you need to establish a new connection with a specific plugin (e.g., AWS, GCP, Azure) for a user account. |
| `TURBOT_PIPES_CREATE_USER_INTEGRATION` | Create User Integration | Tool to create a new integration for a user. Use when you need to create a new integration for a specific user by providing the user handle, integration handle, and type. |
| `TURBOT_PIPES_CREATE_USER_NOTIFIER` | Create User Notifier | Tool to create a new notifier for a user. Use when you need to configure notification endpoints for a specific user in Turbot Pipes. |
| `TURBOT_PIPES_CREATE_USER_PASSWORD` | Create User Password | Tool to create or rotate a user password. Use when you need to generate a new password for a user or reset an existing one. |
| `TURBOT_PIPES_CREATE_USER_WORKSPACE_CONNECTION` | Create User Workspace Connection | Tool to create a connection on a workspace for a user. Use when you need to create or link a connection to a user's workspace. |
| `TURBOT_PIPES_CREATE_USER_WORKSPACE_CONNECTION_FOLDER` | Create User Workspace Connection Folder | Tool to create a connection folder in a workspace of a user. Use when you need to organize connections into folders within a user workspace. |
| `TURBOT_PIPES_CREATE_USER_WORKSPACE_DATATANK` | Create User Workspace Datatank | Tool to create a new user workspace Datatank. Use when you need to create a new Datatank for data storage in a user's workspace. |
| `TURBOT_PIPES_CREATE_USER_WORKSPACE_DATATANK_TABLE` | Create User Workspace Datatank Table | Tool to create a new user workspace datatank table. Use when you need to create a table within a user's workspace datatank for data storage and querying. |
| `TURBOT_PIPES_CREATE_USER_WORKSPACE_MOD_VARIABLE_SETTING` | Create User Workspace Mod Variable Setting | Tool to create a setting for a mod variable in a user workspace. Use when you need to configure a variable for a mod installed in a user's workspace. |
| `TURBOT_PIPES_CREATE_USER_WORKSPACE_NOTIFIER` | Create User Workspace Notifier | Tool to create a new notifier for a user workspace. Use when you need to configure a notification endpoint (e.g., Slack, email) for a specific workspace. |
| `TURBOT_PIPES_DELETE_CONVERSATION_ORG` | Delete Org Workspace Conversation | Tool to delete a specific org workspace conversation. Use when you need to remove an AI conversation from an organization workspace after confirming the org handle, workspace handle, and conversation ID. |
| `TURBOT_PIPES_DELETE_ORG` | Delete Organization | Tool to delete a specified organization if you have appropriate access. Use when you need to permanently remove an organization and have confirmed the org handle. |
| `TURBOT_PIPES_DELETE_ORG_BILLING_SUBSCRIPTION` | Delete Org Billing Subscription | Tool to delete an organization billing subscription. Schedules cancellation at the end of the current period. Use when you need to cancel an org subscription after confirming the org handle and subscription ID. |
| `TURBOT_PIPES_DELETE_ORG_CONNECTION_PERMISSION` | Delete Org Connection Permission | Tool to delete permission for a connection defined on an org. Use when you need to revoke a specific permission from an org connection. |
| `TURBOT_PIPES_DELETE_ORG_WORKSPACE` | Delete Organization Workspace | Tool to delete an organization workspace. Use when you need to permanently remove a workspace from an organization after confirming org and workspace handles. |
| `TURBOT_PIPES_DELETE_ORG_WORKSPACE_MOD_VARIABLE_SETTING` | Delete Org Workspace Mod Variable Setting | Tool to delete setting for a mod variable in an organization workspace. Use when you need to remove a custom setting for a mod variable in a specific workspace. |
| `TURBOT_PIPES_DELETE_USER_AVATAR` | Delete User Avatar | Tool to delete custom avatar for a user. Use when you need to remove a user's custom avatar and revert to default. |
| `TURBOT_PIPES_DELETE_USER_INTEGRATION` | Delete User Integration | Tool to delete an integration configured for a user. Use when you need to remove a user's integration by providing the user handle and integration handle. |
| `TURBOT_PIPES_DELETE_USER_WORKSPACE_MOD_VARIABLE_SETTING` | Delete User Workspace Mod Variable Setting | Tool to delete a mod variable setting in a user workspace. Use when you need to remove a variable configuration from a mod installed in a user's workspace. |
| `TURBOT_PIPES_DELETE_USER_WORKSPACE_NOTIFIER` | Delete User Workspace Notifier | Tool to delete a notifier for a user workspace. Use when you need to remove a notification configuration from a specific workspace. |
| `TURBOT_PIPES_DELETE_USER_WORKSPACE_PIPELINE` | Delete User Workspace Pipeline | Tool to delete a pipeline from a user's workspace. Use when you need to remove a specific pipeline by its ID from a workspace. |
| `TURBOT_PIPES_GET_AUTH_PROVIDER` | Get Auth Provider | Tool to initiate OAuth authentication flow with a provider. Use when you need to start the OAuth authorization process for GitHub, Google, or SAML authentication. |
| `TURBOT_PIPES_GET_CONVERSATION_USER` | Get User Workspace Conversation | Tool to retrieve details for a specific user workspace conversation. Use when you need to get information about an AI conversation in a user workspace. |
| `TURBOT_PIPES_GET_DATATANK_TABLE` | Get Datatank Table | Tool to get the details for a workspace Datatank table. Use when you need to retrieve information about a specific datatank table including its state, configuration, and metadata. |
| `TURBOT_PIPES_GET_ORG` | Get Organization | Tool to retrieve organization information by handle. Use when you need details about a specific organization. |
| `TURBOT_PIPES_GET_ORG_BILLING_INVOICE` | Get Organization Billing Invoice | Tool to get an invoice for an organization. Use when you need to retrieve detailed billing invoice information for a specific organization and invoice ID. |
| `TURBOT_PIPES_GET_ORG_CONNECTION_PERMISSION` | Get Org Connection Permission | Tool to retrieve permission details for an org connection. Use when you need to view a specific permission record for a connection within an organization. |
| `TURBOT_PIPES_GET_ORG_INTEGRATION` | Get Organization Integration | Tool to get details of an integration configured on an organization. Use when you need to retrieve information about a specific integration by its handle and organization handle. |
| `TURBOT_PIPES_GET_ORG_MEMBER` | Get Organization Member | Tool to retrieve a specific organization member by org handle and user handle. Use when you need details about a specific member of an organization. |
| `TURBOT_PIPES_GET_ORG_WORKSPACE_CONNECTION` | Get Org Workspace Connection | Tool to get the details for a workspace and connection association on an organization. Use when you need to retrieve information about how a connection is associated with a specific workspace in an organization. |
| `TURBOT_PIPES_GET_ORG_WORKSPACE_CONNECTION_FOLDER` | Get Org Workspace Connection Folder | Tool to retrieve a connection folder for an organization workspace. Use when you need to get details about a specific connection folder in an org workspace. |
| `TURBOT_PIPES_GET_ORG_WORKSPACE_FLOWPIPE_TRIGGER` | Get Org Workspace Flowpipe Trigger | Tool to get the details of a trigger for a workspace in an organization. Use when you need to retrieve information about a specific Flowpipe trigger. |
| `TURBOT_PIPES_GET_ORG_WORKSPACE_INTEGRATION` | Get Org Workspace Integration | Tool to get details of an integration available for a workspace belonging to an organization. Use when you need to retrieve information about a specific integration configured for a workspace within an organization. |
| `TURBOT_PIPES_GET_ORG_WORKSPACE_MOD_VARIABLE_SETTING` | Get Org Workspace Mod Variable Setting | Tool to get setting for a mod variable in an organization workspace. Use when you need to retrieve the current configuration and value of a specific mod variable in a workspace. |
| `TURBOT_PIPES_GET_ORG_WORKSPACE_NOTIFIER` | Get Org Workspace Notifier | Tool to retrieve a notifier from an org workspace. Use when you need to get details about a specific notification endpoint configured for an organization's workspace. |
| `TURBOT_PIPES_GET_ORG_WORKSPACE_QUERY_DATA` | Get Org Workspace Query Data | Tool to execute a SQL query in an org workspace and retrieve results. Use when you need to run queries against Turbot Pipes workspaces. Results are limited to 5000 rows or 30 seconds of execution time. |
| `TURBOT_PIPES_GET_TENANT` | Get Tenant | Tool to retrieve tenant information by handle. Use when you need details about a specific tenant. |
| `TURBOT_PIPES_GET_TENANT_AVATAR` | Get Tenant Avatar | Tool to retrieve public avatar image for a tenant. Use when you need to display or download the tenant's avatar. |
| `TURBOT_PIPES_GET_USER` | Get User | Tool to retrieve user information by handle. Use when you need details about a specific user. |
| `TURBOT_PIPES_GET_USER_AI_KEY` | Get User AI Key | Tool to retrieve AI provider API key metadata at the user level. Use when you need to check which AI provider keys are configured for a specific user. |
| `TURBOT_PIPES_GET_USER_BILLING_PLAN` | Get User Billing Plan | Tool to get the current user billing plan. Use when you need to retrieve detailed billing plan information for a specific user. |
| `TURBOT_PIPES_GET_USER_BILLING_UPCOMING_INVOICE` | Get User Billing Upcoming Invoice | Tool to get the upcoming invoice for a user. Use when you need to retrieve the estimated next invoice for a user's billing cycle. Returns null when no upcoming invoice exists. |
| `TURBOT_PIPES_GET_USER_CONNECTION` | Get User Connection | Tool to retrieve details of a connection belonging to a user. Use when you need to fetch information about a specific user connection by user handle and connection handle. |
| `TURBOT_PIPES_GET_USER_EMAIL` | Get User Email | Tool to retrieve a specific user email record with metadata. Use when you need details about a user's email verification status and metadata. |
| `TURBOT_PIPES_GET_USER_INTEGRATION` | Get User Integration | Tool to get details of an integration configured on a user. Use when you need to retrieve information about a specific user integration by providing the user handle and integration handle. |
| `TURBOT_PIPES_GET_USER_PASSWORD` | Get User Database Password | Tool to retrieve user database password. Use when you need to get the database password for a specific user by their handle. |
| `TURBOT_PIPES_GET_USER_PREFERENCES` | Get User Preferences | Tool to retrieve user preferences including email subscription settings. Use when you need to check a user's communication preferences. |
| `TURBOT_PIPES_GET_USER_PROCESS` | Get User Process | Tool to retrieve process information for a user. Use when you need details about a specific process associated with a user. |
| `TURBOT_PIPES_GET_USER_WORKSPACE` | Get User Workspace | Tool to retrieve workspace details for a specific user. Use when you need information about a workspace owned by a user. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_AGGREGATOR` | Get User Workspace Aggregator | Tool to get the details of an aggregator belonging to a workspace of a user. Use when you need to retrieve information about a specific aggregator in a user's workspace. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_CONNECTION` | Get User Workspace Connection | Tool to get the details for a workspace and connection association for a user. Use when you need to retrieve information about how a connection is associated with a specific workspace owned by a user. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_CONNECTION_FOLDER` | Get User Workspace Connection Folder | Tool to retrieve a connection folder for a user workspace. Use when you need to get details about a specific connection folder in a user workspace. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_DATATANK` | Get User Workspace Datatank | Tool to retrieve user workspace datatank details. Use when you need information about a specific datatank within a user's workspace. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_FLOWPIPE_MOD` | Get User Workspace Flowpipe Mod | Tool to retrieve details of an installed flowpipe mod in a user workspace. Use when you need information about a specific flowpipe mod installed in a workspace. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_FLOWPIPE_PIPELINE` | Get User Workspace Flowpipe Pipeline | Tool to retrieve pipeline details for a user workspace. Use when you need detailed information about a specific Flowpipe pipeline in a user's workspace. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_INTEGRATION` | Get User Workspace Integration | Tool to get details of an integration available for a workspace belonging to a user. Use when you need to retrieve information about a specific integration configured for a user's workspace. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_MOD` | Get User Workspace Mod | Tool to retrieve details of an installed mod in a user's workspace. Use when you need information about a specific mod installed in a workspace owned by a user. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_MOD_VARIABLE_SETTING` | Get User Workspace Mod Variable Setting | Tool to get setting for a mod variable in a user workspace. Use when you need to retrieve the current configuration and value of a specific mod variable in a user's workspace. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_NOTIFIER` | Get User Workspace Notifier | Tool to retrieve a notifier from a user workspace. Use when you need to get details about a specific notification endpoint configured for a user's workspace. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_PIPELINE` | Get User Workspace Pipeline | Tool to get the details of a pipeline for a workspace of a user. Use when you need information about a specific pipeline in a user workspace. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_PROCESS` | Get User Workspace Process | Tool to retrieve process details for a user workspace. Use when you need information about a specific process running in a user's workspace. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_PROCESS_LOG` | Get User Workspace Process Log | Tool to retrieve process logs for a user workspace process. Use when you need to fetch and analyze logs for a specific process running in a user's workspace. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_QUERY` | Get User Workspace Query | Tool to execute a SQL query in a user workspace and retrieve results. Use when you need to run queries against Turbot Pipes user workspaces. Results are limited to 5000 rows or 30 seconds of execution time. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_QUERY_DATA` | Get User Workspace Query Data | Tool to execute a SQL query in a user workspace and retrieve results. Use when you need to run queries against Turbot Pipes user workspaces. Results are limited to 5000 rows or 30 seconds of execution time. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_SCHEMA` | Get User Workspace Schema | Tool to retrieve workspace schema details for a specific user. Use when you need information about a specific schema within a user's workspace. |
| `TURBOT_PIPES_GET_USER_WORKSPACE_SCHEMA_TABLE` | Get User Workspace Schema Table | Tool to get details about a specific table in a user workspace schema. Use when you need information about table structure, columns, and metadata within a user's workspace schema. |
| `TURBOT_PIPES_IDENTITIES_GET` | Get Identity | Tool to retrieve a specific identity by handle. Use when you need details of an identity by its handle after authenticating. |
| `TURBOT_PIPES_IDENTITIES_GET_AVATAR` | Get Identity Avatar | Tool to retrieve avatar image for an identity. Use when you need to display or download the user's avatar after knowing their identity handle. |
| `TURBOT_PIPES_IDENTITIES_LIST` | List Identities | Tool to list all identities. Use when you need to retrieve identities with optional filtering, sorting, and pagination after authentication. |
| `TURBOT_PIPES_INITIATE_LOGIN` | Initiate User Login | Tool to initiate user login. Use when starting a login flow for a user with their email address. |
| `TURBOT_PIPES_INSTALL_USER_INTEGRATION_SLACK` | Install User Slack Integration | Tool to install a Slack integration for a user identity. Use when you need to initiate the Slack OAuth flow by redirecting to the Slack authorization URL. |
| `TURBOT_PIPES_INSTALL_USER_WORKSPACE_FLOWPIPE_MOD` | Install User Workspace Flowpipe Mod | Tool to install a flowpipe mod to a user's workspace. Use when you need to install a flowpipe mod from a repository path into a specific user workspace. |
| `TURBOT_PIPES_INSTALL_USER_WORKSPACE_MOD` | Install User Workspace Mod | Tool to install a mod to a user workspace. Use when you need to add a new mod from a repository path to a specific workspace. |
| `TURBOT_PIPES_LIST_ORG_PROCESS` | List Organization Processes | Tool to list processes for an organization. Use when you need to retrieve all processes for a specific organization with optional pagination. |
| `TURBOT_PIPES_LIST_ORG_SERVICE_ACCOUNTS` | List Organization Service Accounts | Tool to list service accounts at the organization level. Use when you need to retrieve all service accounts for a specific organization. |
| `TURBOT_PIPES_LIST_ORG_USAGE` | List Organization Usage | Tool to list all usage metrics for an organization. Use when you need to retrieve usage data for billing, monitoring, or analytics purposes. |
| `TURBOT_PIPES_LIST_ORG_WORKSPACE_DATATANK` | List Org Workspace Datatank | Tool to list org workspace Datatank with pagination support. Use when you need to retrieve Datatank items for a specific organization and workspace. |
| `TURBOT_PIPES_LIST_ORG_WORKSPACE_FLOWPIPE_MOD_VARIABLE` | List Organization Workspace Flowpipe Mod Variables | Tool to list all variables for a flowpipe mod in an organization workspace. Use when you need to retrieve mod variables within a specific workspace. |
| `TURBOT_PIPES_LIST_ORG_WORKSPACE_MOD` | List Org Workspace Mods | Tool to list organization workspace installed mods with pagination support. Use when you need to retrieve installed mods for a specific organization and workspace. |
| `TURBOT_PIPES_LIST_ORG_WORKSPACE_PIPELINE` | List Organization Workspace Pipelines | Tool to list pipelines for a workspace of an organization. Use when you need to retrieve scheduled tasks for dashboard snapshots or queries within a specific workspace. |
| `TURBOT_PIPES_LIST_ORG_WORKSPACE_PROCESS` | List Org Workspace Processes | Tool to list processes associated with an org workspace. Use when you need to retrieve all processes for a specific organization workspace with optional filtering and pagination. |
| `TURBOT_PIPES_LIST_ORG_WORKSPACES` | List Organization Workspaces | Tool to list workspaces for a specific organization. Use when you need to retrieve all workspaces associated with an organization handle. |
| `TURBOT_PIPES_LIST_TENANT_GETSETTINGS` | Get Tenant Settings | Tool to retrieve tenant settings. Use when you need to view the current configuration for the tenant, including login methods, session timeouts, and user provisioning settings. |
| `TURBOT_PIPES_LIST_TENANTS` | List Tenants | Tool to list tenants the actor is a member of. Use when you need to retrieve all tenants associated with the authenticated user. |
| `TURBOT_PIPES_LIST_USER_AI_KEYS` | List User AI Keys | Tool to list AI provider API keys configured at the user level. Use when you need to retrieve all AI keys for a specific user. |
| `TURBOT_PIPES_LIST_USER_AUDIT_LOGS` | List User Audit Logs | Tool to list audit logs for a specific user. Use when you need to retrieve audit trail information with optional pagination. |
| `TURBOT_PIPES_LIST_USER_BILLING_INVOICES` | List User Billing Invoices | Tool to list user invoices with pagination support. Use when you need to retrieve billing invoice information for a specific user. |
| `TURBOT_PIPES_LIST_USER_BILLING_PAYMENT_METHOD` | List User Billing Payment Methods | Tool to list user billing payment methods. Use when you need to retrieve payment methods configured for a user's billing. |
| `TURBOT_PIPES_LIST_USER_BILLING_SUBSCRIPTION` | List User Billing Subscriptions | Tool to list user billing subscriptions. Use when you need to retrieve subscription information for a specific user. Note: Users typically have one active subscription, but this endpoint may also return historical subscriptions. |
| `TURBOT_PIPES_LIST_USER_CONNECTIONS` | List User Connections | Tool to list connections for a specific user by user handle. Use when you need to retrieve all connections associated with a user. |
| `TURBOT_PIPES_LIST_USER_CONSTRAINTS` | List User Constraints | Tool to list all applicable constraints for a user. Use when you need to retrieve quota, rate, or setting constraints with optional filtering and pagination. |
| `TURBOT_PIPES_LIST_USER_EMAILS` | List User Emails | Tool to list emails for a user along with metadata information for each item. Use when you need to retrieve all email addresses associated with a specific user. |
| `TURBOT_PIPES_LIST_USER_INTEGRATION` | List User Integrations | Tool to list integrations configured for a user. Use when you need to retrieve all integrations for a specific user with optional pagination. |
| `TURBOT_PIPES_LIST_USER_PROCESS` | List User Processes | Tool to list processes for a user. Use when you need to retrieve all processes for a specific user with optional pagination. |
| `TURBOT_PIPES_LIST_USER_USAGE` | List User Usage | Tool to list all usage metrics for a user. Use when you need to retrieve usage data for billing, monitoring, or analytics purposes. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_AGGREGATOR` | List User Workspace Aggregators | Tool to list aggregators for a workspace of a user. Use when you need to retrieve aggregator configurations for a specific user's workspace. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_AGGREGATOR_CONNECTIONS` | List User Workspace Aggregator Connections | Tool to list all connections that are part of an aggregator in a user workspace. Use when you need to retrieve connections within a specific aggregator. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_AUDIT_LOGS` | List User Workspace Audit Logs | Tool to list audit logs for a specific user workspace. Use when you need to retrieve workspace audit trail information with optional pagination. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_CONNECTION` | List User Workspace Connections | Tool to list connections explicitly defined or associated to a workspace. Use when you need to retrieve all connections available in a user's workspace. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_CONNECTION_ASSOCIATION` | List User Workspace Connection Associations | Tool to list connections associated with a workspace for a specific user. Use when you need to retrieve all connection associations for a user's workspace. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_CONNECTION_FOLDER` | List User Workspace Connection Folders | Tool to list connection folders for a user workspace. Use when you need to retrieve all connection folders associated with a user's workspace. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_CONNECTION_TREE` | List User Workspace Connection Tree | Tool to list connection tree for a user workspace. Use when you need to retrieve the hierarchical connection structure for a specific user's workspace. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_CONVERSATIONS` | List User Workspace Conversations | Tool to list AI conversations in a user workspace with optional filtering and pagination. Use when you need to retrieve conversations from a specific user workspace, optionally filtered by title pattern. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_DATATANK` | List User Workspace Datatank | Tool to list user workspace Datatank with pagination support. Use when you need to retrieve Datatank items for a specific user and workspace. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_DATATANK_PART` | List User Workspace Datatank Partitions | Tool to list user workspace Datatank partitions with pagination support. Use when you need to retrieve partition details for a specific Datatank table in a user's workspace. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_DATATANK_TABLE` | List User Workspace Datatank Table | Tool to list user workspace Datatank tables with pagination support. Use when you need to retrieve datatank tables for a specific user, workspace, and datatank. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_DB_LOGS` | List User Workspace Database Logs | Tool to list database query logs for a specific user workspace. Use when you need to retrieve workspace database query history with optional pagination. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_FLOWPIPE_INPUT` | List User Workspace Flowpipe Inputs | Tool to list Flowpipe inputs for a user workspace. Use when you need to retrieve all Flowpipe inputs for a specific workspace with optional pagination. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_FLOWPIPE_MOD_VARIABLE` | List User Workspace Flowpipe Mod Variables | Tool to list all variables for a flowpipe mod in a user workspace. Use when you need to retrieve mod variables within a specific workspace owned by a user. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_FLOWPIPE_PIPELINE` | List User Workspace Flowpipe Pipelines | Tool to list Flowpipe pipelines for a user workspace. Use when you need to retrieve pipelines within a specific workspace belonging to a user. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_FLOWPIPE_PIPELINE_TRIGGER` | List User Workspace Pipeline Triggers | Tool to list Flowpipe triggers associated with a specific pipeline in a user workspace. Use when you need to retrieve all triggers configured for a particular pipeline. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_FLOWPIPE_TRIGGER` | List User Workspace Flowpipe Triggers | Tool to list Flowpipe triggers for a user workspace. Use when you need to retrieve all triggers configured in a specific user's workspace. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_INTEGRATION` | List User Workspace Integrations | Tool to list integrations available for a user workspace. Use when you need to retrieve all integrations configured for a specific user workspace. If run on a custom tenant, this will return integrations configured both on tenant and user level. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_MOD` | List User Workspace Mods | Tool to list user workspace installed mods with pagination support. Use when you need to retrieve installed mods for a specific user and workspace. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_MOD_VARIABLE` | List User Workspace Mod Variables | Tool to list all variables applicable for a mod in a workspace specific to a user. Use when you need to retrieve mod variables within a specific user's workspace. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_NOTIFIER` | List User Workspace Notifiers | Tool to list all notifiers for a user workspace. Use when you need to view notification endpoints configured for a specific user's workspace with optional pagination and filtering. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_PIPELINE` | List User Workspace Pipelines | Tool to list pipelines for a workspace of a user. Use when you need to retrieve scheduled tasks for dashboard snapshots or queries within a specific user workspace. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_PROCESS` | List User Workspace Processes | Tool to list processes associated with a user workspace. Use when you need to retrieve all processes for a specific user workspace with optional filtering and pagination. |
| `TURBOT_PIPES_LIST_USER_WORKSPACES` | List User Workspaces | Tool to list workspaces for a specific user. Use when you need to retrieve all workspaces associated with a user handle. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_SCHEMA` | List User Workspace Schemas | Tool to list schemas for a user workspace. Use when you need to retrieve schemas including aggregators, datatanks, and identity-level connections for a specific user's workspace. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_SCHEMA_TABLE` | List User Workspace Schema Tables | Tool to list tables for a user workspace schema with pagination support. Use when you need to retrieve tables for a specific user, workspace, and schema. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_SNAPSHOT` | List User Workspace Snapshots | Tool to list workspace snapshots for a user. Use when you need to retrieve snapshots from a specific user workspace with optional pagination. |
| `TURBOT_PIPES_LIST_USER_WORKSPACE_USAGE` | List User Workspace Usage | Tool to list the usage associated with a user workspace. Use when you need to retrieve usage metrics for a specific user's workspace with optional filtering and pagination. |
| `TURBOT_PIPES_POST_USER_WORKSPACE_NOTIFIER_COMMAND` | Post User Workspace Notifier Command | Tool to post a command for a notifier in a user's workspace. Use when you need to execute commands on workspace notifiers, such as setting a notifier as the default. |
| `TURBOT_PIPES_POST_USER_WORKSPACE_QUERY` | Post User Workspace Query | Tool to perform a SQL query in a user workspace. Use when you need to execute queries against Turbot Pipes user workspaces. Results are limited to 5000 rows or 30 seconds of execution time. |
| `TURBOT_PIPES_RUN_ORG_WORKSPACE_COMMAND` | Run Organization Workspace Command | Tool to run a command in an organization workspace. Use when you need to execute workspace operations like rebooting a workspace. |
| `TURBOT_PIPES_RUN_USER_WORKSPACE_COMMAND` | Run User Workspace Command | Tool to run a command in a user workspace. Use when you need to execute workspace operations like rebooting a user's workspace. |
| `TURBOT_PIPES_RUN_USER_WORKSPACE_FLOWPIPE_PIPELINE_COMMAND` | Run User Workspace Flowpipe Pipeline Command | Tool to run a command on a Flowpipe pipeline in a user workspace. Use when you need to execute a pipeline command such as 'run' to start pipeline execution. |
| `TURBOT_PIPES_RUN_USER_WORKSPACE_FLOWPIPE_TRIGGER_COMMAND` | Run User Workspace Flowpipe Trigger Command | Tool to run a command on a trigger in a workspace belonging to a user. Use when you need to execute or reset a Flowpipe trigger. |
| `TURBOT_PIPES_RUN_USER_WORKSPACE_QUERY` | Run User Workspace Query | Tool to perform a SQL query in a user workspace using POST method. Use when you need to execute queries against Turbot Pipes user workspaces. Results are limited to 5000 rows or 30 seconds of execution time. |
| `TURBOT_PIPES_SEND_USER_WORKSPACE_CHAT_MESSAGE` | Send Chat Message to User Workspace AI | Tool to send a chat message to the AI agent in a user workspace. Creates a new conversation if conversation_id is not provided, or continues an existing conversation if provided. |
| `TURBOT_PIPES_TEST_USER_AI_KEY` | Test User AI Key | Tool to test whether an AI provider API key is valid at the user level. Use when you need to verify if a saved or provided API key works correctly with the specified provider. |
| `TURBOT_PIPES_TEST_USER_CONNECTION` | Test User Connection | Tool to test a user connection for basic connectivity. Use when you need to verify if a connection's configuration is valid and the credentials work correctly with the specified plugin. |
| `TURBOT_PIPES_TEST_USER_INTEGRATION` | Test User Integration | Tool to test the config for a user integration to check for basic connectivity before you create it. Use when you need to validate integration credentials and configuration by providing the user handle, integration handle (or _ for new integrations), integration type, and config. |
| `TURBOT_PIPES_TEST_USER_WORKSPACE_CONNECTION` | Test User Workspace Connection | Tool to test the config for a connection configured on a user workspace to check for basic connectivity. Use when you need to verify that a connection is properly configured before creating or using it. |
| `TURBOT_PIPES_UNINSTALL_FLOWPIPE_MOD` | Uninstall Flowpipe Mod | Tool to uninstall a flowpipe mod from a user's workspace. Use when you need to remove a flowpipe mod from a specific workspace after confirming the user handle, workspace handle, and mod alias. |
| `TURBOT_PIPES_UNINSTALL_ORG_WORKSPACE_FLOWPIPE_MOD` | Uninstall Org Workspace Flowpipe Mod | Tool to uninstall a flowpipe mod from an organization workspace. Use when you need to remove a flowpipe mod from a specific workspace after confirming org handle, workspace handle, and mod alias. |
| `TURBOT_PIPES_UPDATE_CONVERSATION_USER` | Update User Workspace Conversation | Tool to update a user workspace conversation (e.g., title). Use when you need to modify properties of an AI conversation in a user workspace. |
| `TURBOT_PIPES_UPDATE_ORG_BILLING_SUBSCRIPTION` | Update Org Billing Subscription | Tool to update an organization billing subscription. Use to stop cancellation at the next billing period by passing 'stopcancel' action or to upgrade the subscription. Useful when managing org subscription lifecycle. |
| `TURBOT_PIPES_UPDATE_ORG_CONNECTION` | Update Org Connection | Tool to update the details of a connection belonging to an organization. Use when you need to modify connection configuration, change config/credential sources, rename the connection handle, or reassign the connection to a different parent entity. |
| `TURBOT_PIPES_UPDATE_ORG_CONNECTION_FOLDER` | Update Org Connection Folder | Tool to update the details of an org connection folder. Use when you need to modify the title or parent location of a connection folder. |
| `TURBOT_PIPES_UPDATE_ORG_MEMBER` | Update Organization Member Role | Tool to update the role of an organization member. Use when you need to change a member's role (e.g., promote to owner or demote to member) within an organization. |
| `TURBOT_PIPES_UPDATE_ORG_SERVICE_ACCOUNT` | Update Organization Service Account | Tool to update an existing service account at the organization level. Use when you need to modify the title, description, or token_min_issued_at for a service account. |
| `TURBOT_PIPES_UPDATE_ORG_SERVICE_ACCOUNT_TOKEN` | Update Organization Service Account Token | Tool to update an existing token for an organization-level service account. Use when you need to modify token properties such as status, title, or description. |
| `TURBOT_PIPES_UPDATE_USER` | Update User | Tool to update user information including handle name, display name, or URL. Use when you need to modify user attributes. |
| `TURBOT_PIPES_UPDATE_USER_AI_KEY` | Update User AI Key | Tool to update an existing AI provider API key at the user level. Use when you need to update an API key for a specific AI provider (OpenAI or Anthropic) for a user. |
| `TURBOT_PIPES_UPDATE_USER_CONNECTION` | Update User Connection | Tool to update the details of a connection belonging to a user. Use when you need to modify configuration, handle, parent_id, config_source, or credential_source of a user's connection. Requires user_handle and connection_handle to identify the target connection. |
| `TURBOT_PIPES_UPDATE_USER_INTEGRATION` | Update User Integration | Tool to update details of an integration configured for a user. Use when you need to modify an existing user integration's state, handle, or configuration. |
| `TURBOT_PIPES_UPDATE_USER_PREFERENCES` | Update User Preferences | Tool to update user preferences for email communications. Use when you need to change a user's communication preferences such as opting in or out of product updates, community updates, or tips and tricks emails. |
| `TURBOT_PIPES_UPDATE_USER_TOKEN` | Update User Token | Tool to update a user token's status between active and inactive. Use when you need to enable or disable a token without deleting it. |
| `TURBOT_PIPES_UPDATE_USER_WORKSPACE` | Update User Workspace | Tool to update the workspace for a user. Use when you need to modify workspace settings such as desired state, instance type, database volume size, or search path prefix. |
| `TURBOT_PIPES_USER_NOTIFIERS_LIST` | List User Notifiers | Tool to list all notifiers for a user. Use when you need to view a user's configured notification endpoints. |
| `TURBOT_PIPES_USER_TOKENS_DELETE` | Delete User Token | Tool to delete a specific user token. Use when you need to revoke a user's token after confirming handle and token ID. |
| `TURBOT_PIPES_USER_TOKENS_GET` | Get User Token | Tool to retrieve details of a specific user token. Use when you need to inspect token metadata (e.g., creation time and scopes) after confirming the user handle and token ID. |

## Supported Triggers

None listed.

## Creating MCP Server - Stand-alone vs Composio SDK

The Turbot pipes MCP server is an implementation of the Model Context Protocol that connects your AI agent to Turbot pipes. It provides structured and secure access so your agent can perform Turbot pipes operations on your behalf through a secure, permission-based interface.
With Composio's managed implementation, you don't have to create your own developer app. For production, if you're building an end product, we recommend using your own credentials. The managed server helps you prototype fast and go from 0-1 faster.

## Step-by-step Guide

### 1. Prerequisites

Before you begin, make sure you have:
- Python 3.8/Node 16 or higher installed
- A Composio account with the API key
- An OpenAI API key
- A Turbot pipes account and project
- Basic familiarity with async Python/Typescript

### 1. Getting API Keys for OpenAI, Composio, and Turbot pipes

No description provided.

### 2. Installing dependencies

No description provided.
```python
pip install composio-llamaindex llama-index llama-index-llms-openai llama-index-tools-mcp python-dotenv
```

```typescript
npm install @composio/llamaindex @llamaindex/openai @llamaindex/tools @llamaindex/workflow dotenv
```

### 3. Set environment variables

Create a .env file in your project root:
These credentials will be used to:
- Authenticate with OpenAI's GPT-5 model
- Connect to Composio's Tool Router
- Identify your Composio user session for Turbot pipes access
```bash
OPENAI_API_KEY=your-openai-api-key
COMPOSIO_API_KEY=your-composio-api-key
COMPOSIO_USER_ID=your-user-id
```

### 4. Import modules

No description provided.
```python
import asyncio
import os
import dotenv

from composio import Composio
from composio_llamaindex import LlamaIndexProvider
from llama_index.core.agent.workflow import ReActAgent
from llama_index.core.workflow import Context
from llama_index.llms.openai import OpenAI
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec

dotenv.load_dotenv()
```

```typescript
import "dotenv/config";
import readline from "node:readline/promises";
import { stdin as input, stdout as output } from "node:process";

import { Composio } from "@composio/core";

import { mcp } from "@llamaindex/tools";
import { agent as createAgent } from "@llamaindex/workflow";
import { openai } from "@llamaindex/openai";

dotenv.config();
```

### 5. Load environment variables and initialize Composio

No description provided.
```python
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
COMPOSIO_API_KEY = os.getenv("COMPOSIO_API_KEY")
COMPOSIO_USER_ID = os.getenv("COMPOSIO_USER_ID")

if not OPENAI_API_KEY:
    raise ValueError("OPENAI_API_KEY is not set in the environment")
if not COMPOSIO_API_KEY:
    raise ValueError("COMPOSIO_API_KEY is not set in the environment")
if not COMPOSIO_USER_ID:
    raise ValueError("COMPOSIO_USER_ID is not set in the environment")
```

```typescript
const OPENAI_API_KEY = process.env.OPENAI_API_KEY;
const COMPOSIO_API_KEY = process.env.COMPOSIO_API_KEY;
const COMPOSIO_USER_ID = process.env.COMPOSIO_USER_ID;

if (!OPENAI_API_KEY) throw new Error("OPENAI_API_KEY is not set");
if (!COMPOSIO_API_KEY) throw new Error("COMPOSIO_API_KEY is not set");
if (!COMPOSIO_USER_ID) throw new Error("COMPOSIO_USER_ID is not set");
```

### 6. Create a Tool Router session and build the agent function

What's happening here:
- We create a Composio client using your API key and configure it with the LlamaIndex provider
- We then create a tool router MCP session for your user, specifying the toolkits we want to use (in this case, turbot pipes)
- The session returns an MCP HTTP endpoint URL that acts as a gateway to all your configured tools
- LlamaIndex will connect to this endpoint to dynamically discover and use the available Turbot pipes tools.
- The MCP tools are mapped to LlamaIndex-compatible tools and plug them into the Agent.
```python
async def build_agent() -> ReActAgent:
    composio_client = Composio(
        api_key=COMPOSIO_API_KEY,
        provider=LlamaIndexProvider(),
    )

    session = composio_client.create(
        user_id=COMPOSIO_USER_ID,
        toolkits=["turbot_pipes"],
    )

    mcp_url = session.mcp.url
    print(f"Composio MCP URL: {mcp_url}")

    mcp_client = BasicMCPClient(mcp_url, headers={"x-api-key": COMPOSIO_API_KEY})
    mcp_tool_spec = McpToolSpec(client=mcp_client)
    tools = await mcp_tool_spec.to_tool_list_async()

    llm = OpenAI(model="gpt-5")

    description = "An agent that uses Composio Tool Router MCP tools to perform Turbot pipes actions."
    system_prompt = """
    You are a helpful assistant connected to Composio Tool Router.
    Use the available tools to answer user queries and perform Turbot pipes actions.
    """
    return ReActAgent(tools=tools, llm=llm, description=description, system_prompt=system_prompt, verbose=True)
```

```typescript
async function buildAgent() {

  console.log(`Initializing Composio client...${COMPOSIO_USER_ID!}...`);
  console.log(`COMPOSIO_USER_ID: ${COMPOSIO_USER_ID!}...`);

  const composio = new Composio({
    apiKey: COMPOSIO_API_KEY,
    provider: new LlamaindexProvider(),
  });

  const session = await composio.create(
    COMPOSIO_USER_ID!,
    {
      toolkits: ["turbot_pipes"],
    },
  );

  const mcpUrl = session.mcp.url;
  console.log(`Composio Tool Router MCP URL: ${mcpUrl}`);

  const server = mcp({
    url: mcpUrl,
    clientName: "composio_tool_router_with_llamaindex",
    requestInit: {
      headers: {
        "x-api-key": COMPOSIO_API_KEY!,
      },
    },
    // verbose: true,
  });

  const tools = await server.tools();

  const llm = openai({ apiKey: OPENAI_API_KEY, model: "gpt-5" });

  const agent = createAgent({
    name: "composio_tool_router_with_llamaindex",
        description : "An agent that uses Composio Tool Router MCP tools to perform actions.",
    systemPrompt:
      "You are a helpful assistant connected to Composio Tool Router."+
"Use the available tools to answer user queries and perform Turbot pipes actions." ,
    llm,
    tools,
  });

  return agent;
}
```

### 7. Create an interactive chat loop

No description provided.
```python
async def chat_loop(agent: ReActAgent) -> None:
    ctx = Context(agent)
    print("Type 'quit', 'exit', or Ctrl+C to stop.")

    while True:
        try:
            user_input = input("\nYou: ").strip()
        except (KeyboardInterrupt, EOFError):
            print("\nBye!")
            break

        if not user_input or user_input.lower() in {"quit", "exit"}:
            print("Bye!")
            break

        try:
            print("Agent: ", end="", flush=True)
            handler = agent.run(user_input, ctx=ctx)

            async for event in handler.stream_events():
                # Stream token-by-token from LLM responses
                if hasattr(event, "delta") and event.delta:
                    print(event.delta, end="", flush=True)
                # Show tool calls as they happen
                elif hasattr(event, "tool_name"):
                    print(f"\n[Using tool: {event.tool_name}]", flush=True)

            # Get final response
            response = await handler
            print()  # Newline after streaming
        except KeyboardInterrupt:
            print("\n[Interrupted]")
            continue
        except Exception as e:
            print(f"\nError: {e}")
```

```typescript
async function chatLoop(agent: ReturnType<typeof createAgent>) {
  const rl = readline.createInterface({ input, output });

  console.log("Type 'quit' or 'exit' to stop.");

  while (true) {
    let userInput: string;

    try {
      userInput = (await rl.question("\nYou: ")).trim();
    } catch {
      console.log("\nAgent: Bye!");
      break;
    }

    if (!userInput) {
      continue;
    }

    const lower = userInput.toLowerCase();
    if (lower === "quit" || lower === "exit") {
      console.log("Agent: Bye!");
      break;
    }

    try {
      process.stdout.write("Agent: ");

      const stream = agent.runStream(userInput);
      let finalResult: any = null;

      for await (const event of stream) {
        // The event.data contains the streamed content
        const data: any = event.data;

        // Check for streaming delta content
        if (data?.delta) {
          process.stdout.write(data.delta);
        }

        // Store final result for fallback
        if (data?.result || data?.message) {
          finalResult = data;
        }
      }

      // If no streaming happened, show the final result
      if (finalResult) {
        const answer =
          finalResult.result ??
          finalResult.message?.content ??
          finalResult.message ??
          "";
        if (answer && typeof answer === "string" && !answer.includes("[object")) {
          process.stdout.write(answer);
        }
      }

      console.log(); // New line after streaming completes
    } catch (err: any) {
      console.error("\nAgent error:", err?.message ?? err);
    }
  }

  rl.close();
}
```

### 8. Define the main entry point

What's happening here:
- We're orchestrating the entire application flow
- The agent gets built with proper error handling
- Then we kick off the interactive chat loop so you can start talking to Turbot pipes
```python
async def main() -> None:
    agent = await build_agent()
    await chat_loop(agent)

if __name__ == "__main__":
    # Handle Ctrl+C gracefully
    signal.signal(signal.SIGINT, lambda s, f: (print("\nBye!"), exit(0)))
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        print("\nBye!")
```

```typescript
async function main() {
  try {
    const agent = await buildAgent();
    await chatLoop(agent);
  } catch (err) {
    console.error("Failed to start agent:", err);
    process.exit(1);
  }
}

main();
```

### 9. Run the agent

When prompted, authenticate and authorise your agent with Turbot pipes, then start asking questions.
```bash
python llamaindex_agent.py
```

```typescript
npx ts-node llamaindex-agent.ts
```

## Complete Code

```python
import asyncio
import os
import signal
import dotenv

from composio import Composio
from composio_llamaindex import LlamaIndexProvider
from llama_index.core.agent.workflow import ReActAgent
from llama_index.core.workflow import Context
from llama_index.llms.openai import OpenAI
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec

dotenv.load_dotenv()

OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
COMPOSIO_API_KEY = os.getenv("COMPOSIO_API_KEY")
COMPOSIO_USER_ID = os.getenv("COMPOSIO_USER_ID")

if not OPENAI_API_KEY:
    raise ValueError("OPENAI_API_KEY is not set")
if not COMPOSIO_API_KEY:
    raise ValueError("COMPOSIO_API_KEY is not set")
if not COMPOSIO_USER_ID:
    raise ValueError("COMPOSIO_USER_ID is not set")

async def build_agent() -> ReActAgent:
    composio_client = Composio(
        api_key=COMPOSIO_API_KEY,
        provider=LlamaIndexProvider(),
    )

    session = composio_client.create(
        user_id=COMPOSIO_USER_ID,
        toolkits=["turbot_pipes"],
    )

    mcp_url = session.mcp.url
    print(f"Composio MCP URL: {mcp_url}")

    mcp_client = BasicMCPClient(mcp_url, headers={"x-api-key": COMPOSIO_API_KEY})
    mcp_tool_spec = McpToolSpec(client=mcp_client)
    tools = await mcp_tool_spec.to_tool_list_async()

    llm = OpenAI(model="gpt-5")
    description = "An agent that uses Composio Tool Router MCP tools to perform Turbot pipes actions."
    system_prompt = """
    You are a helpful assistant connected to Composio Tool Router.
    Use the available tools to answer user queries and perform Turbot pipes actions.
    """
    return ReActAgent(
        tools=tools,
        llm=llm,
        description=description,
        system_prompt=system_prompt,
        verbose=True,
    );

async def chat_loop(agent: ReActAgent) -> None:
    ctx = Context(agent)
    print("Type 'quit', 'exit', or Ctrl+C to stop.")

    while True:
        try:
            user_input = input("\nYou: ").strip()
        except (KeyboardInterrupt, EOFError):
            print("\nBye!")
            break

        if not user_input or user_input.lower() in {"quit", "exit"}:
            print("Bye!")
            break

        try:
            print("Agent: ", end="", flush=True)
            handler = agent.run(user_input, ctx=ctx)

            async for event in handler.stream_events():
                # Stream token-by-token from LLM responses
                if hasattr(event, "delta") and event.delta:
                    print(event.delta, end="", flush=True)
                # Show tool calls as they happen
                elif hasattr(event, "tool_name"):
                    print(f"\n[Using tool: {event.tool_name}]", flush=True)

            # Get final response
            response = await handler
            print()  # Newline after streaming
        except KeyboardInterrupt:
            print("\n[Interrupted]")
            continue
        except Exception as e:
            print(f"\nError: {e}")

async def main() -> None:
    agent = await build_agent()
    await chat_loop(agent)

if __name__ == "__main__":
    # Handle Ctrl+C gracefully
    signal.signal(signal.SIGINT, lambda s, f: (print("\nBye!"), exit(0)))
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        print("\nBye!")
```

```typescript
import "dotenv/config";
import readline from "node:readline/promises";
import { stdin as input, stdout as output } from "node:process";

import { Composio } from "@composio/core";
import { LlamaindexProvider } from "@composio/llamaindex";

import { mcp } from "@llamaindex/tools";
import { agent as createAgent } from "@llamaindex/workflow";
import { openai } from "@llamaindex/openai";

dotenv.config();

const OPENAI_API_KEY = process.env.OPENAI_API_KEY;
const COMPOSIO_API_KEY = process.env.COMPOSIO_API_KEY;
const COMPOSIO_USER_ID = process.env.COMPOSIO_USER_ID;

if (!OPENAI_API_KEY) {
    throw new Error("OPENAI_API_KEY is not set in the environment");
  }
if (!COMPOSIO_API_KEY) {
    throw new Error("COMPOSIO_API_KEY is not set in the environment");
  }
if (!COMPOSIO_USER_ID) {
    throw new Error("COMPOSIO_USER_ID is not set in the environment");
  }

async function buildAgent() {

  console.log(`Initializing Composio client...${COMPOSIO_USER_ID!}...`);
  console.log(`COMPOSIO_USER_ID: ${COMPOSIO_USER_ID!}...`);

  const composio = new Composio({
    apiKey: COMPOSIO_API_KEY,
    provider: new LlamaindexProvider(),
  });

  const session = await composio.create(
    COMPOSIO_USER_ID!,
    {
      toolkits: ["turbot_pipes"],
    },
  );

  const mcpUrl = session.mcp.url;
  console.log(`Composio Tool Router MCP URL: ${mcpUrl}`);

  const server = mcp({
    url: mcpUrl,
    clientName: "composio_tool_router_with_llamaindex",
    requestInit: {
      headers: {
        "x-api-key": COMPOSIO_API_KEY!,
      },
    },
    // verbose: true,
  });

  const tools = await server.tools();

  const llm = openai({ apiKey: OPENAI_API_KEY, model: "gpt-5" });

  const agent = createAgent({
    name: "composio_tool_router_with_llamaindex",
    description:
      "An agent that uses Composio Tool Router MCP tools to perform actions.",
    systemPrompt:
      "You are a helpful assistant connected to Composio Tool Router."+
"Use the available tools to answer user queries and perform Turbot pipes actions." ,
    llm,
    tools,
  });

  return agent;
}

async function chatLoop(agent: ReturnType<typeof createAgent>) {
  const rl = readline.createInterface({ input, output });

  console.log("Type 'quit' or 'exit' to stop.");

  while (true) {
    let userInput: string;

    try {
      userInput = (await rl.question("\nYou: ")).trim();
    } catch {
      console.log("\nAgent: Bye!");
      break;
    }

    if (!userInput) {
      continue;
    }

    const lower = userInput.toLowerCase();
    if (lower === "quit" || lower === "exit") {
      console.log("Agent: Bye!");
      break;
    }

    try {
      process.stdout.write("Agent: ");

      const stream = agent.runStream(userInput);
      let finalResult: any = null;

      for await (const event of stream) {
        // The event.data contains the streamed content
        const data: any = event.data;

        // Check for streaming delta content
        if (data?.delta) {
          process.stdout.write(data.delta);
        }

        // Store final result for fallback
        if (data?.result || data?.message) {
          finalResult = data;
        }
      }

      // If no streaming happened, show the final result
      if (finalResult) {
        const answer =
          finalResult.result ??
          finalResult.message?.content ??
          finalResult.message ??
          "";
        if (answer && typeof answer === "string" && !answer.includes("[object")) {
          process.stdout.write(answer);
        }
      }

      console.log(); // New line after streaming completes
    } catch (err: any) {
      console.error("\nAgent error:", err?.message ?? err);
    }
  }

  rl.close();
}

async function main() {
  try {
    const agent = await buildAgent();
    await chatLoop(agent);
  } catch (err: any) {
    console.error("Failed to start agent:", err?.message ?? err);
    process.exit(1);
  }
}

main();
```

## Conclusion

You've successfully connected Turbot pipes to LlamaIndex through Composio's Tool Router MCP layer.
Key takeaways:
- Tool Router dynamically exposes Turbot pipes tools through an MCP endpoint
- LlamaIndex's ReActAgent handles reasoning and orchestration; Composio handles integrations
- The agent becomes more capable without increasing prompt size
- Async Python provides clean, efficient execution of agent workflows
You can easily extend this to other toolkits like Gmail, Notion, Stripe, GitHub, and more by adding them to the toolkits parameter.

## How to build Turbot pipes MCP Agent with another framework

- [OpenAI Agents SDK](https://composio.dev/toolkits/turbot_pipes/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/turbot_pipes/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/turbot_pipes/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/turbot_pipes/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/turbot_pipes/framework/codex)
- [OpenClaw](https://composio.dev/toolkits/turbot_pipes/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/turbot_pipes/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/turbot_pipes/framework/cli)
- [Google ADK](https://composio.dev/toolkits/turbot_pipes/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/turbot_pipes/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/turbot_pipes/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/turbot_pipes/framework/mastra-ai)
- [CrewAI](https://composio.dev/toolkits/turbot_pipes/framework/crew-ai)

## Related Toolkits

- [Supabase](https://composio.dev/toolkits/supabase) - Supabase is an open-source backend platform offering scalable Postgres databases, authentication, storage, and real-time APIs. It lets developers build modern apps without managing infrastructure.
- [Codeinterpreter](https://composio.dev/toolkits/codeinterpreter) - Codeinterpreter is a Python-based coding environment with built-in data analysis and visualization. It lets you instantly run scripts, plot results, and prototype solutions inside supported platforms.
- [GitHub](https://composio.dev/toolkits/github) - GitHub is a code hosting platform for version control and collaborative software development. It streamlines project management, code review, and team workflows in one place.
- [Ably](https://composio.dev/toolkits/ably) - Ably is a real-time messaging platform for live chat and data sync in modern apps. It offers global scale and rock-solid reliability for seamless, instant experiences.
- [Abuselpdb](https://composio.dev/toolkits/abuselpdb) - Abuselpdb is a central database for reporting and checking IPs linked to malicious online activity. Use it to quickly identify and report suspicious or abusive IP addresses.
- [Alchemy](https://composio.dev/toolkits/alchemy) - Alchemy is a blockchain development platform offering APIs and tools for Ethereum apps. It simplifies building and scaling Web3 projects with robust infrastructure.
- [Algolia](https://composio.dev/toolkits/algolia) - Algolia is a hosted search API that powers lightning-fast, relevant search experiences for web and mobile apps. It helps developers deliver instant, typo-tolerant, and scalable search without complex infrastructure.
- [Anchor browser](https://composio.dev/toolkits/anchor_browser) - Anchor browser is a developer platform for AI-powered web automation. It transforms complex browser actions into easy API endpoints for streamlined web interaction.
- [Apiflash](https://composio.dev/toolkits/apiflash) - Apiflash is a website screenshot API for programmatically capturing web pages. It delivers high-quality screenshots on demand for automation, monitoring, or reporting.
- [Apiverve](https://composio.dev/toolkits/apiverve) - Apiverve delivers a suite of powerful APIs that simplify integration for developers. It's designed for reliability and scalability so you can build faster, smarter applications without the integration headache.
- [Appcircle](https://composio.dev/toolkits/appcircle) - Appcircle is an enterprise-grade mobile CI/CD platform for building, testing, and publishing mobile apps. It streamlines mobile DevOps so teams ship faster and with more confidence.
- [Appdrag](https://composio.dev/toolkits/appdrag) - Appdrag is a cloud platform for building websites, APIs, and databases with drag-and-drop tools and code editing. It accelerates development and iteration by combining hosting, database management, and low-code features in one place.
- [Appveyor](https://composio.dev/toolkits/appveyor) - AppVeyor is a cloud-based continuous integration service for building, testing, and deploying applications. It helps developers automate and streamline their software delivery pipelines.
- [Backendless](https://composio.dev/toolkits/backendless) - Backendless is a backend-as-a-service platform for mobile and web apps, offering database, file storage, user authentication, and APIs. It helps developers ship scalable applications faster without managing server infrastructure.
- [Baserow](https://composio.dev/toolkits/baserow) - Baserow is an open-source no-code database platform for building collaborative data apps. It makes it easy for teams to organize data and automate workflows without writing code.
- [Bench](https://composio.dev/toolkits/bench) - Bench is a benchmarking tool for automated performance measurement and analysis. It helps you quickly evaluate, compare, and track your systems or workflows.
- [Better stack](https://composio.dev/toolkits/better_stack) - Better Stack is a monitoring, logging, and incident management solution for apps and services. It helps teams ensure application reliability and performance with real-time insights.
- [Bitbucket](https://composio.dev/toolkits/bitbucket) - Bitbucket is a Git-based code hosting and collaboration platform for teams. It enables secure repository management and streamlined code reviews.
- [Blazemeter](https://composio.dev/toolkits/blazemeter) - Blazemeter is a continuous testing platform for web and mobile app performance. It empowers teams to automate and analyze large-scale tests with ease.
- [Blocknative](https://composio.dev/toolkits/blocknative) - Blocknative delivers real-time mempool monitoring and transaction management for public blockchains. Instantly track pending transactions and optimize blockchain interactions with live data.

## Frequently Asked Questions

### What are the differences in Tool Router MCP and Turbot pipes MCP?

With a standalone Turbot pipes MCP server, the agents and LLMs can only access a fixed set of Turbot pipes tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Turbot pipes and many other apps based on the task at hand, all through a single MCP endpoint.

### Can I use Tool Router MCP with LlamaIndex?

Yes, you can. LlamaIndex fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Turbot pipes tools.

### Can I manage the permissions and scopes for Turbot pipes while using Tool Router?

Yes, absolutely. You can configure which Turbot pipes scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

### How safe is my data with Composio Tool Router?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Turbot pipes data and credentials are handled as safely as possible.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
