# How to integrate Capsule crm MCP with Autogen

```json
{
  "title": "How to integrate Capsule crm MCP with Autogen",
  "toolkit": "Capsule crm",
  "toolkit_slug": "capsule_crm",
  "framework": "AutoGen",
  "framework_slug": "autogen",
  "url": "https://composio.dev/toolkits/capsule_crm/framework/autogen",
  "markdown_url": "https://composio.dev/toolkits/capsule_crm/framework/autogen.md",
  "updated_at": "2026-05-12T10:05:41.324Z"
}
```

## Introduction

This guide walks you through connecting Capsule crm to AutoGen using the Composio tool router. By the end, you'll have a working Capsule crm agent that can add new company and contact details, list all open tasks for today, show all projects started this month through natural language commands.
This guide will help you understand how to give your AutoGen agent real control over a Capsule crm account through Composio's Capsule crm MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Capsule crm with

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

## TL;DR

Here's what you'll learn:
- Get and set up your OpenAI and Composio API keys
- Install the required dependencies for Autogen and Composio
- Initialize Composio and create a Tool Router session for Capsule crm
- Wire that MCP URL into Autogen using McpWorkbench and StreamableHttpServerParams
- Configure an Autogen AssistantAgent that can call Capsule crm tools
- Run a live chat loop where you ask the agent to perform Capsule crm operations

## What is AutoGen?

Autogen is a framework for building multi-agent conversational AI systems from Microsoft. It enables you to create agents that can collaborate, use tools, and maintain complex workflows.
Key features include:
- Multi-Agent Systems: Build collaborative agent workflows
- MCP Workbench: Native support for Model Context Protocol tools
- Streaming HTTP: Connect to external services through streamable HTTP
- AssistantAgent: Pre-built agent class for tool-using assistants

## What is the Capsule crm MCP server, and what's possible with it?

