How to integrate Turbot pipes MCP with Claude Agent SDK

This guide walks you through connecting Turbot pipes to the Claude Agent SDK 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 Claude Agent SDK 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.

Turbot pipes logoTurbot pipes
Api Key

Turbot Pipes is an intelligence, automation, and security platform for DevOps, delivering hosted Steampipe databases, dashboards, and powerful snapshots. It's built to simplify infrastructure visibility, automate security checks, and speed up compliance workflows.

169 Tools

Introduction

This guide walks you through connecting Turbot pipes to the Claude Agent SDK 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 Claude Agent SDK 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

TL;DR

Here's what you'll learn:
  • Get and set up your Claude/Anthropic and Composio API keys
  • Install the necessary dependencies
  • Initialize Composio and create a Tool Router session for Turbot pipes
  • Configure an AI agent that can use Turbot pipes as a tool
  • Run a live chat session where you can ask the agent to perform Turbot pipes operations

What is Claude Agent SDK?

The Claude Agent SDK is Anthropic's official framework for building AI agents powered by Claude. It provides a streamlined interface for creating agents with MCP tool support and conversation management.

Key features include:

  • Native MCP Support: Built-in support for Model Context Protocol servers
  • Permission Modes: Control tool execution permissions
  • Streaming Responses: Real-time response streaming for interactive applications
  • Context Manager: Clean async context management for sessions

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.

What is the Composio tool router, and how does it fit here?

What is Composio SDK?

Composio's Composio SDK helps agents find the right tools for a task at runtime. You can plug in multiple toolkits (like Gmail, HubSpot, and GitHub), and the agent will identify the relevant app and action to complete multi-step workflows. This can reduce token usage and improve the reliability of tool calls. Read more here: Getting started with Composio SDK

The tool router generates a secure MCP URL that your agents can access to perform actions.

How the Composio SDK works

The Composio SDK follows a three-phase workflow:

  1. Discovery: Searches for tools matching your task and returns relevant toolkits with their details.
  2. Authentication: Checks for active connections. If missing, creates an auth config and returns a connection URL via Auth Link.
  3. Execution: Executes the action using the authenticated connection.

Step-by-step Guide

Step by step09 STEPS
1

Prerequisites

Before starting, make sure you have:
  • Composio API Key and Claude/Anthropic API Key
  • Primary know-how of Claude Agents SDK
  • A Turbot pipes account
  • Some knowledge of Python
2

Getting API Keys for Claude/Anthropic and Composio

Claude/Anthropic API Key
  • Go to the Anthropic Console and create an API key. You'll need credits to use the models.
  • Keep the API key safe.
Composio API Key
  • Log in to the Composio dashboard.
  • Navigate to your API settings and generate a new API key.
  • Store this key securely as you'll need it for authentication.
3

Install dependencies

npm install @anthropic-ai/claude-agent-sdk @composio/core dotenv

Install the Composio SDK and the Claude Agents SDK.

What's happening:

  • @composio/core provides Composio integration for Anthropic
  • @anthropic-ai/claude-agent-sdk is the core agent framework
  • dotenv/config loads environment variables
4

Set up environment variables

bash
COMPOSIO_API_KEY=your_composio_api_key_here
USER_ID=your_user_id_here
ANTHROPIC_API_KEY=your_anthropic_api_key_here

Create a .env file in your project root.

What's happening:

  • COMPOSIO_API_KEY authenticates with Composio
  • USER_ID identifies the user for session management
  • ANTHROPIC_API_KEY authenticates with Anthropic/Claude
5

Import dependencies

import 'dotenv/config';
import readline from 'node:readline';
import { Composio } from '@composio/core';
import { query, type Options } from "@anthropic-ai/claude-agent-sdk";

dotenv.config();
What's happening:
  • We're importing all necessary libraries including the Claude Agent SDK and Composio
  • The dotenv.config() function loads environment variables from your .env file
  • This setup prepares the foundation for connecting Claude with Turbot pipes functionality
6

Create a Composio instance and Tool Router session

