Skip to main content
This guide walks you through building a custom MCP server with real tools, deploying it to ezForge, and connecting it to an AI assistant.

What you’ll build

A simple MCP server with two tools:
  • get_weather — fetches current weather for a city (simulated)
  • list_cities — returns a list of supported cities

Prerequisites

Completed the Quickstart and have the CLI installed and authenticated.

1. Scaffold the project

2. Add your tools

Replace the contents of src/index.ts with:

3. Set the server name in ezforge.toml

4. Deploy

Your server is now live at https://weather-server.mcp.ezforge.ai.

5. Test the tools

Test the health check:
Connect from any MCP client using the SSE endpoint:

6. View logs

What’s next?

  • Add secrets — Store API keys as environment variables with ezforge env set
  • Enable auth — Protect your server with OAuth 2.1 (see Authentication)
  • Set up auto-stop — Configure idle timeout in ezforge.toml to save costs
  • Deploy updates — Push changes with ezforge deploy; auto-rollback protects you from bad deploys