# How to integrate Sap successfactors MCP with LlamaIndex

```json
{
  "title": "How to integrate Sap successfactors MCP with LlamaIndex",
  "toolkit": "Sap successfactors",
  "toolkit_slug": "sap_successfactors",
  "framework": "LlamaIndex",
  "framework_slug": "llama-index",
  "url": "https://composio.dev/toolkits/sap_successfactors/framework/llama-index",
  "markdown_url": "https://composio.dev/toolkits/sap_successfactors/framework/llama-index.md",
  "updated_at": "2026-05-12T10:24:40.837Z"
}
```

## Introduction

This guide walks you through connecting Sap successfactors to LlamaIndex using the Composio tool router. By the end, you'll have a working Sap successfactors agent that can show your current employee profile details, check your job title and department info, display your contact information in successfactors through natural language commands.
This guide will help you understand how to give your LlamaIndex agent real control over a Sap successfactors account through Composio's Sap successfactors MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Sap successfactors with

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

The Sap successfactors MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Sap successfactors account. It provides structured and secure access to your HR data, so your agent can retrieve user information, access employee details, and drive workforce automation on your behalf.
- Current user profile retrieval: Instantly fetch the authenticated user's profile and access up-to-date information about their SAP SuccessFactors account.
- Employee data access: Allow your agent to securely obtain details about employees, enabling streamlined HR and workforce management workflows.
- Personalized onboarding support: Use user data to personalize onboarding experiences, helping new hires get up to speed faster with relevant, contextual information.
- Automated reporting: Enable your agent to pull user-related reports or summaries, supporting HR analytics and decision-making.
- Seamless integration with enterprise HR processes: Connect user data to other HR tools or workflows, making it easier to automate tasks like leave approvals or performance tracking.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `SAP_SUCCESSFACTORS_APPROVE_CALIBRATION_SESSION` | Approve Calibration Session | Finalize a calibration session that is in the In Progress or Approving status. |
| `SAP_SUCCESSFACTORS_CREATE_A_FEEDBACK_REQUEST` | Create a Feedback Request | Create a feedback request in SAP SuccessFactors Continuous Feedback. Use when you need to request performance feedback from one employee about another. At least one question must be provided. |
| `SAP_SUCCESSFACTORS_CREATE_LEARNING_ACTIVITIES_BULK` | Create Learning Activities Bulk | Create learning activities and associate them with development goals in bulk (requires third-party LMS integration). |
| `SAP_SUCCESSFACTORS_CREATE_ONBOARDEE` | Create Onboardee | Creates a new onboardee in SAP SuccessFactors Onboarding 2.0 system. Use when initiating the onboarding process for a new hire or rehire. Requires admin create user permissions. |
| `SAP_SUCCESSFACTORS_CREATE_UPDATE_SUCCESSOR_NOMINATION` | Create or Update Successor Nomination | Create or update a successor nomination for a position or talent pool in succession planning. Use when you need to nominate or update a successor for a specific position or talent pool. |
| `SAP_SUCCESSFACTORS_DELETE_NOMINATION_POSITION_TALENT_POOL` | Delete Nomination | Delete a nomination for a position or talent pool in succession planning. Use when you need to remove a nominee from a position or talent pool nomination. |
| `SAP_SUCCESSFACTORS_GET_APPLICATION_INTERVIEW` | Get Application Interview | Retrieves interview information related to job applications from Interview Central. Use when you need to query interview schedules, statuses, or details for applicants. Note: This entity checks only the first 1000 records, so filtering by applicationId is recommended. |
| `SAP_SUCCESSFACTORS_GET_BACKGROUND_EDUCATION` | Get Background Education | Tool to retrieve background education records for employees from SAP SuccessFactors. Use when you need to query education history with support for filtering, field selection, and pagination via OData query options. Background entities use backgroundElementId as the unique key field. |
| `SAP_SUCCESSFACTORS_GET_BACKGROUND_MOBILITY` | Get Background Mobility | Retrieves mobility background records showing employee willingness to relocate. Use when you need to query employee geographic mobility preferences and location data. Results can be filtered and ordered by bgOrderPos to maintain screen display order. |
| `SAP_SUCCESSFACTORS_GET_CALIBRATION_SESSION_BY_ID` | Get Calibration Session By ID | Get a specific calibration session by session ID. |
| `SAP_SUCCESSFACTORS_GET_CALIBRATION_SESSIONS` | Get Calibration Sessions | Query all the calibration sessions that a user can access. |
| `SAP_SUCCESSFACTORS_GET_CALIBRATION_SUBJECT_BY_ID` | Get Calibration Subject By ID | Query a specific subject's competency ratings and ratings within a calibration session. |
| `SAP_SUCCESSFACTORS_GET_CALIBRATION_SUBJECT_RATINGS` | Get Calibration Subject Ratings | Query a subject's ratings, competency ratings, and comments by using session ID. |
| `SAP_SUCCESSFACTORS_GET_CDP_LEARNING_METADATA` | Get CDP Learning Metadata | Get metadata for Career Development Planning Learning service. |
| `SAP_SUCCESSFACTORS_GET_CURRENT_USER` | Get Current User | Retrieves the currently authenticated user's information from SAP SuccessFactors. |
| `SAP_SUCCESSFACTORS_GET_CUSTOM_MDF_OBJECT` | Get Custom MDF Object | Tool to retrieve custom MDF (Metadata Framework) objects from SAP SuccessFactors. Custom object names begin with cust_ prefix in the API. Use when you need to query custom business objects defined in the MDF framework. |
| `SAP_SUCCESSFACTORS_GET_EMP_EMPLOYMENT_TERMINATION` | Get Employee Employment Termination | Retrieves employee termination information records from SAP SuccessFactors. Contains details about employment terminations including termination date and reason. Use when you need to query termination records with support for filtering, field selection, expansion of related entities, and pagination via OData query options. |
| `SAP_SUCCESSFACTORS_GET_EMPLOYEE_TIME` | Get Employee Time | Retrieves employee time entries including time off records from SAP SuccessFactors. Use when you need to query approved leaves, time-off requests, or employee time tracking data. Supports filtering by userId, approvalStatus, timeType, and date ranges. |
| `SAP_SUCCESSFACTORS_GET_EMPLOYEE_TIMESHEET` | Get Employee Timesheet | Retrieves employee timesheet records for attendances, overtime, on-call times, and allowances. Use when you need to query employee timesheet data from SAP SuccessFactors. |
| `SAP_SUCCESSFACTORS_GET_EMP_PAY_COMP_NON_RECURRING` | Get Non-Recurring Pay Components | Tool to retrieve non-recurring pay component information including bonuses and one-time payments from SAP SuccessFactors. Use when you need data about employee bonuses, commissions, or other non-recurring compensation components. |
| `SAP_SUCCESSFACTORS_GET_EMP_PAY_COMP_RECURRING` | Get Recurring Pay Components | Tool to retrieve recurring pay component information including salary and benefits data from SAP SuccessFactors. Use when you need to query employee compensation data with recurring payments such as salary, allowances, or benefits. Supports filtering by userId and payComponent code. |
| `SAP_SUCCESSFACTORS_GET_FEEDBACK_RECORDS_SERVICE_AVAILABLE` | Get Feedback Records | Tool to retrieve continuous feedback records from SAP SuccessFactors Performance and Goals module using OData V4 protocol. Use when you need to query and retrieve feedback data with filtering, sorting, pagination, and field selection capabilities. Supports standard OData v4 query operations for flexible data retrieval. |
| `SAP_SUCCESSFACTORS_GET_FO_BUSINESS_UNIT` | Get FOBusinessUnit | Retrieves foundation object business unit records for organizational structure hierarchy. Use when querying business unit information with support for filtering, sorting, and pagination. |
| `SAP_SUCCESSFACTORS_GET_FO_COMPANY` | Get FOCompany Records | Retrieves foundation object company records from SAP SuccessFactors. Returns company information including display_name, legal_name, and entityOID for One Domain Model integration. |
| `SAP_SUCCESSFACTORS_GET_FO_COST_CENTER` | Get Foundation Object Cost Centers | Retrieves foundation object cost center records for organizational structure. Contains cost center information with entityOID for One Domain Model integration. Use standard OData query parameters to filter, sort, and paginate results. |
| `SAP_SUCCESSFACTORS_GET_FO_DEPARTMENT` | Get FODepartment Records | Tool to retrieve foundation object department records from SAP SuccessFactors. Use when you need to access organizational department structure information including team and group details. |
| `SAP_SUCCESSFACTORS_GET_FO_JOB_CODE` | Get Foundation Object Job Codes | Retrieves foundation object job code records containing job classification information. Use when you need to fetch job codes with their associated metadata for positions. |
| `SAP_SUCCESSFACTORS_GET_FO_JOB_FUNCTION` | Get Job Functions | Tool to retrieve foundation object job function records for categorizing job roles. Use when you need to query job function data with support for filtering, field selection, and pagination via OData query options. |
| `SAP_SUCCESSFACTORS_GET_FO_LOCATION` | Get Foundation Object Location | Tool to retrieve foundation object location records for work locations. Use when you need to query organizational location data including names, status, timezones, and address details. |
| `SAP_SUCCESSFACTORS_GET_FO_PAY_GROUP` | Get FOPayGroup | Retrieves foundation object pay group records for compensation and payroll groupings. Use when querying pay group data from SAP SuccessFactors. |
| `SAP_SUCCESSFACTORS_GET_FORM_CONTENT` | Get Form Content | Retrieves performance form content from SAP SuccessFactors. Use to query forms with filters like form template ID or modification date. |
| `SAP_SUCCESSFACTORS_GET_GOAL_PLAN_TEMPLATE` | Get Goal Plan Template | Retrieves goal plan template information from SAP SuccessFactors. Use when you need to fetch goal plan template configurations that define the structure of goals via DTD file. |
| `SAP_SUCCESSFACTORS_GET_GOALS_BY_PLAN` | Get Goals By Plan | Retrieves performance goals data using the goal plan ID. Use this to query goals for a specific plan (e.g., Goal_11) with optional filtering by userId or other fields. |
| `SAP_SUCCESSFACTORS_GET_INTERVIEW_OVERALL_ASSESSMENT` | Get Interview Overall Assessment | Tool to retrieve overall interview ratings and navigation for assessments from Interview Central. Use when you need to fetch overall interview assessment data including ratings, recommendations, and comments. |
| `SAP_SUCCESSFACTORS_GET_JOB_APPLICATION` | Get Job Application | Retrieves job application records linking candidates to job requisitions. Use when you need to query application data, filter by status, or retrieve candidate application information. |
| `SAP_SUCCESSFACTORS_GET_JOB_REQ_SCREENING_QUESTION` | Get Job Requisition Screening Questions | Tool to retrieve screening questions related to job requisitions from SAP SuccessFactors Recruiting. Use when you need to access screening questions for candidate assessment in the recruitment process. |
| `SAP_SUCCESSFACTORS_GET_JOB_REQUISITION` | Get Job Requisition | Tool to retrieve job requisition records from SAP SuccessFactors Recruiting Management. Use when you need to read job requisitions, send them to third-party systems, or manage the recruiting workflow. |
| `SAP_SUCCESSFACTORS_GET_ODATA_METADATA_CALIB_SESSION_SERVICE` | Get Calibration Session Metadata | Get OData metadata for Calibration Session service. Returns the service metadata including available entity sets. Use this to discover available entities in the CalSession.svc service. |
| `SAP_SUCCESSFACTORS_GET_ODATA_METADATA_CLOCK_INCLOCK_OUT` | Get Clock In/Out Integration Metadata | Get OData metadata for Clock In/Clock Out Integration service. Returns the complete service schema including entity types, enum types, complex types, and entity container definitions. |
| `SAP_SUCCESSFACTORS_GET_ODATA_METADATA_FOR_NOMINATION_SERVICE` | Get Nomination Service Metadata | Get OData metadata for Nomination service. Returns the service metadata including available entity sets for successor and talent pool nominations. Use this to discover available entities in the NominationService.svc service. |
| `SAP_SUCCESSFACTORS_GET_ODATA_METADATA_ONBOARDING_ADDL` | Get Onboarding Additional Services Metadata | Get OData metadata for Onboarding Additional Services. Returns the complete service schema including available operations like updateUserNamePostHiring and getUserNameOfNewlyHiredEmployee. |
| `SAP_SUCCESSFACTORS_GET_ODATA_USER_METADATA` | Get User Entity Metadata | Retrieves the OData metadata document for the User entity describing its properties and operations. Use this to discover available fields, data types, and navigation properties for the User entity. |
| `SAP_SUCCESSFACTORS_GET_ONB2_PROCESS` | Get Onboarding 2.0 Processes | Tool to retrieve Onboarding 2.0 process records for new hires from SAP SuccessFactors using OData V2 protocol. Use when you need to query onboarding workflow information with filtering, sorting, and field selection capabilities. |
| `SAP_SUCCESSFACTORS_GET_PENDING_FEEDBACK_REQUESTS_FEEDBACK` | Get Pending Feedback Requests | Tool to retrieve pending feedback requests or feedback request records from SAP SuccessFactors Continuous Feedback. Use when you need to query feedback requests with filtering, sorting, pagination, and field selection capabilities. Supports standard OData v4 query operations for flexible data retrieval. |
| `SAP_SUCCESSFACTORS_GET_PER_PERSONAL` | Get Personal Information Records | Tool to retrieve personal information records from SAP SuccessFactors Employee Central. The PerPersonal entity contains non-effective-dated biographical information, emergency contacts, social media accounts, and email addresses. Use when you need to access personal information data. |
| `SAP_SUCCESSFACTORS_GET_PER_PERSON_BY_ID` | Get Person by ID | Tool to retrieve person information for an employee by their external person ID. Use when you need to access core personal information data from SAP SuccessFactors Employee Central PerPerson entity. |
| `SAP_SUCCESSFACTORS_GET_PICKLIST` | Get Picklist | Tool to retrieve picklist definitions from SAP SuccessFactors. Use when you need to fetch selectable value lists (picklists) that are used across various SuccessFactors entities. |
| `SAP_SUCCESSFACTORS_GET_PICKLIST_OPTION` | Get Picklist Option | Retrieves picklist option values with localized labels from SAP SuccessFactors. Use the localeLabel property to get text in the locale of the logged-in user. Supports OData query parameters for filtering, selection, and pagination. |
| `SAP_SUCCESSFACTORS_GET_POSITION` | Get Position | Retrieves position management records from SAP SuccessFactors Employee Central. Use when you need to query position structure and hierarchy information. |
| `SAP_SUCCESSFACTORS_GET_TALENT_POOL` | Get Talent Pool | Retrieves talent pool records including members and nomination details. Use when you need to access talent pool information for succession planning. |
| `SAP_SUCCESSFACTORS_GET_TEMPORARY_TIME_INFORMATION` | Get Temporary Time Information | Retrieves temporary time information records from Time Management module. Use when you need to query temporary work schedules assigned to employees. |
| `SAP_SUCCESSFACTORS_GET_TIME_ACCOUNT_SNAPSHOT` | Get Time Account Snapshot | Retrieves time account snapshot data for leave liability calculation and payroll. Use when you need balance information for employee time accounts as of a specific point in time. |
| `SAP_SUCCESSFACTORS_GET_WORK_ORDER` | Get Work Order | Tool to retrieve work order records for contingent worker management from SAP SuccessFactors. Use when you need to query work order information with support for filtering, field selection, and pagination via OData query options. |
| `SAP_SUCCESSFACTORS_GIVE_OR_RESPOND_FEEDBACK` | Give Feedback or Respond to Feedback Request | Tool to give performance feedback or respond to a feedback request in SAP SuccessFactors Continuous Performance Management. Use when you need to provide feedback on employee performance, strengths, development areas, or respond to existing feedback requests. Supports up to 3 question-answer pairs with extended field lengths (4000 characters per answer). |
| `SAP_SUCCESSFACTORS_LIST_CANDIDATES` | List Candidates | Tool to retrieve a list of candidates from SAP SuccessFactors. Use when you need to query candidate data with OData filtering and pagination options. |
| `SAP_SUCCESSFACTORS_LIST_EMP_EMPLOYMENT` | List Employee Employment Records | Tool to retrieve a list of all employment records from SAP SuccessFactors. Use when you need to query employment data including start dates, employment types, and assignment classes. Supports filtering by custom string fields (custom-string1, custom-string2, custom-string3) and userId. |
| `SAP_SUCCESSFACTORS_LIST_PER_PERSON` | List Person Records | Tool to retrieve a list of person records from SAP SuccessFactors Employee Central. Use when you need to query employee personal information. The PerPerson entity is the foundation for all employee data in Employee Central and always returns the latest active record for each person. |
| `SAP_SUCCESSFACTORS_LIST_USERS` | List Users | Tool to retrieve a list of all employee users from SAP SuccessFactors. Use when you need to query user information with support for filtering, field selection, and pagination via OData query options. |
| `SAP_SUCCESSFACTORS_QUERY_ALL_AVAILABLE_CLOCK_CLOCK_OUT` | Query All Available Clock In/Clock Out Groups | Query all available clock in/clock out groups. Use when you need to retrieve a list of all clock in/clock out groups configured in SAP SuccessFactors. |
| `SAP_SUCCESSFACTORS_QUERY_CLOCK_CLOCK_OUT_GROUP_CODE_TIME` | Query Clock In/Clock Out Group By Code | Query a clock in/clock out group by code with time event types. Use when you need to retrieve details of a specific Clock In Clock Out Group including its configuration and optionally related Time Event Types. |
| `SAP_SUCCESSFACTORS_REFRESH_CDP_LEARNING_METADATA` | Refresh CDP Learning Metadata | Refresh metadata for Career Development Planning Learning service. |
| `SAP_SUCCESSFACTORS_REFRESH_METADATA_CONT_FEEDBACK_SERVICE` | Refresh Metadata for Continuous Feedback | Refresh metadata cache for Continuous Feedback service. Use when metadata changes need to be applied without service interruption. |
| `SAP_SUCCESSFACTORS_UPDATE_CALIBRATION_SUBJECT_RATINGS` | Update Calibration Subject Ratings | Update a subject's competency ratings in a calibration session. |
| `SAP_SUCCESSFACTORS_UPDATE_INTERNAL_USERNAME_NEW_HIRES_AFTER` | Update Username Post Hiring | Update the internal username of new hires after hiring process is completed from Active Directory. Use after Manage Pending Hire (MPH) submit and before day 1 (pre-conversion). Requires 'Manage Onboarding 2.0 or Offboarding 2.0 Update New Hire Data for External HRIS' permission. |

