--- title: Connect to MCP servers from your application slug: /mcp-tutorial --- import Icon from "@site/src/components/icon"; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import McpIcon from '@site/static/logos/mcp-icon.svg'; This tutorial shows you how to connect MCP servers to your applications using Langflow's [**MCP Tools** component](/mcp-client). The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) helps agents integrate with LLMs through _MCP clients_ and _MCP servers_. Specifically, MCP servers host tools that agents (MCP clients) use to complete specialized tasks. MCP servers are connected to MCP clients like Cursor. Then, you interact with the client, and the client uses tools from the connected servers as needed to complete your requests. You can run Langflow as an MCP client and an MCP server: * [Use Langflow as an MCP client](/mcp-client): When run as an MCP client, an **Agent** component in a Langflow flow can use connected components as tools to handle requests. You can use existing components as tools, and you can connect any MCP server to your flow to make that server's tools available to the agent. * [Use Langflow as an MCP server](/mcp-server): When run as an MCP server, your flows become tools that can be used by an MCP client, which could be an external client or another Langflow flow. In this tutorial, you will use the Langflow **MCP Tools** component to connect multiple MCP servers to your flow, and then you'll use a Python application to run your flow and chat with the agent programmatically. ## Prerequisites * [Install and start Langflow](/get-started-installation) * Create a [Langflow API key](/api-keys-and-authentication) * Create an [OpenAI API key](https://platform.openai.com/api-keys) This tutorial uses an OpenAI LLM. If you want to use a different provider, you need a valid credential for that provider. ## Create an agent flow 1. In Langflow, click **New Flow**, and then select the **Simple Agent** template. 2. In the **Agent** component, enter your OpenAI API key. If you want to use a different provider or model, edit the **Model Provider**, **Model Name**, and **API Key** fields accordingly. 3. To test the flow, click