# How to integrate Outline MCP with LlamaIndex

```json
{
  "title": "How to integrate Outline MCP with LlamaIndex",
  "toolkit": "Outline",
  "toolkit_slug": "outline",
  "framework": "LlamaIndex",
  "framework_slug": "llama-index",
  "url": "https://composio.dev/toolkits/outline/framework/llama-index",
  "markdown_url": "https://composio.dev/toolkits/outline/framework/llama-index.md",
  "updated_at": "2026-06-18T09:56:33.398Z"
}
```

## Introduction

This guide walks you through connecting Outline to LlamaIndex using the Composio tool router. By the end, you'll have a working Outline agent that can summarize latest engineering design documents, create onboarding page for new hires, find outdated api documentation pages through natural language commands.
This guide will help you understand how to give your LlamaIndex agent real control over a Outline account through Composio's Outline MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Outline with

- [OpenAI Agents SDK](https://composio.dev/toolkits/outline/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/outline/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/outline/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/outline/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/outline/framework/codex)
- [OpenClaw](https://composio.dev/toolkits/outline/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/outline/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/outline/framework/cli)
- [Google ADK](https://composio.dev/toolkits/outline/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/outline/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/outline/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/outline/framework/mastra-ai)
- [CrewAI](https://composio.dev/toolkits/outline/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 Outline
- Connect LlamaIndex to the Outline MCP server
- Build a Outline-powered agent using LlamaIndex
- Interact with Outline 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 Outline MCP server, and what's possible with it?

The Outline MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Outline account. It provides structured and secure access so your agent can perform Outline operations on your behalf.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `OUTLINE_ACTIVATE_USER` | Activate User | Tool to activate a previously suspended user in Outline. Activating a user allows them to sign in again and will cause billing totals to be re-calculated in the hosted version. Use when you need to restore access for a suspended user. |
| `OUTLINE_ADD_COLLECTION_GROUP` | Add Group to Collection | Tool to add a group to a collection in Outline. Use when you need to grant all members of a group access to a specific collection with read or write permissions. |
| `OUTLINE_ADD_DOCUMENT_USER` | Add Document User | Tool to add a user membership to a document. Use when you need to grant a user access to a specific document. |
| `OUTLINE_ADD_GROUP_TO_DOCUMENT` | Add Group to Document | Tool to give all members in a group access to a document. Use when you need to grant document-level access permissions to an entire group at once, rather than adding individual users one by one. |
| `OUTLINE_ADD_GROUP_USER` | Add User to Group | Tool to add a user to a group. Use when you need to grant a user membership in a specific group. |
| `OUTLINE_ADD_USER_TO_COLLECTION` | Add User to Collection | Tool to add a user to a collection with specified permissions. Use when you need to grant a user access to a specific collection. |
| `OUTLINE_ARCHIVE_DOCUMENT` | Archive Document | Tool to archive a document in Outline. Use when you need to move outdated information out of sight while retaining the ability to search and restore it later. |
| `OUTLINE_CREATE_ATTACHMENT` | Create Attachment | Tool to create an attachment in Outline. This creates a database record and returns the inputs needed to generate a signed URL and upload the file from the client to cloud storage. Use when you need to prepare an attachment for upload to associate with a document. |
| `OUTLINE_CREATE_COLLECTION` | Create Collection | Tool to create a new collection in Outline. Use when you need to organize documents by creating a new collection with a specific name, description, icon, color, and permission settings. |
| `OUTLINE_CREATE_COMMENT` | Create Comment | Tool to create a comment on an Outline document. Use when you need to add a comment or reply to a document. Either text or data field is required for the comment body. |
| `OUTLINE_CREATE_DOCUMENT` | Create Document | Tool to create a new document in Outline. Use when you need to create a new document with specified title, content, and metadata. Documents can be created as drafts or immediately published to a collection. At least one of collectionId or parentDocumentId is required if publish is true. |
| `OUTLINE_CREATE_GROUP` | Create Group | Tool to create a new group in Outline. Use when you need to organize users into logical groups for easier permission management across collections. |
| `OUTLINE_CREATE_O_AUTH_CLIENT` | Create OAuth Client | Tool to create a new OAuth client in Outline. Use when you need to create an OAuth client application that can be used to authenticate users and access the API on their behalf. |
| `OUTLINE_CREATE_SHARE` | Create Share | Tool to create a public share link for an Outline document. Use when you need to generate a shareable URL that allows access without workspace membership. If you request multiple shares for the same document with the same API key, the same share object will be returned. |
| `OUTLINE_CREATE_STAR` | Create Star | Tool to create a star for a document or collection in Outline. Use when you need to star (favorite) a document or collection so it appears in the user's sidebar. One of either documentId or collectionId must be provided. |
| `OUTLINE_CREATE_TEMPLATE` | Create Template | Tool to create a new template in Outline. Use when you need to create a reusable template that can be used as a starting point for new documents. Templates can optionally be scoped to a specific collection. |
| `OUTLINE_CREATE_VIEW` | Create View | Tool to create a view for a document. Use when you need to record that a document has been viewed. Note: It is recommended that views are not created from outside of the Outline UI. |
| `OUTLINE_DELETE_ATTACHMENT` | Delete Attachment | Tool to delete an attachment from Outline. Deleting an attachment is permanent. It will not delete references or links to the attachment that may exist in your documents. |
| `OUTLINE_DELETE_COLLECTION` | Delete Collection | Tool to delete a collection and all of its documents from Outline. Use when you need to permanently remove a collection. This action cannot be undone, so use with caution. |
| `OUTLINE_DELETE_COMMENT` | Delete Comment | Tool to delete a comment in Outline. Use when you need to remove a comment from a document. If the comment is a top-level comment, all its children will be deleted as well. |
| `OUTLINE_DELETE_DOCUMENT` | Delete Document | Tool to delete a document in Outline. Deleting a document moves it to the trash by default. If not restored within 30 days it is permanently deleted. Use permanent=true to destroy the document immediately with no way to recover. |
| `OUTLINE_DELETE_FILE_OPERATION` | Delete File Operation | Tool to delete a file operation and its associated files from Outline. Use when you need to clean up completed or failed import/export operations. |
| `OUTLINE_DELETE_GROUP` | Delete Group | Tool to delete a group from Outline. Deleting a group will cause all of its members to lose access to any collections the group has previously been added to. This action cannot be undone, so use with caution. |
| `OUTLINE_DELETE_OAUTH_AUTHENTICATION` | Delete OAuth Authentication | Tool to delete an OAuth authentication in Outline. Use when you need to revoke a third-party application's access to a user's account. This action removes the OAuth authentication connection between Outline and the third-party application. |
| `OUTLINE_DELETE_OAUTH_CLIENT` | Delete OAuth Client | Tool to delete an OAuth client from Outline. Permanently delete an OAuth client and revoke all associated access tokens. This action cannot be undone, so use with caution. |
| `OUTLINE_DELETE_STAR` | Delete Star | Tool to delete a star from a document in Outline. Use when you need to remove a star from a user's starred documents list. |
| `OUTLINE_DELETE_TEMPLATE` | Delete Template | Tool to delete a template in Outline. This will soft-delete the template, it can be restored later. Use when you need to remove a template from the workspace. |
| `OUTLINE_DELETE_USER` | Delete User | Tool to delete a user in Outline. Deleting a user removes the object entirely. In almost every circumstance it is preferable to suspend a user, as a deleted user can be recreated by signing in with SSO again. Use when you need to permanently remove a user from the workspace. |
| `OUTLINE_DUPLICATE_DOCUMENT` | Duplicate Document | Tool to duplicate an Outline document. Use when you need to create a copy of an existing document, optionally including all child documents in the hierarchy. |
| `OUTLINE_DUPLICATE_TEMPLATE` | Duplicate Template | Tool to duplicate an Outline template. Use when you need to create a copy of an existing template, optionally with a new title or in a different collection. |
| `OUTLINE_EMPTY_DOCUMENTS_TRASH` | Empty Documents Trash | Tool to permanently delete all documents in the trash. Use when you need to empty the trash and remove all trashed documents permanently. WARNING: This action is irreversible and only available to admin users. |
| `OUTLINE_EXPORT_ALL_COLLECTIONS` | Export All Collections | Tool to export all collections and their documents in bulk. Use when you need to create a backup or export of all workspace collections. Returns a FileOperation object for tracking export progress. |
| `OUTLINE_EXPORT_COLLECTION` | Export Collection | Tool to export a collection in markdown, JSON, or HTML format. Triggers a bulk export that includes all documents and attachments. If documents are nested, they will be organized in folders within the zip file. Returns a fileOperation object to track progress. |
| `OUTLINE_EXPORT_DOCUMENT` | Export Document | Tool to export a document from Outline in Markdown, HTML, or PDF format. The response format is determined by the Accept header (text/markdown, text/html, or application/pdf). Use when you need to download or extract document content for external processing, archiving, or sharing. |
| `OUTLINE_GET_ATTACHMENT_REDIRECT` | Get Attachment Redirect URL | Tool to retrieve an attachment redirect URL from Outline. Loads an attachment from where it is stored based on the id. If the attachment is private, a temporary signed URL with embedded credentials is generated on demand. Use when you need to access or download an attachment. |
| `OUTLINE_GET_AUTH_CONFIG` | Get authentication config | Tool to retrieve authentication configuration options for an Outline workspace. Use when you need to discover the workspace name, hostname, or available SSO/OAuth authentication services before user login. |
| `OUTLINE_GET_COLLECTION` | Get Collection Info | Tool to retrieve a collection by its unique identifier. Use when you need to fetch detailed information about a specific collection including its name, description, settings, and permissions. |
| `OUTLINE_GET_COLLECTION_DOCUMENTS` | Get Collection Documents | Tool to retrieve a collection's document structure as a tree of navigation nodes. Use when you need to explore the document hierarchy within a collection. |
| `OUTLINE_GET_COMMENT` | Get Comment | Tool to retrieve a comment by its ID from Outline. Use when you need to fetch detailed information about a specific comment including its content, author, timestamps, and resolution status. |
| `OUTLINE_GET_DOCUMENT_INFO` | Get Document Info | Tool to retrieve a document from Outline by its UUID, urlId, or shareId. Returns complete document information including title, content, metadata, timestamps, and access policies. Use when you need to fetch document details or content. |
| `OUTLINE_GET_DOCUMENTS_DOCUMENTS` | Get Document Children Structure | Tool to retrieve a document's child structure. Returns the nested document tree (hierarchy) for the children of the specified document. Use when you need to explore document organization or navigate the document hierarchy. |
| `OUTLINE_GET_FILE_OPERATION_INFO` | Get File Operation Info | Tool to retrieve the details and current status of a file operation by its unique identifier. Use when you need to check the progress of import or export operations. |
| `OUTLINE_GET_GROUP_INFO` | Get Group Info | Tool to retrieve a group by its unique identifier. Returns group details including name and member count. Use when you need to fetch information about a specific group. |
| `OUTLINE_GET_OAUTH_CLIENT_INFO` | Get OAuth Client Info | Tool to retrieve an OAuth client from Outline by its id or clientId. Returns complete OAuth client configuration including name, scopes, and redirect URIs. Use when you need to fetch OAuth client details. |
| `OUTLINE_GET_REVISION_INFO` | Get Revision Info | Tool to retrieve a revision by its ID from Outline. A revision is a snapshot of a document at a specific point in time. Use when you need to fetch historical document content or view editing history. |
| `OUTLINE_GET_SHARE_INFO` | Get Share Info | Tool to retrieve a share object by its unique identifier or by the associated document ID. Returns complete share information including URL, visibility settings, access permissions, and view statistics. Use when you need to fetch details about a shared document. |
| `OUTLINE_GET_TEMPLATE_INFO` | Get Template Info | Tool to retrieve a template by its unique identifier. Use when you need to fetch detailed information about a specific template including its title, content, and metadata. |
| `OUTLINE_GET_USER_INFO` | Get User Info | Tool to retrieve a user by their unique identifier. Returns user details including name, email, avatar, role, and status. Use when you need to fetch information about a specific user. |
| `OUTLINE_INVITE_USERS` | Invite Users | Tool to invite users to the Outline workspace. Use when you need to send email invitations to one or more users to join the workspace. |
| `OUTLINE_LIST_ARCHIVED_DOCUMENTS` | List Archived Documents | List all archived documents in the Outline workspace. Returns paginated archived documents that the current user has access to, with metadata and authorization policies. Use limit and offset for pagination through large result sets. |
| `OUTLINE_LIST_COLLECTION_GROUP_MEMBERSHIPS` | List Collection Group Memberships | Tool to list all group memberships for a specific collection in Outline. Use when you need to see which groups have access to a collection and their permission levels. Returns both group details and membership relationships with permissions. |
| `OUTLINE_LIST_COLLECTION_MEMBERSHIPS` | List collection memberships | Tool to list all individual user memberships for a collection. Use when you need to see who has access to a specific collection and their permission levels. Note: This only returns individual user memberships, not group memberships. |
| `OUTLINE_LIST_COLLECTIONS` | List Collections | Tool to list all collections that the authenticated user has access to. Use when you need to retrieve all collections, optionally filtered by name or status, with pagination and sorting support. |
| `OUTLINE_LIST_COMMENTS` | List Comments | Tool to retrieve all comments with optional filtering by document or collection. Use when you need to list comments, view comment threads, or monitor discussions. Supports pagination and sorting for large result sets. Returns comment data including content, authors, timestamps, and resolution status. |
| `OUTLINE_LIST_DATA_ATTRIBUTES` | List Data Attributes | Tool to list all data attributes in Outline. Use when you need to retrieve custom data attributes that can be attached to documents for structured metadata. |
| `OUTLINE_LIST_DELETED_DOCUMENTS` | List Deleted Documents | Tool to list all deleted documents in the workspace that the current user has access to. Use when you need to retrieve, review, or restore documents that have been deleted. Supports pagination and sorting to efficiently navigate through large numbers of deleted documents. |
| `OUTLINE_LIST_DOCUMENT_GROUP_MEMBERSHIPS` | List Document Group Memberships | Tool to list a document's group memberships. Use when you need to see which groups have access to a specific document and their permission levels. |
| `OUTLINE_LIST_DOCUMENT_MEMBERSHIPS` | List document memberships | Tool to list users with direct membership to a document. Use when you need to see who has direct access to a specific document and their permission levels. Note: This returns only users with direct memberships. To list all users with access to a document (including through group memberships), use documents.users instead. |
| `OUTLINE_LIST_DOCUMENTS` | List Documents | Tool to list all documents in your Outline workspace. Returns published documents and draft documents belonging to the current user. Use filters to narrow results by collection, creator, status, or document relationships. Supports pagination for large document sets. |
| `OUTLINE_LIST_DOCUMENT_USERS` | List Document Users | Tool to list all users with access to a document. Returns all users who have any level of access to the specified document. Use when you need to see who can view or edit a document. |
| `OUTLINE_LIST_DRAFT_DOCUMENTS` | List Draft Documents | Tool to list all draft documents belonging to the current user. Use when you need to retrieve unpublished documents. Supports filtering by collection, date recency, pagination, and sorting. |
| `OUTLINE_LIST_EVENTS` | List Events | Tool to list all events from the audit trail. Use when you need to track actions taken in the knowledge base, such as document creation, permission changes, or user activity. Events provide a comprehensive audit trail for compliance and monitoring. |
| `OUTLINE_LIST_FILE_OPERATIONS` | List File Operations | Tool to list all file operations for the workspace. Returns background jobs for importing or exporting files, filtered by type. Use to monitor export/import progress and retrieve download URLs for completed operations. |
| `OUTLINE_LIST_GROUP_MEMBERSHIPS` | List Group Memberships | Tool to list all members of a specific group in Outline. Use when you need to see which users belong to a group. Returns user details and membership relationships. |
| `OUTLINE_LIST_GROUPS` | List Groups | Tool to list all groups in the workspace. Groups organize users and manage permissions for collections. Use when you need to retrieve all groups, optionally filtered by name, with pagination and sorting support. |
| `OUTLINE_LIST_O_AUTH_AUTHENTICATIONS` | List OAuth Authentications | Tool to list all OAuth authentications for the current user. Use when you need to see which third-party applications have been authorized to access the user's account. |
| `OUTLINE_LIST_OAUTH_CLIENTS` | List OAuth Clients | Tool to list all OAuth clients accessible to the authenticated user. Use when you need to retrieve OAuth clients for third-party integrations. Returns both clients created by the user and published clients available to the workspace. |
| `OUTLINE_LIST_RECENTLY_VIEWED_DOCUMENTS` | List Recently Viewed Documents | Tool to list all recently viewed documents by the current user. Returns documents ordered by when they were last viewed. Supports pagination and sorting for large result sets. |
| `OUTLINE_LIST_REVISIONS` | List Revisions | Tool to list all revisions for a specific document. Revisions represent historical snapshots of document content and are useful for tracking changes over time. Use when you need to view a document's editing history or restore to a previous version. |
| `OUTLINE_LIST_SHARES` | List Shares | Tool to list all share links in the workspace. Use when you need to retrieve all public document shares, optionally filtered by search query, with pagination and sorting support. |
| `OUTLINE_LIST_STARS` | List Stars | Tool to list all starred documents and collections for the authenticated user. Use when you need to retrieve bookmarked items that users have marked for quick access in their sidebar. |
| `OUTLINE_LIST_TEMPLATES` | List Templates | Tool to list all templates available to the current user. Use when you need to retrieve all templates, optionally filtered by collection or name, with pagination and sorting support. Templates not associated with a collection are workspace-wide. |
| `OUTLINE_LIST_USERS` | List Users | Tool to list all users in the workspace. Use when you need to retrieve all users, optionally filtered by name, email, or status, with pagination and sorting support. |
| `OUTLINE_LIST_VIEWS` | List Views | Tool to list all users that have viewed a specific document and the overall view count. Use when you need to see who has accessed a document and how many times they've viewed it. Returns view records including first/last view timestamps and total view counts per user. |
| `OUTLINE_MOVE_DOCUMENT` | Move Document | Tool to move a document to a new location or collection in Outline. Use when you need to reorganize documents by moving them to a different collection or nesting them under a different parent document. |
| `OUTLINE_REDIRECT_FILE_OPERATION` | Redirect File Operation | Tool to retrieve a file from Outline by file operation ID. Loads the resulting file from where it is stored based on the id. A temporary signed URL with embedded credentials is generated on demand. Use when you need to access or download an exported file. |
| `OUTLINE_REMOVE_COLLECTION_GROUP` | Remove Collection Group | Tool to remove a group from a collection, revoking access for all group members. Use when you need to remove group-level access to a collection. Note that members may retain access through other groups or individual memberships. |
| `OUTLINE_REMOVE_COLLECTION_USER` | Remove Collection User | Tool to remove a user from a collection. Use when you need to revoke a user's access to a specific collection in Outline. |
| `OUTLINE_REMOVE_DOCUMENT_USER` | Remove Document User | Tool to remove a user membership from a document. Use when you need to revoke a user's access to a specific document. |
| `OUTLINE_REMOVE_GROUP_FROM_DOCUMENT` | Remove Group from Document | Tool to remove a group from a document, revoking access for all group members. Use when you need to revoke document-level access for an entire group at once. |
| `OUTLINE_REMOVE_GROUP_USER` | Remove Group User | Tool to remove a user from a group. Use when you need to revoke a user's group membership in Outline. |
| `OUTLINE_RESTORE_DOCUMENT` | Restore Document | Tool to restore a document in Outline. If a document has been archived or deleted, it can be restored. Optionally a revision can be passed to restore the document to a previous point in time. |
| `OUTLINE_RESTORE_TEMPLATE` | Restore Template | Tool to restore a previously deleted template in Outline. Use when you need to recover a template that was soft-deleted. |
| `OUTLINE_RETRIEVE_AUTH_INFO` | Retrieve Auth Info | Tool to retrieve authentication details for the current API key. Use when you need to verify that an API token is valid or obtain identifying information for the authenticated user and workspace. |
| `OUTLINE_REVOKE_SHARE` | Revoke Share | Tool to revoke a share in Outline, making the share link inactive so it can no longer be used to access the document. Use when you need to disable public access to a shared document. |
| `OUTLINE_ROTATE_OAUTH_CLIENT_SECRET` | Rotate OAuth Client Secret | Tool to rotate the secret for an OAuth client in Outline. Use when you need to generate a new client secret for an OAuth client. The old secret will be invalidated immediately. |
| `OUTLINE_SEARCH_DOCUMENTS` | Search Documents | Tool to search all documents in your Outline workspace using keywords. Results are restricted to documents accessible by the current access token. Use filters to narrow results by collection, user, status, or timeframe. Supports sorting by relevance, date, or title. |
| `OUTLINE_SEARCH_DOCUMENT_TITLES` | Search Document Titles | Tool to search document titles in Outline workspace using keywords. Unlike full document search, this searches only titles and returns faster results. Use when you need to quickly find documents by their title. Supports filters for collection, creator, status, and date range. |
| `OUTLINE_SUSPEND_USER` | Suspend User | Tool to suspend a user in Outline. Suspending a user prevents them from signing in and they are not counted against billing totals. Use when you need to temporarily disable a user's access without deleting their account. |
| `OUTLINE_TEMPLATIZE_DOCUMENT` | Create Template from Document | Tool to create a template from an existing Outline document. Use when you need to convert a document into a reusable template for your workspace. |
| `OUTLINE_UNPUBLISH_DOCUMENT` | Unpublish Document | Tool to unpublish a document in Outline. Unpublishing moves the document back to draft status and removes it from the collection. Use when you need to make a published document private again. |
| `OUTLINE_UPDATE_COLLECTION` | Update Collection | Tool to update an existing collection's properties in Outline. Use when you need to modify collection settings such as name, description, icon, color, sharing settings, or permission level. |
| `OUTLINE_UPDATE_COMMENT` | Update Comment | Tool to update a comment in Outline. Use when you need to modify the content of an existing comment. The comment body should be provided in ProseMirror document format with type and content fields. |
| `OUTLINE_UPDATE_DOCUMENT` | Update Document | Tool to update a document in Outline. Use when you need to modify an existing document's title, content, or metadata. At least the document ID is required. |
| `OUTLINE_UPDATE_GROUP` | Update Group | Tool to update an existing group's name in Outline. Use when you need to rename a group. |
| `OUTLINE_UPDATE_O_AUTH_CLIENT` | Update OAuth Client | Tool to update an existing OAuth client in Outline. Use when you need to modify an OAuth client's properties such as name, description, redirect URIs, or published status. |
| `OUTLINE_UPDATE_SHARE` | Update Share | Tool to update a share in Outline. Use when you need to change a share's published status, which controls whether authentication is required to access the shared link. |
| `OUTLINE_UPDATE_STAR` | Update Star | Tool to update a star's position in the Outline sidebar. Use when you need to reorder a user's starred documents or collections by changing the display index. |
| `OUTLINE_UPDATE_TEMPLATE` | Update Template | Tool to update an existing template in Outline. Use when you need to modify a template's title, content, icon, color, or other properties. At least the template ID is required. |
| `OUTLINE_UPDATE_USER` | Update User | Tool to update a user's name, avatar, or language preference in Outline. If no ID is provided, updates the authenticated user. Use when you need to modify user profile information. |
| `OUTLINE_UPDATE_USER_ROLE` | Update User Role | Tool to change a user's role in Outline workspace. Use when you need to promote a user to admin, demote an admin to member, or change a user to viewer role. Only available to admin users. |

## Supported Triggers

None listed.

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

The Outline MCP server is an implementation of the Model Context Protocol that connects your AI agent to Outline. It provides structured and secure access so your agent can perform Outline 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 Outline account and project
- Basic familiarity with async Python/Typescript

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

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 Outline 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, outline)
- 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 Outline 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=["outline"],
    )

    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 Outline actions."
    system_prompt = """
    You are a helpful assistant connected to Composio Tool Router.
    Use the available tools to answer user queries and perform Outline 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: ["outline"],
    },
  );

  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 Outline 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 Outline
```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 Outline, 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=["outline"],
    )

    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 Outline actions."
    system_prompt = """
    You are a helpful assistant connected to Composio Tool Router.
    Use the available tools to answer user queries and perform Outline 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: ["outline"],
    },
  );

  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 Outline 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 Outline to LlamaIndex through Composio's Tool Router MCP layer.
