
hamr
by AKhilRaghav0·★ 18·Score 43
A Go framework for building MCP servers with automatic schema generation from struct tags, optimizing for token cost.
Overview
hamr is a minimalist Go framework for building MCP servers that eliminates boilerplate code by automatically generating JSON schemas from Go struct tags. It provides a higher-level abstraction than the official Go SDK with features like tool grouping, minimal schemas mode, response truncation, cost tracking, and middleware support. The framework is particularly focused on reducing token overhead in AI conversations, making it ideal for production use where efficiency matters.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Teams building MCP servers in Go who want to minimize boilerplate and optimize token costs, especially when working with multiple tools.
When NOT to choose this
If you need the latest MCP protocol features, official backing, or output schemas/progress tracking which aren't yet supported in hamr.
Tools this server exposes
12 tools extracted from the READMEsearchfunc(ctx context.Context, input SearchInput) (string, error)Search for information
read_filefunc(ctx context.Context, input ReadFileInput) (string, error)Read a file from the filesystem
write_filefunc(ctx context.Context, input WriteFileInput) (string, error)Write content to a file
list_dirfunc(ctx context.Context, input ListDirInput) (string, error)List directory contents
queryfunc(ctx context.Context, input QueryInput) (string, error)Run a SELECT query against the database
list_tablesfunc(ctx context.Context, input ListTablesInput) (string, error)List available database tables
http_getfunc(ctx context.Context, input HTTPGetInput) (string, error)Make an HTTP GET request to a URL
http_postfunc(ctx context.Context, input HTTPPostInput) (string, error)Make an HTTP POST request to a URL
run_commandfunc(ctx context.Context, input RunCommandInput) (string, error)Run a shell command in a sandboxed environment
git_statusfunc(ctx context.Context, input GitStatusInput) (string, error)Show the current git repository status
git_difffunc(ctx context.Context, input GitDiffInput) (string, error)Show the differences between files
git_logfunc(ctx context.Context, input GitLogInput) (string, error)Show commit history
Comparable tools
Installation
Installation
Install the CLI:
go install github.com/AKhilRaghav0/hamr/cmd/hamr@latestScaffold a new project:
hamr init my-server
cd my-server
go run .Add to existing Go project:
go get github.com/AKhilRaghav0/hamrClaude Desktop Configuration
{
"mcpServers": {
"my-server": {
"command": "go",
"args": ["run", "/path/to/my-server"]
}
}
}FAQ
- How does hamr differ from the official Go SDK?
- hamr is a higher-level framework built on top of the official SDK, focusing on ergonomics and token optimization. It offers automatic schema generation, tool grouping, middleware, and built-in optimization features like minimal schemas and response truncation that the SDK doesn't provide.
- Can I use hamr if I need the latest MCP protocol features?
- The official Go SDK will always be first to get new protocol features. hamr is best for use cases where token optimization and developer productivity are priorities, not for bleeding-edge protocol support.
Compare hamr with
Last updated · Auto-generated from public README + GitHub signals.