Skip to main content
This guide will walk you through the steps to add a MCP server to the TrueFoundry AI Gateway and then use it in the playground or through Cursor/VSCode/Claude or in your code agents.
1

Add an MCP Server

To add an MCP server, you can either create one from scratch or add a public MCP server.Add MCP ServerAdd MCP ServerIf you want to build a MCP server from scratch, you can follow the tutorial below to create a Calculator MCP Server or you can add an existing remote MCP server.
Let’s create a simple calculator MCP server that provides basic math operations.
from fastmcp import FastMCP

mcp = FastMCP("Calculator MCP Server")

@mcp.tool
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b

@mcp.tool
def subtract(a: int, b: int) -> int:
    """Subtract two numbers"""
    return a - b

@mcp.tool
def multiply(a: int, b: int) -> int:
    """Multiply two numbers"""
    return a * b

@mcp.tool
def divide(a: float, b: float) -> float:
    """Divide two numbers"""
    if b == 0:
        raise ValueError("Cannot divide by zero")
    return a / b

@mcp.tool
def power(a: int, b: int) -> int:
    """Raise a number to the power of another number"""
    return a ** b

if __name__ == "__main__":
    mcp.run(transport="http", host="0.0.0.0", port=8000, path="/mcp")
Run locally:
# Install dependencies
pip install -r requirements.txt

# Run the server
python server.py
Your MCP server will be available at http://localhost:8000/mcp.
We have already added this code to a Github Repo and deployed it on our live demo link:Repository: You can find the complete example code at: Calculator MCP ServerDeployment: You can find the live demo link at: Calculator MCP Server DeploymentServer Endpoint: The MCP server can be accessed at this endpoint: https://calculator-mcp-server.apps.live-demo.truefoundry.cloud
To add this MCP server to your MCP group, provide the following details:
FieldValue
Namecalculator-mcp-server
Endpoint URLhttps://calculator-mcp-server.apps.live-demo.truefoundry.cloud
DescriptionA simple calculator MCP server
AuthenticationNo Auth
To add a custom Remote MCP server, click on Remote MCP button and then provide the following details:
FieldDescription
NameA descriptive name for the MCP server
DescriptionA description of the MCP server
URLThe URL of the MCP server
Transportstreamable-http or sse. Note that sse is deprecated
CollaboratorsUsers and Teams that have access to this MCP server with their roles. See Collaborators below
Auth DataThe authentication mechanism: No Auth, Header Auth, DCR, or OAuth2. See Authentication and Security for details

Collaborators

The Collaborators section allows you to control who can access and manage this MCP server. You can add individual users or entire teams and assign them specific roles:MCP Server Collaborators
RoleDescription
MCP Server ManagerFull access to manage the MCP server, including editing configuration, managing collaborators, and deleting the server
MCP Server UserCan use the MCP server’s tools in the playground and IDEs, but cannot modify server settings
Click + Add Collaborators to add more users or teams. You can also click View Permission Details to see the complete list of permissions for each role.
2

Use MCP Server in Your IDE

Once you’ve added an MCP server, you can easily integrate it with your favorite IDE or AI coding assistant. Navigate to the MCP server details page and click on the How To Use tab.Use MCP Server in IDE
Use the Add MCP to Cursor button to automatically add the MCP server configuration to your Cursor IDE. You can also click Show API Key to reveal the full authorization token, or Copy to copy the configuration to your clipboard.
3

Use MCP Servers in Playground

You can select the MCP servers from the playground, select the tools and send your prompt to see which tools are being called.