async function chat() {
  const { COMPOSIO_API_KEY, USER_ID } = process.env;
  if (!COMPOSIO_API_KEY || !USER_ID) {
    throw new Error('COMPOSIO_API_KEY and USER_ID required in .env');
  }

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

  // Create Tool Router session for Turbot pipes
  const session = await composio.create(USER_ID, {
    toolkits: ['turbot_pipes'],
  });
  const mcpUrl = session?.mcp.url;
What's happening:
  • The function checks for the required COMPOSIO_API_KEY environment variable
  • We're creating a Composio instance using our API key
  • The create method creates a Tool Router session for Turbot pipes
  • The returned url is the MCP server URL that your agent will use
7

Configure Claude Agent with MCP

const options: Options = {
  permissionMode: 'bypassPermissions',
  mcpServers: {
    composio: {
      type: 'http',
      url: mcpUrl,
      headers: { 'x-api-key': COMPOSIO_API_KEY }
    }
  },
  systemPrompt: 'You are a helpful assistant with access to Turbot pipes tools via Composio.',
  maxTurns: 10,
};
What's happening:
  • We're configuring the Claude Agent options with the MCP server URL
  • permissionMode: 'bypassPermissions' allows the agent to execute operations without asking for permission each time
  • The system prompt instructs the agent that it has access to Turbot pipes
  • maxTurns: 10 limits the conversation length to prevent excessive API usage
8

Create client and start chat loop

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: 'You: '
  });

  console.log('\nChat started. Type "exit" to quit.\n');

  let isProcessing = false;

  async function ask(prompt: string) {
    isProcessing = true;
    rl.pause();

    process.stdout.write('Claude is thinking...');
    const stream = query({ prompt, options });

    let firstChunk = true;
    for await (const msg of stream) {
      const content = (msg as any).message?.content || (msg as any).content;
      if (Array.isArray(content)) {
        for (const block of content) {
          if (block.type === 'text' && block.text) {
            if (firstChunk) {
              process.stdout.write('\r\x1b[K');
              process.stdout.write('Claude: ');
              firstChunk = false;
            }
            process.stdout.write(block.text);
          }
        }
      }
    }
    process.stdout.write('\n\n');

    isProcessing = false;
    rl.resume();
    rl.prompt();
  }

  rl.on('line', async (line) => {
    if (isProcessing) return;

    const input = line.trim();
    if (input === 'exit') {
      rl.close();
      process.exit(0);
    }
    if (input) await ask(input);
    else rl.prompt();
  });

  await ask('What can you help me with?');
}
What's happening:
  • The readline interface is created to handle user input and output
  • The query function is used to send the user's input to the agent
  • The chat loop continues until the user types 'exit' or 'quit'
9

Run the application

try {
  await chat();
} catch (error) {
  console.error(error);
  process.exit(1);
}
What's happening:
  • The chat function is the entry point for the application
  • The try-catch block is used to handle any errors that occur

Complete Code

Here's the complete code to get you started with Turbot pipes and Claude Agent SDK:

import 'dotenv/config';
import readline from 'node:readline';
import { Composio } from '@composio/core';
import { query, type Options } from "@anthropic-ai/claude-agent-sdk";

async function chat() {
  const { COMPOSIO_API_KEY, USER_ID } = process.env;
  if (!COMPOSIO_API_KEY || !USER_ID) {
    throw new Error('COMPOSIO_API_KEY and USER_ID required in .env');
  }

  const composio = new Composio({ apiKey: COMPOSIO_API_KEY });
  const session = await composio.create(USER_ID, {
    toolkits: ['turbot_pipes']
  });
  const mcp_url = session?.mcp.url;

  const options: Options = {
    permissionMode: 'bypassPermissions',
    mcpServers: {
      composio: {
        type: 'http',
        url: mcp_url,
        headers: { 'x-api-key': COMPOSIO_API_KEY }
      }
    },
    systemPrompt: 'You are a helpful assistant with access to Turbot pipes tools via Composio.',
    maxTurns: 10,
  };

  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: 'You: '
  });

  console.log('\nChat started. Type "exit" to quit.\n');

  let isProcessing = false;

  async function ask(prompt: string) {
    isProcessing = true;
    rl.pause();

    process.stdout.write('Claude is thinking...');
    const stream = query({ prompt, options });

    let firstChunk = true;
    for await (const msg of stream) {
      const content = (msg as any).message?.content || (msg as any).content;
      if (Array.isArray(content)) {
        for (const block of content) {
          if (block.type === 'text' && block.text) {
            if (firstChunk) {
              process.stdout.write('\r\x1b[K');
              process.stdout.write('Claude: ');
              firstChunk = false;
            }
            process.stdout.write(block.text);
          }
        }
      }
    }
    process.stdout.write('\n\n');

    isProcessing = false;
    rl.resume();
    rl.prompt();
  }

  rl.on('line', async (line) => {
    if (isProcessing) return;

    const input = line.trim();
    if (input === 'exit') {
      rl.close();
      process.exit(0);
    }
    if (input) await ask(input);
    else rl.prompt();
  });

  await ask('What can you help me with?');
}

