We're going to create a simple server that:
- Has a tool called "say_hello"
- When Claude uses this tool, it responds with "Hello World!"
- You can see this working right inside Claude Desktop
Think of it like teaching Claude a new skill - in this case, how to say hello!
You'll need:
- A free Replit account (we'll show you how to sign up)
- Claude Desktop installed on your computer
- About 15-20 minutes of time
That's it! No coding experience needed.
- Go to replit.com
- Click "Sign up" in the top right
- You can sign up with Google, GitHub, or create a new account
- Once logged in, you'll see your dashboard
- On your Replit dashboard, click the big "+ Create" button
- Choose "Python" as your template (don't worry, we'll give you all the code!)
- Name your project something like my-first-mcp-server
- Click "Create"
You'll now see a code editor with a file called
Delete everything in
from mcp.server.fastmcp import FastMCP
# Create your MCP server
mcp = FastMCP("My Hello World Server")
# Create a tool that says hello
@mcp.tool()
def say_hello(name: str = "World") -> str:
"""Say hello to someone"""
return f"Hello, {name}! π"
# Run the server
if __name__ == "__main__":
mcp.run()
Don't worry about understanding every line - this code creates a simple server with one tool that says hello!
- Look for a file called pyproject.tomlin the left sidebar.
- If you don't see it, click the "+" button next to "Files" and create a new file named pyproject.toml.
- Replace everything in pyproject.tomlwith:
[project]
name = "my-hello-world-server"
version = "0.1.0"
description = "My first MCP server"
requires-python = ">=3.10"
dependencies = [
"mcp[cli]"
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
- Click the "Run" button at the top of Replit.
The first time you run it, Replit will install the necessary packages. You might see some text scrolling by - that's normal!
When your server runs, you should see something like:
Now we need to make it accessible from outside Replit:
- In Replit, look for the "Shell" tab (usually at the bottom).
- Type this command and press Enter:
Shell Command
python -m uvicorn main:mcp.asgi_app --host 0.0.0.0 --port 3000
- You should see a message saying your server is running.
- Look for a small window that pops up showing a URL (something like https://my-first-mcp-server.yourusername.repl.co).
- Copy this URL - you'll need it in the next step!
Now for the exciting part - connecting your server to Claude!
- Open Claude Desktop on your computer.
- Click on the Claude menu (on Mac) or File menu (on Windows).
- Select Settings.
- Click on Developer in the left sidebar.
- Click Edit Config.
This opens a configuration file. Replace everything in it with:
{
"mcpServers": {
"my-hello-world": {
"url": "YOUR_REPLIT_URL_HERE/sse"
}
}
}
Important!
For example, if your Replit URL is
{
"mcpServers": {
"my-hello-world": {
"url": "https://my-first-mcp-server.johndoe.repl.co/sse"
}
}
}
- Save the file (Cmd+S on Mac, Ctrl+S on Windows).
- Restart Claude Desktop (quit completely and open it again).
- Open Claude Desktop.
- Look for a small hammer icon π¨ in the text input area.
- Click on it - you should see "say_hello" listed as an available tool!
- Try typing: "Can you say hello to me?"
Claude should use your tool and respond with a greeting!
You can also try:
- "Say hello to Alice"
- "Use the say_hello tool to greet the world"
If something isn't working:
Server not showing in Claude:
- Make sure your Replit server is still running (the Shell should show it's active).
- Double-check your Claude configuration file has the correct URL.
- Try restarting Claude Desktop again.
Replit stopped running:
- Click "Run" again in Replit.
- Re-run the uvicorn command in the Shell.
Can't see the hammer icon:
- Make sure you saved the configuration file.
- Restart Claude Desktop completely (quit and reopen).
Congratulations! You've just:
- Created your first MCP server.
- Deployed it online using Replit.
- Connected it to Claude Desktop.
- Gave Claude a new tool to use.
This is the foundation for building more complex MCP servers that can do amazing things like:
- Search the web
- Read and write files
- Connect to databases
- Interact with APIs
- And much more!
Want to customize your server? Try these simple modifications:
- Change the greeting:In your code, find the line with "Hello, {name}! π"and change it to something else.
- Add a new tool:Add this code after your first tool:
@mcp.tool() def say_goodbye(name: str = "World") -> str: """Say goodbye to someone""" return f"Goodbye, {name}! See you later! π"
Remember to restart your server in Replit after making changes!
- Keep your Replit tab open while using the server in Claude.
- Your free Replit server might go to sleep after inactivity - just click "Run" again to wake it up.
- Save your Replit project URL somewhere safe so you can find it again.