The Capsule crm MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Capsule CRM account. It provides structured and secure access to your contacts, sales opportunities, tasks, and more, so your agent can perform actions like managing contacts, tracking projects, organizing tasks, and retrieving sales data on your behalf.
- Contact and party management: Effortlessly create new contacts or organizations, list all parties, and even delete records when needed—all through your agent.
- Sales opportunity tracking: Retrieve lists of deleted or restricted sales opportunities and keep your pipeline data up to date with minimal manual work.
- Task and activity organization: List, search, and manage your Capsule tasks, notes, and completed activities to stay on top of daily work.
- Project and case monitoring: Quickly fetch all ongoing or filtered projects (cases) and review their status or details without ever opening the web app.
- Team and user management: List all users on your Capsule account or pull employees for a specific organization, making team reporting and auditing a breeze.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `CAPSULE_CRM_ADD_PROJECT_PARTY` | Add Project Party | Tool to add a party (person or organisation) to a project in Capsule CRM. Use when you need to associate an additional contact with a specific project beyond the primary assigned party. |
| `CAPSULE_CRM_CREATE_CATEGORY` | Create Capsule CRM Category | Tool to create a new task category in Capsule CRM. Use when you need to add a new category for organizing tasks with a specific name and color. |
| `CAPSULE_CRM_CREATE_CUSTOM_FIELD_DEFINITION` | Create Custom Field Definition | Tool to create a new custom field definition for parties, opportunities, or projects in Capsule CRM. Use when you need to extend standard entity fields with custom attributes. |
| `CAPSULE_CRM_CREATE_ENTRY` | Create Entry | Tool to create a new note entry in Capsule CRM. Note: Only note type entries can be created via API. Emails and tasks can be viewed but not created through this endpoint. Use when you need to add a new note record linked to a party, opportunity, or project. |
| `CAPSULE_CRM_CREATE_LOST_REASON` | Create Lost Reason | Tool to create a new lost reason in Capsule CRM. Use when you need to add a new reason option for tracking why opportunities were lost. Lost reasons help categorize unsuccessful deals and can be included or excluded from conversion rate calculations. |
| `CAPSULE_CRM_CREATE_MILESTONE` | Create Capsule CRM Milestone | Tool to create a new milestone in Capsule CRM. Use when you need to add a new stage to a sales pipeline with defined probability and staleness criteria. |
| `CAPSULE_CRM_CREATE_OPPORTUNITY` | Create Opportunity | Tool to create a new opportunity in Capsule CRM. Use when you need to track a potential sale with a party in the sales pipeline. |
| `CAPSULE_CRM_CREATE_OPPORTUNITY_PARTY` | Add Party to Opportunity | Tool to add a party (person or organisation) to an opportunity in Capsule CRM. Use when you need to associate an additional party with an existing opportunity. |
| `CAPSULE_CRM_CREATE_PARTY` | Create Capsule CRM Party | Tool to create a Party in Capsule CRM. Use when you have collected a person's or organisation's details and need to add a new record. |
| `CAPSULE_CRM_CREATE_PROJECT` | Create Project | Tool to create a new project (case) in Capsule CRM. Use when you need to create a project associated with a party (person or organisation) to track work or engagements. |
| `CAPSULE_CRM_CREATE_STAGE` | Create Stage | Tool to create a new stage in a board in Capsule CRM. Use when you need to add a new workflow stage to an existing board with a specific display order. |
| `CAPSULE_CRM_CREATE_TASK` | Create Task | Tool to create a new task in Capsule CRM. Use when you need to add a task with a description and due date, optionally linking it to parties, opportunities, or projects. |
| `CAPSULE_CRM_CREATE_TITLE` | Create Capsule CRM Title | Tool to create a new custom person title in Capsule CRM. Use when you need to add a new title option (e.g., 'Madam', 'Sir', 'Dr') for person records. |
| `CAPSULE_CRM_CREATE_TRACK` | Create Track | Tool to create a new track in Capsule CRM by applying a track definition to a project or opportunity. Use when you need to apply a predefined sequence of tasks to a specific entity. |
| `CAPSULE_CRM_CREATE_TRACK_DEFINITION` | Create Track Definition | Tool to create a new track definition in Capsule CRM. Use when you need to define a reusable sequence of tasks for business processes that can be applied to opportunities or projects. |
| `CAPSULE_CRM_DELETE_BOARD` | Delete Board | Tool to delete (archive) a specific board in Capsule CRM. Use when you need to remove a board that is no longer needed. |
| `CAPSULE_CRM_DELETE_CATEGORY` | Delete Category | Tool to delete a category from Capsule CRM. Use when you need to remove a category that is no longer needed. |
| `CAPSULE_CRM_DELETE_CUSTOM_FIELD_DEFINITION` | Delete Custom Field Definition | Tool to delete a custom field definition from an entity type in Capsule CRM. This removes the field value from any parties, opportunities, or projects it was assigned to. Use when you need to permanently remove a custom field definition. |
| `CAPSULE_CRM_DELETE_ENTITY_TAG` | Delete Entity Tag | Tool to delete a tag from an entity type (parties, opportunities, or kases) in Capsule CRM. Use when you need to remove a specific tag from all entities of a given type. |
| `CAPSULE_CRM_DELETE_ENTRY` | Delete Entry | Tool to delete an entry (note, email, or task) from Capsule CRM. Use when you need to remove an entry by its ID. |
| `CAPSULE_CRM_DELETE_LOST_REASON` | Delete Lost Reason | Tool to delete a lost reason from Capsule CRM. The deleted reason remains available for historical reporting but cannot be assigned to new opportunities. |
| `CAPSULE_CRM_DELETE_MILESTONE` | Delete Milestone | Tool to delete a specific milestone from Capsule CRM. Use when you need to remove a milestone that is no longer needed. Note: Cannot delete a milestone while it is being used on an opportunity. |
| `CAPSULE_CRM_DELETE_OPPORTUNITY` | Delete Opportunity | Tool to delete an opportunity from Capsule CRM. The opportunity can be restored within 30 days via the web interface. Use when you need to remove an opportunity. |
| `CAPSULE_CRM_DELETE_OPPORTUNITY_PARTY` | Delete Opportunity Party | Tool to remove a party (person or organisation) from an opportunity in Capsule CRM. Use when you need to disassociate a contact from a specific opportunity. |
| `CAPSULE_CRM_DELETE_PARTY` | Delete Party | Tool to fully delete a specific party (person or organisation) from Capsule CRM. Use when you need to completely remove a party after confirming no active references remain. |
| `CAPSULE_CRM_DELETE_PROJECT` | Delete Project | Tool to delete a project (case) from Capsule CRM. The project can be restored within 30 days via the web interface. Use when you need to remove a project. |
| `CAPSULE_CRM_DELETE_PROJECT_PARTY` | Delete Project Party | Tool to remove a party (person or organisation) from a project in Capsule CRM. Use when you need to disassociate a contact from a specific project. |
| `CAPSULE_CRM_DELETE_STAGE` | Delete Stage | Tool to delete a specific stage from a board in Capsule CRM. Use when you need to remove a stage that is no longer needed. Note: Cannot delete a stage while it is being used by open projects. |
| `CAPSULE_CRM_DELETE_TASK` | Delete Task | Tool to delete a specific task from Capsule CRM. Use when you need to remove a task by its ID. |
| `CAPSULE_CRM_DELETE_TITLE` | Delete Title | Tool to delete a specific title from Capsule CRM. Use when you need to remove a title that is no longer needed. |
| `CAPSULE_CRM_DELETE_TRACK` | Delete Track | Tool to delete a specific track from Capsule CRM. Use when you need to remove a track that is no longer needed. |
| `CAPSULE_CRM_DELETE_TRACK_DEFINITION` | Delete Track Definition | Tool to delete a specific track definition from Capsule CRM. Use when you need to remove a track definition that is no longer needed. |
| `CAPSULE_CRM_GET_ACTIVITY_TYPE` | Get Activity Type | Tool to get a specific activity type by ID. Use when you need to retrieve details about a particular activity type including its name, icon, and whether it updates the last contacted date. |
| `CAPSULE_CRM_GET_ATTACHMENT` | Get Attachment | Tool to retrieve a specific attachment by ID from Capsule CRM. Returns the file content along with metadata (filename, content type). Use when you need to download an attachment that is associated with an entry (note, email, or completed task). |
| `CAPSULE_CRM_GET_BOARD` | Get Board | Tool to get a specific board by ID from Capsule CRM. Use when you need to retrieve details of a particular board including its name, description, and timestamps. |
| `CAPSULE_CRM_GET_CATEGORY` | Get Category | Tool to get a specific category by ID. Use when you need to retrieve details of a particular category including its name and colour. |
| `CAPSULE_CRM_GET_CURRENT_USER` | Get Current User | Tool to retrieve the current authenticated user's details including id, username, name, locale, currency, status, timezone, lastLoginAt, and taskReminder settings. Use when you need to identify the current user or access their preferences and settings. |
| `CAPSULE_CRM_GET_CUSTOM_FIELD_DEFINITION` | Get Custom Field Definition | Tool to get a specific custom field definition by ID from Capsule CRM. Use when you need to retrieve details about a custom field including its type, options, and configuration. |
| `CAPSULE_CRM_GET_ENTITY_TAG` | Get Entity Tag | Tool to retrieve a specific tag by ID for an entity type (parties, opportunities, or kases) in Capsule CRM. Use when you need details about a specific tag associated with an entity type. |
| `CAPSULE_CRM_GET_ENTRY` | Get Entry | Tool to retrieve a specific entry by ID. Use when you need to fetch details of a note, email, or task entry. |
| `CAPSULE_CRM_GET_LOST_REASON` | Get Lost Reason | Tool to retrieve a specific lost reason by ID from Capsule CRM. Use when you need details about a particular lost reason, such as its name or conversion tracking status. |
| `CAPSULE_CRM_GET_MILESTONE` | Get Milestone | Tool to get a specific milestone by ID from Capsule CRM. Use when you need to retrieve details of a particular milestone including its name, description, completion status, and probability. |
| `CAPSULE_CRM_GET_OPPORTUNITY` | Get Opportunity | Tool to retrieve a specific opportunity by its ID from Capsule CRM. Use when you need detailed information about a single opportunity including value, milestone, and associated parties. |
| `CAPSULE_CRM_GET_PIPELINE` | Get Pipeline | Tool to get a specific pipeline by ID from Capsule CRM. Use when you need to retrieve details of a particular pipeline including its name, description, and timestamps. |
| `CAPSULE_CRM_GET_PROJECT` | Get Project | Tool to retrieve a specific project (case) by its ID from Capsule CRM. Use when you need detailed information about a single project. |
| `CAPSULE_CRM_GET_STAGE` | Get Stage | Tool to get a specific stage by ID from Capsule CRM. Use when you need to retrieve details of a particular stage including its name, description, board, and display order. |
| `CAPSULE_CRM_GET_TASK` | Get Task | Tool to get a specific task by ID. Use when you need to retrieve full details of a task including description, due date, status, and associations. |
| `CAPSULE_CRM_GET_TRACK` | Get Track | Tool to get a specific track by ID. Use when you need to retrieve details of a track including its description, date, direction, and optionally its associated tasks. |
| `CAPSULE_CRM_GET_TRACK_DEFINITION` | Get Track Definition | Tool to get a specific track definition by ID from Capsule CRM. Use when you need to retrieve details of a track definition including its description, capture rule, direction, and associated task definitions. |
| `CAPSULE_CRM_GET_USER` | Get User | Tool to get a specific user by ID. Use when you need to retrieve full details of a user including username, email preferences, timezone settings, and optionally their associated party information. |
| `CAPSULE_CRM_LIST_ACTIVITY_TYPE_ICONS` | List Activity Type Icons | Tool to list available activity type icons in Capsule CRM. Use when you need to retrieve the set of icons available for categorizing activities or when creating/updating activity types. Returns system and custom icons with their identifiers, display names, and order. |
| `CAPSULE_CRM_LIST_ACTIVITY_TYPES` | List Activity Types | Tool to list all activity types on the Capsule account. Use when you need to retrieve available activity types for categorizing activities or understanding what activity classifications are available in the CRM. |
| `CAPSULE_CRM_LIST_BOARDS` | List Boards | Tool to list all boards on the Capsule CRM account. Use when you need to fetch all boards to view their names, descriptions, and metadata. |
| `CAPSULE_CRM_LIST_BOARD_STAGES` | List Board Stages | Tool to list stages associated with a board in Capsule CRM. Use when you need to retrieve all stages for a specific board with optional status filtering. |
| `CAPSULE_CRM_LIST_CATEGORIES` | List Categories | Tool to list all task categories on the Capsule account. Use when you need to retrieve available categories for tasks or filter tasks by category. |
| `CAPSULE_CRM_LIST_COUNTRIES` | List Countries | Tool to list all countries on the Capsule CRM account. Returns ISO country codes (alpha2, alpha3, numeric) and country names. Use when you need to reference valid country codes for addresses or other location-based data. |
| `CAPSULE_CRM_LIST_CURRENCIES` | List Currencies | Tool to list all available currencies on the Capsule account. Returns ISO 4217 currency codes with their symbols and names. Use when you need to display currency options or validate currency codes for opportunities. |
| `CAPSULE_CRM_LIST_CUSTOM_FIELD_DEFINITIONS` | List Custom Field Definitions | Tool to list all custom field definitions for parties, opportunities, or projects (kases). Use when you need to discover what custom fields are available for a specific entity type. |
| `CAPSULE_CRM_LIST_DELETED_OPPORTUNITIES` | List Deleted Opportunities | Tool to list opportunities deleted or restricted since a given date. Use when you need to identify recently deleted or restricted opportunities. |
| `CAPSULE_CRM_LIST_DELETED_PARTIES` | List deleted parties | Tool to retrieve parties deleted since a given date. Use when you need to sync deletions. |
| `CAPSULE_CRM_LIST_DELETED_PROJECTS` | List Deleted Projects | Tool to list projects deleted or restricted since a given date. Use when you need to identify recently deleted or restricted projects. |
| `CAPSULE_CRM_LIST_ENTITY_ENTRIES` | List Entity Entries | Tool to list entries (notes, emails, tasks) for a specific party, opportunity, or project. Use when you need to retrieve all activity entries associated with an entity. |
| `CAPSULE_CRM_LIST_ENTITY_TAGS` | List Entity Tags | Tool to list all tag definitions for a specific entity type (parties, opportunities, or kases). Use when you need to retrieve available tags that can be applied to entities. |
| `CAPSULE_CRM_LIST_ENTITY_TRACKS` | List Entity Tracks | Tool to list tracks applied to a specific opportunity or project. Use when you need to retrieve all tracks associated with an entity, optionally including their tasks. |
| `CAPSULE_CRM_LIST_ENTRIES_BY_DATE` | List Entries By Date | Tool to list notes, emails, and completed party tasks in descending order by entry date. Use when you need the most recent entries first after authenticating. |
| `CAPSULE_CRM_LIST_GOALS` | List Goals | Tool to list all goals on the Capsule account. Use when you need to retrieve goals with pagination support. |
| `CAPSULE_CRM_LIST_LOST_REASONS` | List Lost Reasons | Tool to list all lost reasons on the Capsule account. Use when you need to retrieve available reasons for marking opportunities as lost. |
| `CAPSULE_CRM_LIST_MILESTONES` | List Milestones | Tool to list all milestones on the Capsule account. Use when you need to retrieve available milestones for pipelines or opportunities. |
| `CAPSULE_CRM_LIST_OPPORTUNITIES` | List Opportunities | Tool to list all opportunities from Capsule CRM with pagination and filtering. Use when you need to retrieve sales opportunities with optional filters for date changes or embed additional data like tags, custom fields, party details, or milestones. |
| `CAPSULE_CRM_LIST_OPPORTUNITY_PARTIES` | List Opportunity Parties | Tool to list additional parties associated with an opportunity in Capsule CRM. Use when you need to retrieve contacts related to a specific opportunity. |
| `CAPSULE_CRM_LIST_OPPORTUNITY_PROJECTS` | List Opportunity Projects | Tool to list projects (cases) associated with a specific opportunity in Capsule CRM. Use when you need to retrieve all projects linked to an opportunity. |
| `CAPSULE_CRM_LIST_ORG_EMPLOYEES` | List Organisation Employees | Tool to list employees linked to a specific organisation (party). Use when you need to retrieve all employees under a given organisation. |
| `CAPSULE_CRM_LIST_PARTIES` | List Parties | Tool to list all parties (contacts) on the account. Use when you need to fetch contacts with optional filters or embed additional related data. |
| `CAPSULE_CRM_LIST_PARTY_OPPORTUNITIES` | List Party Opportunities | Tool to list all opportunities associated with a specific party in Capsule CRM. Use when you need to view all sales opportunities for a particular contact or organisation. |
| `CAPSULE_CRM_LIST_PARTY_PROJECTS` | List Party Projects | Tool to list projects associated with a specific party in Capsule CRM. Use when you need to retrieve all projects linked to a contact or organisation. |
| `CAPSULE_CRM_LIST_PIPELINE_MILESTONES` | List Pipeline Milestones | Tool to list milestones associated with a specific pipeline in Capsule CRM. Use when you need to retrieve all milestones for a pipeline to view their names, completion status, and probability. |
| `CAPSULE_CRM_LIST_PIPELINES` | List Pipelines | Tool to list all sales pipelines on the Capsule account. Pipelines contain milestones that track opportunity progress. Use when you need to retrieve available pipelines for opportunity management or to reference pipeline IDs. |
| `CAPSULE_CRM_LIST_PROJECT_PARTIES` | List Project Parties | Tool to list parties associated with a specific project in Capsule CRM. Use when you need to retrieve all contacts linked to a project with optional filters and embedded data. |
| `CAPSULE_CRM_LIST_PROJECTS` | List Projects | List projects (cases) from Capsule CRM with pagination and filtering options. Projects (called 'kases' in the API) are used to track work or engagements related to parties. Supports filtering by status, search terms, date modified, and embedding additional data like tags, custom fields, party details, and opportunities. |
| `CAPSULE_CRM_LIST_REST_HOOKS` | List REST Hooks | Tool to list all REST hook subscriptions on the Capsule CRM account. REST hooks are webhook subscriptions that notify your application of events like party/opportunity/project created/updated/deleted. Use when you need to view existing webhook configurations or audit active subscriptions. |
| `CAPSULE_CRM_LIST_SITE` | List Site | Tool to retrieve site (account) information for the authenticated Capsule CRM account. Returns the site URL, subdomain, and organization name. Use this when you need to identify which Capsule account is being accessed or retrieve basic account details. |
| `CAPSULE_CRM_LIST_STAGES` | List Stages | Tool to list all stages on the Capsule CRM account. Use when you need to retrieve stages across all boards with optional status filtering and pagination. |
| `CAPSULE_CRM_LIST_TASKS` | List Tasks | Tool to list tasks on the Capsule account. Use when you need to retrieve tasks with filters or embedded related data. |
| `CAPSULE_CRM_LIST_TEAMS` | List Teams | Tool to list all teams on the Capsule CRM account. Returns team details including id, name, createdAt, and updatedAt timestamps. Optionally embed team membership information using the embed parameter. |
| `CAPSULE_CRM_LIST_TITLES` | List Titles | Tool to list all custom person titles on the Capsule account. Returns title IDs and text values. Use when you need to retrieve available title options for person records or reference title IDs for other operations. |
| `CAPSULE_CRM_LIST_TRACK_DEFINITIONS` | List Track Definitions | Tool to list all track definitions on the Capsule account. Use when you need to retrieve track templates that define sequences of tasks for opportunities or projects. |
| `CAPSULE_CRM_LIST_USERS` | List Users | List all users on the Capsule CRM account. Returns user details including id, username, name, locale, currency, status, timezone, lastLoginAt, and taskReminder settings. Optionally embed full party details (addresses, phone numbers, emails) using the embed parameter. Use this for user management, auditing, or when you need to reference user IDs for other operations. |
| `CAPSULE_CRM_RESTORE_BOARD` | Restore Board | Tool to restore a deleted board in Capsule CRM. Use when you need to recover a previously deleted board. Requires Administrator role. |
| `CAPSULE_CRM_RUN_FILTER_QUERY` | Run Filter Query | Tool to run structured filter queries on parties, opportunities or kases. Use when you need to retrieve entities matching specific filter conditions. |
| `CAPSULE_CRM_SEARCH_OPPORTUNITIES` | Search Opportunities | Tool to search for opportunities in Capsule CRM by query string. Use when you need to find specific opportunities by searching their names or descriptions. |
| `CAPSULE_CRM_SEARCH_PARTIES` | Search Parties | Tool to search for parties (contacts/organisations) in Capsule CRM by query string. Use when you need to find specific parties by searching their names, contact info, or tags. |
| `CAPSULE_CRM_SEARCH_PROJECTS` | Search Projects | Tool to search for projects (cases) in Capsule CRM by query string. Use when you need to find specific projects by searching their names or descriptions. |
| `CAPSULE_CRM_UPDATE_BOARD` | Update Capsule CRM Board | Tool to update an existing board in Capsule CRM. Use when you need to modify the name or description of a board. Requires Administrator role on the Capsule account. |
| `CAPSULE_CRM_UPDATE_CATEGORY` | Update Capsule CRM Category | Tool to update an existing category in Capsule CRM. Use when you need to modify the name or color of a category. |
| `CAPSULE_CRM_UPDATE_CUSTOM_FIELD_DEFINITION` | Update Custom Field Definition | Tool to update an existing custom field definition in Capsule CRM. Use when you need to modify the name or data tag association of a custom field for parties, opportunities, or projects. |
| `CAPSULE_CRM_UPDATE_ENTITY_TAG` | Update Entity Tag | Tool to update an existing tag for an entity type (parties, opportunities, or kases) in Capsule CRM. Use when you need to modify the name of a tag. |
| `CAPSULE_CRM_UPDATE_ENTRY` | Update Entry | Tool to update an existing entry (note, email, or task) in Capsule CRM. Use when you need to modify the content of an entry or manage its attachments. |
| `CAPSULE_CRM_UPDATE_LOST_REASON` | Update Capsule CRM Lost Reason | Tool to update an existing lost reason in Capsule CRM. Use when you need to modify the name or conversion tracking setting of a lost reason after confirming its ID. |
| `CAPSULE_CRM_UPDATE_MILESTONE` | Update Capsule CRM Milestone | Tool to update an existing milestone in Capsule CRM. Use when you need to modify the name, description, or probability of a milestone stage in the sales pipeline. |
| `CAPSULE_CRM_UPDATE_OPPORTUNITY` | Update Opportunity | Tool to update an existing opportunity in Capsule CRM. Use when you need to modify details such as name, value, milestone, probability, or custom fields after confirming the opportunity ID. |
| `CAPSULE_CRM_UPDATE_PARTY` | Update Capsule CRM Party | Tool to update an existing person or organisation (Party) in Capsule CRM. Use when you need to modify specific fields of a party after confirming its ID. Example: "Update party 11587 to remove phone number 12136 and add a new work email." |
| `CAPSULE_CRM_UPDATE_PIPELINE` | Update Capsule CRM Pipeline | Tool to update an existing pipeline in Capsule CRM. Use when you need to modify the name or description of a pipeline. |
| `CAPSULE_CRM_UPDATE_PROJECT` | Update Project | Tool to update an existing project (case) in Capsule CRM. Use when you need to modify project details such as name, description, status, or custom fields after confirming the project ID. |
| `CAPSULE_CRM_UPDATE_STAGE` | Update Capsule CRM Stage | Tool to update an existing stage in Capsule CRM. Use when you need to modify the name, description, or display order of a stage within a board. Requires Administrator role on the Capsule account. |
| `CAPSULE_CRM_UPDATE_TASK` | Update Task | Tool to update an existing task in Capsule CRM. Use when you need to modify task details, change status to completed, or update due dates. |
| `CAPSULE_CRM_UPDATE_TRACK` | Update Capsule CRM Track | Tool to update an existing track in Capsule CRM. Use when you need to modify the description or trackDateOn of a track instance. Only description and trackDateOn can be modified. |
| `CAPSULE_CRM_UPDATE_TRACK_DEFINITION` | Update Capsule CRM Track Definition | Tool to update an existing track definition in Capsule CRM. Use when you need to modify the description or manage task definitions within a track. |
| `CAPSULE_CRM_UPDATE_USER` | Update User | Tool to update an existing user in Capsule CRM. Use when you need to modify user preferences such as task reminders, locale, currency, timezone, or email settings. |
| `CAPSULE_CRM_UPLOAD_ATTACHMENT` | Upload Attachment | Tool to upload an attachment to Capsule CRM. Returns a token that can be used to associate the attachment with entries when creating or updating them. Maximum file size is 25MB. |

