Chi

Lightweight, idiomatic Go HTTP router and mux that's fully compatible with net/http. Uses context.Context for URL parameters (no custom context). Middleware uses standard http.Handler wrapping. All existing net/http middleware, handlers, and tools work with Chi without modification. Preferred by Go developers who want routing convenience without framework lock-in.

Evaluated Mar 07, 2026 (0d ago) v5.x
Homepage ↗ Repo ↗ Developer Tools go golang router http stdlib-compatible middleware lightweight idiomatic
⚙ Agent Friendliness
67
/ 100
Can an agent use this?
🔒 Security
93
/ 100
Is it safe for agents?
⚡ Reliability
92
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
85
Error Messages
82
Auth Simplicity
100
Rate Limits
95

🔒 Security

TLS Enforcement
95
Auth Strength
92
Scope Granularity
90
Dep. Hygiene
95
Secret Handling
92

net/http compatible — standard Go security practices apply. Minimal dependencies reduce attack surface. No framework-specific vulnerabilities.

⚡ Reliability

Uptime/SLA
95
Version Stability
92
Breaking Changes
90
Error Recovery
92
AF Security Reliability

Best When

You're building a Go HTTP service and want idiomatic, stdlib-compatible routing without framework lock-in — Chi is the 'go developer's router.'

Avoid When

You want batteries-included like Gin or Echo — Chi is minimal and requires more manual work for common patterns like JSON binding and error handling.

Use Cases

  • Build Go agent HTTP APIs with clean URL routing and middleware using standard net/http compatibility
  • Add routing and middleware to Go agent services while preserving compatibility with the net/http ecosystem
  • Create composable middleware chains for agent authentication, logging, and rate limiting with standard handlers
  • Build Go microservices where net/http standard library compatibility is required
  • Route WebSocket and SSE agent endpoints alongside REST routes using standard net/http handlers

Not For

  • Applications needing a full-featured framework — Chi is a router, not a framework; no built-in ORM, validation, or response helpers
  • Teams wanting batteries-included like Gin — Chi requires more boilerplate for JSON handling and error responses
  • Projects requiring performance extremes — Gin is faster than Chi for most benchmarks; Fiber (fasthttp) is fastest

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Router library — auth via standard http.Handler middleware (jwtauth, etc.).

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

MIT license. Go-chi organization maintains Chi and related middleware.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • URL parameters are accessed via chi.URLParam(r, "paramName") not context directly — importing chi for every handler file is required; consider a helper wrapper
  • Chi middleware order matters — middleware added at the router level applies to all routes, but route-group middleware only applies within that group; apply security middleware globally
  • Mount() for sub-routers strips the prefix — the sub-router sees the path without the mount prefix; this is intentional but differs from Gin's group behavior
  • Chi doesn't handle 404/405 automatically beyond basic responses — customize via r.NotFound() and r.MethodNotAllowed() handlers for production-quality error responses
  • Chi's stdlib compatibility means no JSON helper built-in — use encoding/json directly or a helper library; Gin's c.JSON() convenience doesn't exist in Chi
  • Server shutdown with in-flight requests requires custom graceful shutdown code — net/http's http.Server.Shutdown() handles this; Chi itself has no shutdown hooks

Alternatives

Full Evaluation Report

Comprehensive deep-dive: security analysis, reliability audit, agent experience review, cost modeling, competitive positioning, and improvement roadmap for Chi.

AI-powered analysis · PDF + markdown · Delivered within 30 minutes

$99

Package Brief

Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.

Delivered within 10 minutes

$3

Score Monitoring

Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.

Continuous monitoring

$3/mo

Scores are editorial opinions as of 2026-03-07.

6470
Packages Evaluated
26150
Need Evaluation
173
Need Re-evaluation
Community Powered