try {
  await chat();
} catch (error) {
  console.error(error);
  process.exit(1);
}

Conclusion

You've successfully built a Claude Agent SDK agent that can interact with Turbot pipes through Composio's Tool Router.

Key features:

  • Native MCP support through Claude's agent framework
  • Streaming responses for real-time interaction
  • Permission bypass for smooth automated workflows
You can extend this by adding more toolkits, implementing custom business logic, or building a web interface around the agent.
TOOLS

Supported Tools

Every Turbot pipes action and event your agent gets out of the box.

Get Authenticated Actor

Tool to retrieve the authenticated actor.

List Actor Activity

Tool to list activities for the authenticated actor.

List actor connections

Tool to list connections associated with the authenticated actor.

List Actor Organizations

Tool to list organizations associated with the authenticated actor.

List Actor Workspaces

Tool to list workspaces for the authenticated actor.

Start login via Email

Tool to start login process by sending a confirmation code to a user's email.

Create User Signup

Tool to create a new user account via signup.

Create org connection

Tool to create a new connection for an organization.

Create Org Connection Folder

Tool to create a new connection folder for an organization.

Create Org Workspace Aggregator

Tool to create an aggregator for a workspace of an organization.

Create Org Workspace Connection

Tool to create a connection on an org workspace or associate an existing org connection to the workspace.

Create Org Workspace Connection Folder

Tool to create a connection folder in a workspace of an organization.

Create Org Workspace Query

Tool to execute a SQL query in an org workspace using POST method.

Create Org Workspace Snapshot

Tool to create a new workspace snapshot for an organization.

Create User AI Key

Tool to create a new AI provider API key at the user level.

Create User Connection

Tool to create a new connection for a user.

Create User Integration

Tool to create a new integration for a user.

Create User Notifier

Tool to create a new notifier for a user.

Create User Password

Tool to create or rotate a user password.

Create User Workspace Connection

Tool to create a connection on a workspace for a user.

Create User Workspace Connection Folder

Tool to create a connection folder in a workspace of a user.

Create User Workspace Datatank

Tool to create a new user workspace Datatank.

Create User Workspace Datatank Table

Tool to create a new user workspace datatank table.

Create User Workspace Mod Variable Setting

Tool to create a setting for a mod variable in a user workspace.

Create User Workspace Notifier

Tool to create a new notifier for a user workspace.

Delete Org Workspace Conversation

Tool to delete a specific org workspace conversation.

Delete Organization

Tool to delete a specified organization if you have appropriate access.

Delete Org Billing Subscription

Tool to delete an organization billing subscription.

Delete Org Connection Permission

Tool to delete permission for a connection defined on an org.

Delete Organization Workspace

Tool to delete an organization workspace.

Delete Org Workspace Mod Variable Setting

Tool to delete setting for a mod variable in an organization workspace.

Delete User Avatar

Tool to delete custom avatar for a user.

Delete User Integration

Tool to delete an integration configured for a user.

Delete User Workspace Mod Variable Setting

Tool to delete a mod variable setting in a user workspace.

Delete User Workspace Notifier

Tool to delete a notifier for a user workspace.

Delete User Workspace Pipeline

Tool to delete a pipeline from a user's workspace.

Get Auth Provider

Tool to initiate OAuth authentication flow with a provider.

Get User Workspace Conversation

Tool to retrieve details for a specific user workspace conversation.

Get Datatank Table

Tool to get the details for a workspace Datatank table.

Get Organization

Tool to retrieve organization information by handle.

Get Organization Billing Invoice

Tool to get an invoice for an organization.

Get Org Connection Permission

Tool to retrieve permission details for an org connection.

Get Organization Integration

Tool to get details of an integration configured on an organization.

Get Organization Member

Tool to retrieve a specific organization member by org handle and user handle.

Get Org Workspace Connection

Tool to get the details for a workspace and connection association on an organization.

Get Org Workspace Connection Folder

Tool to retrieve a connection folder for an organization workspace.

Get Org Workspace Flowpipe Trigger

Tool to get the details of a trigger for a workspace in an organization.

Get Org Workspace Integration

Tool to get details of an integration available for a workspace belonging to an organization.

Get Org Workspace Mod Variable Setting

Tool to get setting for a mod variable in an organization workspace.

Get Org Workspace Notifier

Tool to retrieve a notifier from an org workspace.

Get Org Workspace Query Data

Tool to execute a SQL query in an org workspace and retrieve results.

Get Tenant

Tool to retrieve tenant information by handle.

Get Tenant Avatar

