# How to integrate Sap successfactors MCP with LangChain

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

## Introduction

This guide walks you through connecting Sap successfactors to LangChain 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 LangChain 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)
- [Vercel AI SDK](https://composio.dev/toolkits/sap_successfactors/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/sap_successfactors/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/sap_successfactors/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/sap_successfactors/framework/crew-ai)

## TL;DR

Here's what you'll learn:
- Get and set up your OpenAI and Composio API keys
- Connect your Sap successfactors project to Composio
- Create a Tool Router MCP session for Sap successfactors
- Initialize an MCP client and retrieve Sap successfactors tools
- Build a LangChain agent that can interact with Sap successfactors
- Set up an interactive chat interface for testing

## What is LangChain?

LangChain is a framework for developing applications powered by language models. It provides tools and abstractions for building agents that can reason, use tools, and maintain conversation context.
Key features include:
- Agent Framework: Build agents that can use tools and make decisions
- MCP Integration: Connect to external services through Model Context Protocol adapters
- Memory Management: Maintain conversation history across interactions
- Multi-Provider Support: Works with OpenAI, Anthropic, and other LLM providers

## 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

No description provided.

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

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

### 2. Install dependencies

No description provided.
```python
pip install composio-langchain langchain-mcp-adapters langchain python-dotenv
```

```typescript
npm install @composio/langchain @langchain/core @langchain/openai @langchain/mcp-adapters dotenv
```

### 3. Set up environment variables

Create a .env file in your project root.
What's happening:
- COMPOSIO_API_KEY authenticates your requests to Composio's API
- COMPOSIO_USER_ID identifies the user for session management
- OPENAI_API_KEY enables access to OpenAI's language models
```bash
COMPOSIO_API_KEY=your_composio_api_key_here
COMPOSIO_USER_ID=your_composio_user_id_here
OPENAI_API_KEY=your_openai_api_key_here
```

### 4. Import dependencies

No description provided.
```python
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain.agents import create_agent
from dotenv import load_dotenv
from composio import Composio
import asyncio
import os

load_dotenv()
```

```typescript
import { Composio } from '@composio/core';
import { LangchainProvider } from '@composio/langchain';
import { MultiServerMCPClient } from "@langchain/mcp-adapters";
import { createAgent } from "langchain";
import * as readline from 'readline';
import 'dotenv/config';

dotenv.config();
```

### 5. Initialize Composio client

What's happening:
- We're loading the COMPOSIO_API_KEY from environment variables and validating it exists
- Creating a Composio instance that will manage our connection to Sap successfactors tools
- Validating that COMPOSIO_USER_ID is also set before proceeding
```python
async def main():
    composio = Composio(api_key=os.getenv("COMPOSIO_API_KEY"))

    if not os.getenv("COMPOSIO_API_KEY"):
        raise ValueError("COMPOSIO_API_KEY is not set")
    if not os.getenv("COMPOSIO_USER_ID"):
        raise ValueError("COMPOSIO_USER_ID is not set")
```

```typescript
const composioApiKey = process.env.COMPOSIO_API_KEY;
const userId = process.env.COMPOSIO_USER_ID;

if (!composioApiKey) throw new Error('COMPOSIO_API_KEY is not set');
if (!userId) throw new Error('COMPOSIO_USER_ID is not set');

async function main() {
    const composio = new Composio({
        apiKey: composioApiKey as string,
        provider: new LangchainProvider()
    });
```

### 6. Create a Tool Router session

What's happening:
- We're creating a Tool Router session that gives your agent access to Sap successfactors tools
- The create method takes the user ID and specifies which toolkits should be available
- The returned session.mcp.url is the MCP server URL that your agent will use
- This approach allows the agent to dynamically load and use Sap successfactors tools as needed
```python
# Create Tool Router session for Sap successfactors
session = composio.create(
    user_id=os.getenv("COMPOSIO_USER_ID"),
    toolkits=['sap_successfactors']
)

url = session.mcp.url
```

```typescript
const session = await composio.create(
    userId as string,
    {
        toolkits: ['sap_successfactors']
    }
);

const url = session.mcp.url;
```

### 7. Configure the agent with the MCP URL

No description provided.
```python
client = MultiServerMCPClient({
    "sap_successfactors-agent": {
        "transport": "streamable_http",
        "url": session.mcp.url,
        "headers": {
            "x-api-key": os.getenv("COMPOSIO_API_KEY")
        }
    }
})

tools = await client.get_tools()

agent = create_agent("gpt-5", tools)
```

```typescript
const client = new MultiServerMCPClient({
    "sap_successfactors-agent": {
        transport: "http",
        url: url,
        headers: {
            "x-api-key": process.env.COMPOSIO_API_KEY
        }
    }
});

const tools = await client.getTools();

const agent = createAgent({ model: "gpt-5", tools });
```

### 8. Set up interactive chat interface

No description provided.
```python
conversation_history = []

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

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

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

    if not user_input:
        continue

    conversation_history.append({"role": "user", "content": user_input})
    print("\nAgent is thinking...\n")

    response = await agent.ainvoke({"messages": conversation_history})
    conversation_history = response['messages']
    final_response = response['messages'][-1].content
    print(f"Agent: {final_response}\n")
```

```typescript
let conversationHistory: any[] = [];

console.log("Chat started! Type 'exit' or 'quit' to end the conversation.\n");
console.log("Ask any Sap successfactors related question or task to the agent.\n");

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

rl.prompt();

rl.on('line', async (userInput: string) => {
    const trimmedInput = userInput.trim();

    if (['exit', 'quit', 'bye'].includes(trimmedInput.toLowerCase())) {
        console.log("\nGoodbye!");
        rl.close();
        process.exit(0);
    }

    if (!trimmedInput) {
        rl.prompt();
        return;
    }

    conversationHistory.push({ role: "user", content: trimmedInput });
    console.log("\nAgent is thinking...\n");

    const response = await agent.invoke({ messages: conversationHistory });
    conversationHistory = response.messages;

    const finalResponse = response.messages[response.messages.length - 1]?.content;
    console.log(`Agent: ${finalResponse}\n`);
        
        rl.prompt();
    });

    rl.on('close', () => {
        console.log('\n👋 Session ended.');
        process.exit(0);
    });
```

### 9. Run the application

No description provided.
```python
if __name__ == "__main__":
    asyncio.run(main())
```

```typescript
main().catch((err) => {
    console.error('Fatal error:', err);
    process.exit(1);
});
```

## Complete Code

```python
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain.agents import create_agent
from dotenv import load_dotenv
from composio import Composio
import asyncio
import os

load_dotenv()

async def main():
    composio = Composio(api_key=os.getenv("COMPOSIO_API_KEY"))
    
    if not os.getenv("COMPOSIO_API_KEY"):
        raise ValueError("COMPOSIO_API_KEY is not set")
    if not os.getenv("COMPOSIO_USER_ID"):
        raise ValueError("COMPOSIO_USER_ID is not set")
    
    session = composio.create(
        user_id=os.getenv("COMPOSIO_USER_ID"),
        toolkits=['sap_successfactors']
    )

    url = session.mcp.url
    
    client = MultiServerMCPClient({
        "sap_successfactors-agent": {
            "transport": "streamable_http",
            "url": url,
            "headers": {
                "x-api-key": os.getenv("COMPOSIO_API_KEY")
            }
        }
    })
    
    tools = await client.get_tools()
  
    agent = create_agent("gpt-5", tools)
    
    conversation_history = []
    
    print("Chat started! Type 'exit' or 'quit' to end the conversation.\n")
    print("Ask any Sap successfactors related question or task to the agent.\n")
    
    while True:
        user_input = input("You: ").strip()
        
        if user_input.lower() in ['exit', 'quit', 'bye']:
            print("\nGoodbye!")
            break
        
        if not user_input:
            continue
        
        conversation_history.append({"role": "user", "content": user_input})
        print("\nAgent is thinking...\n")
        
        response = await agent.ainvoke({"messages": conversation_history})
        conversation_history = response['messages']
        final_response = response['messages'][-1].content
        print(f"Agent: {final_response}\n")

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

```typescript
import { Composio } from '@composio/core';
import { LangchainProvider } from '@composio/langchain';
import { MultiServerMCPClient } from "@langchain/mcp-adapters";  
import { createAgent } from "langchain";
import * as readline from 'readline';
import 'dotenv/config';

const composioApiKey = process.env.COMPOSIO_API_KEY;
const userId = process.env.COMPOSIO_USER_ID;

if (!composioApiKey) throw new Error('COMPOSIO_API_KEY is not set');
if (!userId) throw new Error('COMPOSIO_USER_ID is not set');

async function main() {
    const composio = new Composio({
        apiKey: composioApiKey as string,
        provider: new LangchainProvider()
    });

    const session = await composio.create(
        userId as string,
        {
            toolkits: ['sap_successfactors']
        }
    );

    const url = session.mcp.url;
    
    const client = new MultiServerMCPClient({
        "sap_successfactors-agent": {
            transport: "http",
            url: url,
            headers: {
                "x-api-key": process.env.COMPOSIO_API_KEY
            }
        }
    });
    
    const tools = await client.getTools();
  
    const agent = createAgent({ model: "gpt-5", tools });
    
    let conversationHistory: any[] = [];
    
    console.log("Chat started! Type 'exit' or 'quit' to end the conversation.\n");
    console.log("Ask any Sap successfactors related question or task to the agent.\n");
    
    const rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout,
        prompt: 'You: '
    });

    rl.prompt();

    rl.on('line', async (userInput: string) => {
        const trimmedInput = userInput.trim();
        
        if (['exit', 'quit', 'bye'].includes(trimmedInput.toLowerCase())) {
            console.log("\nGoodbye!");
            rl.close();
            process.exit(0);
        }
        
        if (!trimmedInput) {
            rl.prompt();
            return;
        }
        
        conversationHistory.push({ role: "user", content: trimmedInput });
        console.log("\nAgent is thinking...\n");
        
        const response = await agent.invoke({ messages: conversationHistory });
        conversationHistory = response.messages;
        
        const finalResponse = response.messages[response.messages.length - 1]?.content;
        console.log(`Agent: ${finalResponse}\n`);
        
        rl.prompt();
    });

    rl.on('close', () => {
        console.log('\nSession ended.');
        process.exit(0);
    });
}

main().catch((err) => {
    console.error('Fatal error:', err);
    process.exit(1);
});
```

## Conclusion

You've successfully built a LangChain agent that can interact with Sap successfactors through Composio's Tool Router.
Key features of this implementation:
- Dynamic tool loading through Composio's Tool Router
- Conversation history maintenance for context-aware responses
- Async Python provides clean, efficient execution of agent workflows
You can extend this further by adding error handling, implementing specific business logic, or integrating additional Composio toolkits to create multi-app workflows.

## 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)
- [Vercel AI SDK](https://composio.dev/toolkits/sap_successfactors/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/sap_successfactors/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/sap_successfactors/framework/llama-index)
- [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 LangChain?

Yes, you can. LangChain 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)
