Custom MCP Servers
Learn how to connect your own custom MCP servers to LangDB AI Gateway.
While LangDB provides a rich library of pre-built MCP servers, you can also bring your own. By connecting a custom MCP server, you can leverage all the benefits of a Virtual MCP Server, including:
Unified Interface: Combine your custom tools with tools from other LangDB-managed servers.
Clean Auth Handling: Let LangDB manage authentication, or provide your own API keys and headers.
Full Observability: Get complete tracing for every call, with logs, latencies, and metrics.
Seamless Integration: Works out-of-the-box with clients like Cursor, Claude, and Windsurf.
Enhanced Security: Benefit from version pinning and protection against tool definition poisoning.
This guide explains how to connect your own custom MCP server, whether it uses an HTTP (REST API) or SSE (Server-Sent Events) transport.
Connecting Your Custom Server
When creating a Virtual MCP Server, you can add your own server alongside the servers deployed and managed by LangDB.
Steps to Configure a Custom Server
Navigate to MCP Servers: Go to the "MCP Servers" section in your LangDB project and click "Create Virtual MCP Server".
Add a Custom Server: In the "Server Configuration" section, click the "+ Add Server" button on the right and select "Custom" from the list.
Configure Server Details: A new "Custom Server" block will appear on the left. Fill in the following details:
Server Name: Give your custom server a descriptive name.
Transport Type: Choose either
HTTP (REST API)
orSSE (Server-Sent Events)
from the dropdown.HTTP/SSE URL: Enter the endpoint URL for your custom MCP server. LangDB will attempt to connect to this URL to validate the server and fetch the available tools.
(Optional) HTTP Headers: If your server requires specific HTTP headers for authentication or other purposes, you can add them here.
(Optional) Environment Variables: If your server requires specific configuration via environment variables, you can add them.
Select Tools: Once LangDB successfully connects to your server, it will display a list of all the tools exposed by your MCP server. You can select which tools you want to include in your Virtual MCP Server.
Generate URL: After configuring your custom server and selecting the tools, you can generate the secure URL for your Virtual MCP Server and start using it in your applications.
Last updated
Was this helpful?