Tool to retrieve public avatar image for a tenant.

Get User

Tool to retrieve user information by handle.

Get User AI Key

Tool to retrieve AI provider API key metadata at the user level.

Get User Billing Plan

Tool to get the current user billing plan.

Get User Billing Upcoming Invoice

Tool to get the upcoming invoice for a user.

Get User Connection

Tool to retrieve details of a connection belonging to a user.

Get User Email

Tool to retrieve a specific user email record with metadata.

Get User Integration

Tool to get details of an integration configured on a user.

Get User Database Password

Tool to retrieve user database password.

Get User Preferences

Tool to retrieve user preferences including email subscription settings.

Get User Process

Tool to retrieve process information for a user.

Get User Workspace

Tool to retrieve workspace details for a specific user.

Get User Workspace Aggregator

Tool to get the details of an aggregator belonging to a workspace of a user.

Get User Workspace Connection

Tool to get the details for a workspace and connection association for a user.

Get User Workspace Connection Folder

Tool to retrieve a connection folder for a user workspace.

Get User Workspace Datatank

Tool to retrieve user workspace datatank details.

Get User Workspace Flowpipe Mod

Tool to retrieve details of an installed flowpipe mod in a user workspace.

Get User Workspace Flowpipe Pipeline

Tool to retrieve pipeline details for a user workspace.

Get User Workspace Integration

Tool to get details of an integration available for a workspace belonging to a user.

Get User Workspace Mod

Tool to retrieve details of an installed mod in a user's workspace.

Get User Workspace Mod Variable Setting

Tool to get setting for a mod variable in a user workspace.

Get User Workspace Notifier

Tool to retrieve a notifier from a user workspace.

Get User Workspace Pipeline

Tool to get the details of a pipeline for a workspace of a user.

Get User Workspace Process

Tool to retrieve process details for a user workspace.

Get User Workspace Process Log

Tool to retrieve process logs for a user workspace process.

Get User Workspace Query

Tool to execute a SQL query in a user workspace and retrieve results.

Get User Workspace Query Data

Tool to execute a SQL query in a user workspace and retrieve results.

Get User Workspace Schema

Tool to retrieve workspace schema details for a specific user.

Get User Workspace Schema Table

Tool to get details about a specific table in a user workspace schema.

Get Identity

Tool to retrieve a specific identity by handle.

Get Identity Avatar

Tool to retrieve avatar image for an identity.

List Identities

Tool to list all identities.

Initiate User Login

Tool to initiate user login.

Install User Slack Integration

Tool to install a Slack integration for a user identity.

Install User Workspace Flowpipe Mod

Tool to install a flowpipe mod to a user's workspace.

Install User Workspace Mod

Tool to install a mod to a user workspace.

List Organization Processes

Tool to list processes for an organization.

List Organization Service Accounts

Tool to list service accounts at the organization level.

List Organization Usage

Tool to list all usage metrics for an organization.

List Org Workspace Datatank

Tool to list org workspace Datatank with pagination support.

List Organization Workspace Flowpipe Mod Variables

Tool to list all variables for a flowpipe mod in an organization workspace.

List Org Workspace Mods

Tool to list organization workspace installed mods with pagination support.

List Organization Workspace Pipelines

Tool to list pipelines for a workspace of an organization.

List Org Workspace Processes

Tool to list processes associated with an org workspace.

List Organization Workspaces

Tool to list workspaces for a specific organization.

Get Tenant Settings

Tool to retrieve tenant settings.

List Tenants

Tool to list tenants the actor is a member of.

List User AI Keys

Tool to list AI provider API keys configured at the user level.

List User Audit Logs

Tool to list audit logs for a specific user.

List User Billing Invoices

Tool to list user invoices with pagination support.

List User Billing Payment Methods

Tool to list user billing payment methods.

List User Billing Subscriptions

Tool to list user billing subscriptions.

List User Connections

Tool to list connections for a specific user by user handle.

List User Constraints

Tool to list all applicable constraints for a user.

List User Emails

Tool to list emails for a user along with metadata information for each item.

List User Integrations

Tool to list integrations configured for a user.

List User Processes

Tool to list processes for a user.

List User Usage

Tool to list all usage metrics for a user.

List User Workspace Aggregators

Tool to list aggregators for a workspace of a user.

List User Workspace Aggregator Connections

Tool to list all connections that are part of an aggregator in a user workspace.

List User Workspace Audit Logs

Tool to list audit logs for a specific user workspace.

List User Workspace Connections

Tool to list connections explicitly defined or associated to a workspace.

