Now that you have your code written, run your MCP server and connect it to Claude. This is where everything comes together.
First, start your MCP server. In your terminal, from the project directory, run:
uv run --with mcp main.py
You should see output indicating that Uvicorn is running on http://127.0.0.1:8000. Your server is now running locally, but Claude needs an HTTPS endpoint to connect to.
Running Ngrok
This is where ngrok comes in. Ngrok creates a secure tunnel from the internet to your local server. If you haven’t installed ngrok yet, visit ngrok.com/download and follow the installation instructions. Once installed, open a new terminal window and run:
ngrok http 8000 --host-header "localhost:8000"
Ngrok will display a forwarding URL that looks something like https://something-random.ngrok-free.app. Copy this URL. You’ll need it to configure the connector.
Connecting MCP Server to Claude
Important Plan Requirement: Custom connectors using remote MCP are available on Claude and Claude Desktop for users on Pro, Max, Team, and Enterprise plans. This feature is not available to Free plans.
Now add your MCP server to Claude. Click on your profile picture or avatar in the bottom-left corner and select Settings. In the settings window, navigate to the Connectors tab on the left sidebar. From here, click on the Add custom connector button.
You’ll see a dialog where you can enter your server details. Give your connector a descriptive name; I’m calling mine “Dog Human-Age Calculator”. In the URL field, paste your ngrok URL and ensure you add /mcp at the end. It should look like https://your-ngrok-url.ngrok-free.app/mcp. Click Add.
You should now see your custom connector in the list.
Testing MCP Server
Now for the exciting part: testing the server. Before you start, ensure you have the Opus 4.5 model selected in the chat interface, as we’ll be using it for this demo.
Type a question like: “My dog is 3 years old. If my dog were a human, how old would she be?”
When you press Enter, Claude recognizes that this question can be answered using your MCP tool. You’ll see a permission dialog asking if Claude can use the Dog Human-Age Calculator. This permission system is an important security feature. Claude won’t use external tools without your explicit consent. Click Allow once.
And there it is! Claude used your MCP server to calculate that a 3-year-old dog is equivalent to a 28-year-old human.
You’ve just built and deployed your first MCP server. Congratulations!