Hello World MCP FastAPI Endpoint
This project exposes a minimal Model Context Protocol server backed by FastAPI. It registers both a resource and a tool that respond with a “Hello World” message so you can validate your MCP client integration end-to-end.
Setup
Running the server
The readiness probe is available at http://127.0.0.1:8080/, the health endpoint at http://127.0.0.1:8080/healthz, and the MCP streamable HTTP endpoint is mounted at http://127.0.0.1:8080/mcp.
Trying it from an MCP client
Point your MCP-compatible LLM or SDK at http://127.0.0.1:8080/mcp. You should see:
resource://helloreturning"Hello from the Model Context Protocol!"say_hellotool returning a greeting.
These serve as a starting point for wiring up richer resources and tools.
Run with Docker (single command)
The server will be reachable on http://127.0.0.1:8080/ (and /healthz) after the build completes.
MCP (Streamable HTTP)
Endpoint:
https://<service>/mcpCORS: Exposes
Mcp-Session-Idheader for browser clients (Agent Builder).
Tools
ping() -> "pong"server_time(fmt?: string) -> string(UTC)echo(text: string) -> string
Quick checks
Agent Builder
MCP node URL:
https://<service>/mcpAuth: None
After connect, tools
ping,server_time,echoshould be selectable.
MCP (Streamable HTTP)
Endpoint: https://<service>/mcp (no trailing slash required)
Tools
ping() -> "pong"
server_time(fmt?: string) -> string (UTC)
echo(text: string) -> string
date_math(expr: string) -> string (UTC). Examples: "+2h", "-15m", "+1d 30m"
Verify via curl
Agent Builder
Node type: MCP
URL:
https://<service>/mcpTransport: Streamable HTTP
Auth: None
Click Connect → tools should list: ping, server_time, echo, date_math
This server cannot be installed