List User Workspace Connection Associations

Tool to list connections associated with a workspace for a specific user.

List User Workspace Connection Folders

Tool to list connection folders for a user workspace.

List User Workspace Connection Tree

Tool to list connection tree for a user workspace.

List User Workspace Conversations

Tool to list AI conversations in a user workspace with optional filtering and pagination.

List User Workspace Datatank

Tool to list user workspace Datatank with pagination support.

List User Workspace Datatank Partitions

Tool to list user workspace Datatank partitions with pagination support.

List User Workspace Datatank Table

Tool to list user workspace Datatank tables with pagination support.

List User Workspace Database Logs

Tool to list database query logs for a specific user workspace.

List User Workspace Flowpipe Inputs

Tool to list Flowpipe inputs for a user workspace.

List User Workspace Flowpipe Mod Variables

Tool to list all variables for a flowpipe mod in a user workspace.

List User Workspace Flowpipe Pipelines

Tool to list Flowpipe pipelines for a user workspace.

List User Workspace Pipeline Triggers

Tool to list Flowpipe triggers associated with a specific pipeline in a user workspace.

List User Workspace Flowpipe Triggers

Tool to list Flowpipe triggers for a user workspace.

List User Workspace Integrations

Tool to list integrations available for a user workspace.

List User Workspace Mods

Tool to list user workspace installed mods with pagination support.

List User Workspace Mod Variables

Tool to list all variables applicable for a mod in a workspace specific to a user.

List User Workspace Notifiers

Tool to list all notifiers for a user workspace.

List User Workspace Pipelines

Tool to list pipelines for a workspace of a user.

List User Workspace Processes

Tool to list processes associated with a user workspace.

List User Workspaces

Tool to list workspaces for a specific user.

List User Workspace Schemas

Tool to list schemas for a user workspace.

List User Workspace Schema Tables

Tool to list tables for a user workspace schema with pagination support.

List User Workspace Snapshots

Tool to list workspace snapshots for a user.

List User Workspace Usage

Tool to list the usage associated with a user workspace.

Post User Workspace Notifier Command

Tool to post a command for a notifier in a user's workspace.

Post User Workspace Query

Tool to perform a SQL query in a user workspace.

Run Organization Workspace Command

Tool to run a command in an organization workspace.

Run User Workspace Command

Tool to run a command in a user workspace.

Run User Workspace Flowpipe Pipeline Command

Tool to run a command on a Flowpipe pipeline in a user workspace.

Run User Workspace Flowpipe Trigger Command

Tool to run a command on a trigger in a workspace belonging to a user.

Run User Workspace Query

Tool to perform a SQL query in a user workspace using POST method.

Send Chat Message to User Workspace AI

Tool to send a chat message to the AI agent in a user workspace.

Test User AI Key

Tool to test whether an AI provider API key is valid at the user level.

Test User Connection

Tool to test a user connection for basic connectivity.

Test User Integration

Tool to test the config for a user integration to check for basic connectivity before you create it.

Test User Workspace Connection

Tool to test the config for a connection configured on a user workspace to check for basic connectivity.

Uninstall Flowpipe Mod

Tool to uninstall a flowpipe mod from a user's workspace.

Uninstall Org Workspace Flowpipe Mod

Tool to uninstall a flowpipe mod from an organization workspace.

Update User Workspace Conversation

Tool to update a user workspace conversation (e.

Update Org Billing Subscription

Tool to update an organization billing subscription.

Update Org Connection

Tool to update the details of a connection belonging to an organization.

Update Org Connection Folder

Tool to update the details of an org connection folder.

Update Organization Member Role

Tool to update the role of an organization member.

Update Organization Service Account

Tool to update an existing service account at the organization level.

Update Organization Service Account Token

Tool to update an existing token for an organization-level service account.

Update User

Tool to update user information including handle name, display name, or URL.

Update User AI Key

Tool to update an existing AI provider API key at the user level.

Update User Connection

Tool to update the details of a connection belonging to a user.

Update User Integration

Tool to update details of an integration configured for a user.

Update User Preferences

Tool to update user preferences for email communications.

Update User Token

Tool to update a user token's status between active and inactive.

Update User Workspace

Tool to update the workspace for a user.

List User Notifiers

Tool to list all notifiers for a user.

Delete User Token

Tool to delete a specific user token.

Get User Token

Tool to retrieve details of a specific user token.

FAQ

Frequently asked questions

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.

Yes, you can. Claude Agent SDK 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.

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.

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.

Start with Turbot pipes.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Turbot pipes tool your agent needs.Free to start.

Start building