> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blaxel.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP servers

> Deploy MCP servers as serverless APIs to equip your agents with tools.

MCP servers (called `functions` in Blaxel API) are lightweight programs that expose specific capabilities (accessing databases, APIs, local files, etc.) through the standardized [Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP). They are designed to equip [agents](/Agents/Overview) with tools to interact with the world.

## Essentials

MCP Server Hosting is a **serverless computing service that allows you to host remote MCP servers** without having to manage infrastructure. It gives you full [observability and tracing](/Observability/Overview) out of the box.

You only provide the MCP server code, and Blaxel automates its hosting, execution and scaling - providing you with one single global endpoint to access the MCP server. The deployed server uses streamable HTTP as the transport layer.

Blaxel SDK allows to **retrieve the tools from an MCP server in your code**. When both an agent and MCP server run on Blaxel, the tool call in the MCP server is execute separately from the agent logic. This ensures not only optimal resource utilization, but also better design practice for your agentic system.

### Requirements & limitations

* Your MCP server must implement streamable HTTP as its transport layer.

* Deployed MCP servers have a maximum runtime of 15 minutes.

## MCP hosting on Blaxel

Blaxel uses **streamable HTTP** as its MCP transport mechanism. MCP servers deployed on Blaxel are only hosted server-side and cannot be installed locally.

<Info>For developers interested in the technical details, our implementation is available open-source through [Blaxel's Supergateway](https://github.com/blaxel-ai/supergateway) and [Blaxel's SDK](https://github.com/blaxel-ai/toolkit/blob/main/sdk-ts/src/functions/mcp.ts).</Info>

There are two routes you can take when hosting MCPs on Blaxel:

* Use one of the pre-built MCP servers from the Blaxel Store (e.g. [Google Maps](/Integrations/Google-Maps), [Gmail](/Integrations/Gmail))
* Deploy a custom MCP server from your code, or [adapt an existing stdio-based server](/Functions/Adapt-Existing-MCP-server) for Blaxel

<CardGroup cols={2}>
  <Card title="Adapt an existing MCP server" icon="wrench" href="/Functions/Adapt-Existing-MCP-server">
    Convert a stdio MCP server to streamable HTTP and deploy it.
  </Card>

  <Card title="Develop a custom MCP server" icon="code" href="/Functions/Create-MCP-server">
    Build a new MCP server from scratch with Blaxel SDK.
  </Card>

  <Card title="Deploy an MCP server" icon="rocket" href="/Functions/Deploy-a-function">
    Host your MCP server on Blaxel as a serverless endpoint.
  </Card>

  <Card title="Connect to an MCP server" icon="bolt" href="/Functions/Invoke-functions">
    Run tool calls through your deployed MCP server.
  </Card>

  <Card title="Code mode" icon="terminal" href="/Functions/Code-mode">
    Turn any OpenAPI spec into a code mode MCP server.
  </Card>

  <Card title="Variables and secrets" icon="key" href="/Functions/Variables-and-secrets">
    Manage environment variables and secrets for MCP servers.
  </Card>
</CardGroup>

## Related products

MCP servers integrate with other Blaxel products. [Agents](/Agents/Overview) use MCP servers as tools, [sandboxes](/Sandboxes/Overview) include a [built-in MCP server](/Sandboxes/MCP) for agent-driven operations, and [model APIs](/Models/Overview) provide the LLM backbone for agent reasoning. See the [SDK reference](/sdk-reference/introduction) for programmatic access.