## Supported Triggers

None listed.

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

The Capsule crm MCP server is an implementation of the Model Context Protocol that connects your AI agents and assistants directly to Capsule crm. Instead of manually wiring Capsule crm APIs, OAuth, and scopes yourself, you get a structured, tool-based interface that an LLM can call safely.
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

You will need:
- A Composio API key
- An OpenAI API key (used by Autogen's OpenAIChatCompletionClient)
- A Capsule crm account you can connect to Composio
- Some basic familiarity with Autogen and Python async

### 1. Getting API Keys for OpenAI and Composio

OpenAI API Key
- Go to the [OpenAI dashboard](https://platform.openai.com/settings/organization/api-keys) and create an API key. You'll need credits to use the models, or you can connect to another model provider.
- Keep the API key safe.
Composio API Key
- Log in to the [Composio dashboard](https://dashboard.composio.dev?utm_source=toolkits&utm_medium=framework_docs).
- Navigate to your API settings and generate a new API key.
- Store this key securely as you'll need it for authentication.

### 2. Install dependencies

Install Composio, Autogen extensions, and dotenv.
What's happening:
- composio connects your agent to Capsule crm via MCP
- autogen-agentchat provides the AssistantAgent class
- autogen-ext-openai provides the OpenAI model client
- autogen-ext-tools provides MCP workbench support
```bash
pip install composio python-dotenv
pip install autogen-agentchat autogen-ext-openai autogen-ext-tools
```

### 3. Set up environment variables

Create a .env file in your project folder.
What's happening:
- COMPOSIO_API_KEY is required to talk to Composio
- OPENAI_API_KEY is used by Autogen's OpenAI client
- USER_ID is how Composio identifies which user's Capsule crm connections to use
```bash
COMPOSIO_API_KEY=your-composio-api-key
OPENAI_API_KEY=your-openai-api-key
USER_ID=your-user-identifier@example.com
```

### 4. Import dependencies and create Tool Router session

What's happening:
- load_dotenv() reads your .env file
- Composio(api_key=...) initializes the SDK
- create(...) creates a Tool Router session that exposes Capsule crm tools
- session.mcp.url is the MCP endpoint that Autogen will connect to
```python
import asyncio
import os
from dotenv import load_dotenv
from composio import Composio

from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_ext.tools.mcp import McpWorkbench, StreamableHttpServerParams

load_dotenv()

async def main():
    # Initialize Composio and create a Capsule crm session
    composio = Composio(api_key=os.getenv("COMPOSIO_API_KEY"))
    session = composio.create(
        user_id=os.getenv("USER_ID"),
        toolkits=["capsule_crm"]
    )
    url = session.mcp.url
```

### 5. Configure MCP parameters for Autogen

Autogen expects parameters describing how to talk to the MCP server. That is what StreamableHttpServerParams is for.
What's happening:
- url points to the Tool Router MCP endpoint from Composio
- timeout is the HTTP timeout for requests
- sse_read_timeout controls how long to wait when streaming responses
- terminate_on_close=True cleans up the MCP server process when the workbench is closed
```python
# Configure MCP server parameters for Streamable HTTP
server_params = StreamableHttpServerParams(
    url=url,
    timeout=30.0,
    sse_read_timeout=300.0,
    terminate_on_close=True,
    headers={"x-api-key": os.getenv("COMPOSIO_API_KEY")}
)
```

### 6. Create the model client and agent

What's happening:
- OpenAIChatCompletionClient wraps the OpenAI model for Autogen
- McpWorkbench connects the agent to the MCP tools
- AssistantAgent is configured with the Capsule crm tools from the workbench
```python
# Create model client
model_client = OpenAIChatCompletionClient(
    model="gpt-5",
    api_key=os.getenv("OPENAI_API_KEY")
)

# Use McpWorkbench as context manager
async with McpWorkbench(server_params) as workbench:
    # Create Capsule crm assistant agent with MCP tools
    agent = AssistantAgent(
        name="capsule_crm_assistant",
        description="An AI assistant that helps with Capsule crm operations.",
        model_client=model_client,
        workbench=workbench,
        model_client_stream=True,
        max_tool_iterations=10
    )
```

### 7. Run the interactive chat loop

What's happening:
- The script prompts you in a loop with You:
- Autogen passes your input to the model, which decides which Capsule crm tools to call via MCP
- agent.run_stream(...) yields streaming messages as the agent thinks and calls tools
- Typing exit, quit, or bye ends the loop
```python
print("Chat started! Type 'exit' or 'quit' to end the conversation.\n")
print("Ask any Capsule crm related question or task to the agent.\n")

# Conversation loop
while True:
    user_input = input("You: ").strip()

    if user_input.lower() in ["exit", "quit", "bye"]:
        print("\nGoodbye!")
        break

    if not user_input:
        continue

    print("\nAgent is thinking...\n")

    # Run the agent with streaming
    try:
        response_text = ""
        async for message in agent.run_stream(task=user_input):
            if hasattr(message, "content") and message.content:
                response_text = message.content

        # Print the final response
        if response_text:
            print(f"Agent: {response_text}\n")
        else:
            print("Agent: I encountered an issue processing your request.\n")

    except Exception as e:
        print(f"Agent: Sorry, I encountered an error: {str(e)}\n")
```

## Complete Code

```python
import asyncio
import os
from dotenv import load_dotenv
from composio import Composio

from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_ext.tools.mcp import McpWorkbench, StreamableHttpServerParams

load_dotenv()

async def main():
    # Initialize Composio and create a Capsule crm session
    composio = Composio(api_key=os.getenv("COMPOSIO_API_KEY"))
    session = composio.create(
        user_id=os.getenv("USER_ID"),
        toolkits=["capsule_crm"]
    )
    url = session.mcp.url

    # Configure MCP server parameters for Streamable HTTP
    server_params = StreamableHttpServerParams(
        url=url,
        timeout=30.0,
        sse_read_timeout=300.0,
        terminate_on_close=True,
        headers={"x-api-key": os.getenv("COMPOSIO_API_KEY")}
    )

    # Create model client
    model_client = OpenAIChatCompletionClient(
        model="gpt-5",
        api_key=os.getenv("OPENAI_API_KEY")
    )

    # Use McpWorkbench as context manager
    async with McpWorkbench(server_params) as workbench:
        # Create Capsule crm assistant agent with MCP tools
        agent = AssistantAgent(
            name="capsule_crm_assistant",
            description="An AI assistant that helps with Capsule crm operations.",
            model_client=model_client,
            workbench=workbench,
            model_client_stream=True,
            max_tool_iterations=10
        )

        print("Chat started! Type 'exit' or 'quit' to end the conversation.\n")
        print("Ask any Capsule crm related question or task to the agent.\n")

        # Conversation loop
        while True:
            user_input = input("You: ").strip()

            if user_input.lower() in ['exit', 'quit', 'bye']:
                print("\nGoodbye!")
                break

            if not user_input:
                continue

            print("\nAgent is thinking...\n")

            # Run the agent with streaming
            try:
                response_text = ""
                async for message in agent.run_stream(task=user_input):
                    if hasattr(message, 'content') and message.content:
                        response_text = message.content

                # Print the final response
                if response_text:
                    print(f"Agent: {response_text}\n")
                else:
                    print("Agent: I encountered an issue processing your request.\n")

            except Exception as e:
                print(f"Agent: Sorry, I encountered an error: {str(e)}\n")

if __name__ == "__main__":
    asyncio.run(main())
```

## Conclusion

You now have an Autogen assistant wired into Capsule crm through Composio's Tool Router and MCP. From here you can:
- Add more toolkits to the toolkits list, for example notion or hubspot
- Refine the agent description to point it at specific workflows
- Wrap this script behind a UI, Slack bot, or internal tool
Once the pattern is clear for Capsule crm, you can reuse the same structure for other MCP-enabled apps with minimal code changes.

## How to build Capsule crm MCP Agent with another framework

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

## Related Toolkits

- [Hubspot](https://composio.dev/toolkits/hubspot) - HubSpot is an all-in-one marketing, sales, and customer service platform. It lets teams nurture leads, automate outreach, and track every customer interaction in one place.
- [Pipedrive](https://composio.dev/toolkits/pipedrive) - Pipedrive is a sales management platform offering pipeline visualization, lead tracking, and workflow automation. It helps sales teams keep deals moving forward efficiently and never miss a follow-up.
- [Salesforce](https://composio.dev/toolkits/salesforce) - Salesforce is a leading CRM platform that helps businesses manage sales, service, and marketing. It centralizes customer data, enabling teams to drive growth and build strong relationships.
- [Apollo](https://composio.dev/toolkits/apollo) - Apollo is a CRM and lead generation platform that helps businesses discover contacts and manage sales pipelines. Use it to streamline customer outreach and track your deals from one place.
- [Attio](https://composio.dev/toolkits/attio) - Attio is a customizable CRM and workspace for managing your team's relationships and workflows. It helps teams organize contacts, automate tasks, and collaborate more efficiently.
- [Acculynx](https://composio.dev/toolkits/acculynx) - AccuLynx is a cloud-based roofing business management software for contractors. It streamlines project tracking, lead management, and document sharing.
- [Addressfinder](https://composio.dev/toolkits/addressfinder) - Addressfinder is a data quality platform for verifying addresses, emails, and phone numbers. It helps you ensure accurate customer and contact data every time.
- [Affinity](https://composio.dev/toolkits/affinity) - Affinity is a relationship intelligence CRM that helps private capital investors find, manage, and close more deals. It streamlines deal flow and surfaces key connections to help you win opportunities.
- [Agencyzoom](https://composio.dev/toolkits/agencyzoom) - AgencyZoom is a sales and performance platform built for P&C insurance agencies. It helps agents boost sales, retain clients, and analyze producer results in one place.
- [Bettercontact](https://composio.dev/toolkits/bettercontact) - Bettercontact is a smart contact enrichment tool for finding emails and phone numbers. It helps boost lead generation with automated, waterfall search across multiple sources.
- [Blackbaud](https://composio.dev/toolkits/blackbaud) - Blackbaud provides cloud-based software for nonprofits, schools, and healthcare institutions. It streamlines fundraising, donor management, and mission-driven operations.
- [Brilliant directories](https://composio.dev/toolkits/brilliant_directories) - Brilliant Directories is an all-in-one platform for building and managing online membership communities and business directories. It streamlines listings, member management, and engagement tools into a single, easy interface.
- [Centralstationcrm](https://composio.dev/toolkits/centralstationcrm) - CentralStationCRM is an easy-to-use CRM software focused on collaboration and long-term customer relationships. It helps teams manage contacts, deals, and communications all in one place.
- [Clientary](https://composio.dev/toolkits/clientary) - Clientary is a platform for managing clients, invoices, projects, proposals, and more. It streamlines client work and saves you serious admin time.
- [Close](https://composio.dev/toolkits/close) - Close is a CRM platform built for sales teams, combining calling, email automation, and predictive dialers. It streamlines sales workflows and boosts productivity with all-in-one communication tools.
- [Dropcontact](https://composio.dev/toolkits/dropcontact) - Dropcontact is a B2B email finder and data enrichment service for professionals. It delivers verified email addresses and enriches contact info with up-to-date data.
- [Dynamics365](https://composio.dev/toolkits/dynamics365) - Dynamics 365 is Microsoft's platform combining CRM, ERP, and productivity apps. It streamlines sales, marketing, service, and operations in one place.
- [Espocrm](https://composio.dev/toolkits/espocrm) - EspoCRM is an open-source web application for managing customer relationships. It helps businesses organize contacts, track leads, and streamline their sales process.
- [Fireberry](https://composio.dev/toolkits/fireberry) - Fireberry is a CRM platform that streamlines customer and sales management. It helps businesses organize contacts, automate sales, and integrate with other business tools.
- [Firmao](https://composio.dev/toolkits/firmao) - Firmao is a business information platform offering company, industry, and market data. Use it to quickly research firms and gain competitive market insights.

## Frequently Asked Questions

### What are the differences in Tool Router MCP and Capsule crm MCP?

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

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

Yes, you can. Autogen 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 Capsule crm tools.

### Can I manage the permissions and scopes for Capsule crm while using Tool Router?

Yes, absolutely. You can configure which Capsule crm 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 Capsule crm data and credentials are handled as safely as possible.

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