# Build an MCP

Union.ai supports serving [Model Context Protocol (MCP)](https://modelcontextprotocol.io) servers over HTTP.

There are two main MCP environment types:

| Environment | Purpose |
|-------------|---------|
| **`MCPAppEnvironment`** | Serve any FastMCP instance with custom tools |
| **`FlyteMCPAppEnvironment`** | Flyte-specific server that exposes Flyte operations as tools |

See the sub-pages for detailed guides:
- [User-defined MCP servers](https://www.union.ai/docs/v2/union/user-guide/build-mcp/mcp_server/page.md): Build and deploy your own FastMCP instances
- [Flyte MCP servers](https://www.union.ai/docs/v2/union/user-guide/build-mcp/flyte_mcp_server/page.md): Use Flyte-specific tools to interact with your cluster

## HTTP layout

All MCP app environments expose the same HTTP endpoints:

- `GET /health` — Liveness/readiness check (`{"status": "healthy"}`)
- `POST {mcp_mount_path}/mcp` or `{mcp_mount_path}/sse` — MCP protocol endpoint (default: `/mcp` for generic, `/flyte-mcp` for Flyte)

## Quickstart

The fastest way to try Flyte MCP is locally — no deployment needed:

```bash
uvx --from "flyte[mcp]" flyte-mcp
```

For client setup, tool selection, allowlists, and remote deployment, see [Flyte MCP server](https://www.union.ai/docs/v2/union/user-guide/build-mcp/flyte_mcp_server/page.md).

## Subpages

- [User-defined MCP server](https://www.union.ai/docs/v2/union/user-guide/build-mcp/mcp_server/page.md)
  - When to use it
  - How it works
  - Basic example
  - HTTP layout
  - Choosing a transport
  - Connecting a client
  - Claude Code
  - OpenCode
  - Configuration tips
  - Best practices
- [Flyte MCP server](https://www.union.ai/docs/v2/union/user-guide/build-mcp/flyte_mcp_server/page.md)
  - When to use it
  - How to run it
  - Running locally with `uvx`
  - Deploying remotely
  - Basic example
  - Scoping the server
  - 1. Tool groups
  - 2. Individual tools
  - 3. Allowlists
  - Enabling the search tools
  - Putting it together: a filtered server
  - Connecting a client
  - Claude Code — local (stdio)
  - Claude Code — remote (HTTP)
  - OpenCode — local
  - OpenCode — remote
  - Best practices
  - MCP tools reference

---
**Source**: https://github.com/unionai/unionai-docs/blob/main/content/user-guide/build-mcp/_index.md
**HTML**: https://www.union.ai/docs/v2/union/user-guide/build-mcp/
