Skip to content
Status

MCP Gateway / Build and deploy

Build and deploy

Learn how to build, test, and deploy Speakeasy Functions to production.

Deploying Speakeasy Functions is as simple as writing them. Deploying uploads the code to the platform and creates the tools it defines. Deployed functions appear on the Sources tab of MCP Gateway > MCP in the dashboard, ready to be hosted as MCP servers, combined with tools from other sources, and used in multi-tool workflows.

Pushing functions requires the project:write scope on the project the speakeasy CLI is authenticated against. Viewing the resulting source and deployment requires mcp:read and project:read. The default Admin role includes all of these.

Note

Functions do not need to be organized as a single MCP server. They are deployed as individual tools that can be split apart or combined into MCP servers in the dashboard.

The speakeasy functions commands below need Node.js 22.18.0 or later.

To run the tools locally, run the following command:

Terminal window
speakeasy functions dev

This starts the project under the MCP Inspector and reloads it when the code changes.

To build the tools, run the following command:

Terminal window
speakeasy functions build

This writes manifest.json and compiles the tools into a zip file that can be deployed to the platform.

To deploy the tools, run the following command:

Terminal window
speakeasy functions push

This builds the bundle, stages it in speakeasy.deploy.json, uploads it, creates a deployment, and generates the tools the functions define. The CLI prints a link to the deployment page, where the Logs, Assets, and Tools tabs show what was built. In the dashboard, the function source and the tools it created appear on the Sources tab of MCP Gateway > MCP.

speakeasy functions push accepts these options:

  • --slug sets the source slug
  • --project deploys to a project other than the profile’s default
  • --scale sets the number of instances to run
  • --memory-mib sets the memory, in MiB, to allocate
  • --no-build deploys the existing bundle without building first

To add a built bundle to speakeasy.deploy.json without deploying, run speakeasy functions stage, then deploy every staged source with speakeasy push.

The dashboard showing the function source that was just uploaded

Every push deploys every source in the project together, so a failed push leaves the previous deployment active. The Deployments tab lists the history with Retry Deployment and Rollback actions.

With the tools deployed, build an MCP server from them: open the function on the Sources tab and click Build a server, or choose Add new > From an existing source on the MCP page. See Tools on a server to choose which tools it exposes.