Examples
This directory contains example MCP servers built with hypermcp.
Available Examples
A minimal MCP server that demonstrates:
- Basic server setup
- Single tool registration
- Stdio transport
Run it:
cd examples/hello
go run main.go
A server that demonstrates:
- External API calls with HTTP client
- Caching API responses
- Error handling
- Multiple tools
Run it:
cd examples/weather
go run main.go
A server that demonstrates:
- Resource registration
- Resource templates with parameters
- Reading and listing files
- Proper error handling
Run it:
cd examples/fileserver
go run main.go
Testing Examples
You can test any example server using the MCP Inspector or by configuring it in Claude Desktop.
Using MCP Inspector
-
Install the MCP Inspector:
npm install -g @modelcontextprotocol/inspector
-
Run the inspector with your example:
cd examples/hello
mcp-inspector go run main.go
Using with Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"hello-example": {
"command": "go",
"args": ["run", "/path/to/hypermcp/examples/hello/main.go"]
}
}
}
Creating Your Own
Use these examples as templates for your own MCP servers. Each example is self-contained and can be copied as a starting point.
See the main documentation for more details on building MCP servers with hypermcp.