Key takeaways:
- Tool Router dynamically exposes Outline 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 Outline MCP Agent with another framework

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

## Related Toolkits

- [Google Drive](https://composio.dev/toolkits/googledrive) - Google Drive is a cloud storage platform for uploading, sharing, and collaborating on files. It's perfect for keeping your documents accessible and organized across devices.
- [Google Docs](https://composio.dev/toolkits/googledocs) - Google Docs is a cloud-based word processor that enables document creation and real-time collaboration. Its seamless sharing and version history make team editing and content management a breeze.
- [Google Super](https://composio.dev/toolkits/googlesuper) - Google Super is an all-in-one suite combining Gmail, Drive, Calendar, Sheets, Analytics, and more. It gives you a unified platform to manage your digital life, boosting productivity and organization.
- [Affinda](https://composio.dev/toolkits/affinda) - Affinda is an AI-powered document processing platform that automates data extraction from resumes, invoices, and more. It streamlines document-heavy workflows by turning files into structured, actionable data.
- [Agility cms](https://composio.dev/toolkits/agility_cms) - Agility CMS is a headless content management system for building and managing digital experiences across platforms. It lets teams update content quickly and deliver omnichannel experiences with ease.
- [Algodocs](https://composio.dev/toolkits/algodocs) - Algodocs is an AI-powered platform that automates data extraction from business documents. It delivers fast, secure, and accurate processing without templates or manual training.
- [Api2pdf](https://composio.dev/toolkits/api2pdf) - Api2Pdf is a REST API for generating PDFs from HTML, URLs, and documents using powerful engines like wkhtmltopdf and Headless Chrome. It streamlines document conversion and automation for developers and businesses.
- [Aryn](https://composio.dev/toolkits/aryn) - Aryn is an AI-powered platform for parsing, extracting, and analyzing data from unstructured documents. Use it to automate document processing and unlock actionable insights from your files.
- [Boldsign](https://composio.dev/toolkits/boldsign) - Boldsign is a digital eSignature platform for sending, signing, and tracking documents online. Organizations use it to automate agreements and manage legally binding workflows efficiently.
- [Boloforms](https://composio.dev/toolkits/boloforms) - BoloForms is an eSignature platform built for small businesses, offering unlimited signatures, templates, and forms. It simplifies digital document signing and team collaboration at a predictable, fixed price.
- [Box](https://composio.dev/toolkits/box) - Box is a cloud content management and file sharing platform for businesses. It helps teams securely store, organize, and collaborate on files from anywhere.
- [Carbone](https://composio.dev/toolkits/carbone) - Carbone is a blazing-fast report generator that turns JSON data into PDFs, Word docs, spreadsheets, and more using flexible templates. It lets you automate document creation at scale with minimal code.
- [Castingwords](https://composio.dev/toolkits/castingwords) - CastingWords is a transcription service specializing in human-powered, accurate transcripts via a simple API. Get seamless audio-to-text conversion for interviews, meetings, podcasts, and more.
- [Cloudconvert](https://composio.dev/toolkits/cloudconvert) - CloudConvert is a powerful file conversion service supporting over 200 file formats. It streamlines converting, compressing, and managing documents, media, and more, all in one place.
- [Cloudlayer](https://composio.dev/toolkits/cloudlayer) - Cloudlayer is a document and asset generation service for creating PDFs and images via API or SDKs. It lets you automate high-quality doc creation, saving dev time and reducing manual work.
- [Cloudpress](https://composio.dev/toolkits/cloudpress) - Cloudpress is a content export tool for Google Docs and Notion. It automates publishing to your favorite Content Management Systems.
- [Contentful graphql](https://composio.dev/toolkits/contentful_graphql) - Contentful graphql is a content delivery API that lets you access Contentful data using GraphQL queries. It gives you efficient, flexible ways to fetch and manage structured content for any digital project.
- [Conversion tools](https://composio.dev/toolkits/conversion_tools) - Conversion Tools is an online service for converting documents between formats such as PDF, Word, Excel, XML, and CSV. It lets you automate complex document workflows with just a few clicks.
- [Convertapi](https://composio.dev/toolkits/convertapi) - ConvertAPI is a robust file conversion service for documents, images, and spreadsheets. It streamlines programmatic format changes and lets developers automate complex workflows with a single API.
- [Craftmypdf](https://composio.dev/toolkits/craftmypdf) - CraftMyPDF is a web-based service for designing and generating PDFs with templates and live data. It streamlines document creation by automating personalized PDFs at scale.

## Frequently Asked Questions

### What are the differences in Tool Router MCP and Outline MCP?

With a standalone Outline MCP server, the agents and LLMs can only access a fixed set of Outline tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Outline 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 Outline tools.

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

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

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