## Supported Triggers

None listed.

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

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

### 1. Getting API Keys for OpenAI, Composio, and Sap successfactors

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 Sap successfactors 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, sap successfactors)
- 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 Sap successfactors 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=["sap_successfactors"],
    )

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

  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 Sap successfactors 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 Sap successfactors
```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 Sap successfactors, 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=["sap_successfactors"],
    )

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

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

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

## Related Toolkits

- [Ashby](https://composio.dev/toolkits/ashby) - Ashby is an applicant tracking system that handles job postings, candidate management, and hiring analytics.
- [Async interview](https://composio.dev/toolkits/async_interview) - Async interview is an on-demand video interview platform for streamlined hiring. Candidates record responses on their schedule, so employers can review anytime.
- [Bamboohr](https://composio.dev/toolkits/bamboohr) - BambooHR is a cloud-based HR management platform for small and mid-sized businesses. It streamlines employee data, HR workflows, and reporting in one easy interface.
- [Breathe HR](https://composio.dev/toolkits/breathehr) - Breathe HR is cloud-based HR software for SMEs to manage employee data, absences, and performance. It simplifies HR admin, making it easy to keep employee records accurate and up to date.
- [Connecteam](https://composio.dev/toolkits/connecteam) - Connecteam is a workforce management platform for deskless teams, streamlining operations, HR, and team communication. It helps businesses save time by automating scheduling, time tracking, and staff engagement tasks.
- [Lever](https://composio.dev/toolkits/lever) - Lever is an applicant tracking system that blends sourcing, CRM, and analytics for recruiting. It helps companies scale hiring with collaborative workflows and actionable insights.
- [Recruitee](https://composio.dev/toolkits/recruitee) - Recruitee is collaborative hiring software that centralizes recruitment tasks for teams. It streamlines sourcing, interviewing, and hiring so you can fill roles faster.
- [Remote retrieval](https://composio.dev/toolkits/remote_retrieval) - Remote retrieval is a logistics automation tool for managing laptop and monitor returns. It streamlines return tracking, saving time and hassle for IT and ops teams.
- [Talenthr](https://composio.dev/toolkits/talenthr) - TalentHR is an intuitive, all-in-one HR tool for managing employee records, leave, and HR workflows. It streamlines HR operations so businesses can focus on people, not paperwork.
- [Workable](https://composio.dev/toolkits/workable) - Workable is an all-in-one HR software platform that streamlines hiring, employee management, and payroll. It helps teams simplify recruiting, onboarding, and staff operations in one place.
- [Workday](https://composio.dev/toolkits/workday) - Workday is a cloud-based ERP platform for HR, finance, and workforce analytics. It streamlines employee management, payroll, and business operations in a single system.
- [Gmail](https://composio.dev/toolkits/gmail) - Gmail is Google's email service with powerful spam protection, search, and G Suite integration. It keeps your inbox organized and makes communication fast and reliable.
- [Google Calendar](https://composio.dev/toolkits/googlecalendar) - Google Calendar is a time management service for scheduling meetings, events, and reminders. It streamlines personal and team organization with integrated notifications and sharing options.
- [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.
- [Outlook](https://composio.dev/toolkits/outlook) - Outlook is Microsoft's email and calendaring platform for unified communications and scheduling. It helps users stay organized with powerful email, contacts, and calendar management.
- [Twitter](https://composio.dev/toolkits/twitter) - Twitter is a social media platform for sharing real-time updates, conversations, and news. Stay connected, informed, and engaged with communities worldwide.
- [Google Sheets](https://composio.dev/toolkits/googlesheets) - Google Sheets is a cloud-based spreadsheet tool for real-time collaboration and data analysis. It lets teams work together from anywhere, updating information instantly.
- [Supabase](https://composio.dev/toolkits/supabase) - Supabase is an open-source backend platform offering scalable Postgres databases, authentication, storage, and real-time APIs. It lets developers build modern apps without managing infrastructure.
- [Composio](https://composio.dev/toolkits/composio) - Composio is an integration platform that connects AI agents with hundreds of business tools. It streamlines authentication and lets you trigger actions across services—no custom code needed.
- [Notion](https://composio.dev/toolkits/notion) - Notion is a collaborative workspace for notes, docs, wikis, and tasks. It streamlines team knowledge, project tracking, and workflow customization in one place.

## Frequently Asked Questions

### What are the differences in Tool Router MCP and Sap successfactors MCP?

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

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

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

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