How amoylab/unla works
Unla is a Go MCP gateway with a web management UI. Operators sign in, configure tenant-scoped MCP servers and API-backed tools, and persist/version those configurations; MCP clients then invoke the gateway over SSE or Streamable HTTP, which routes configured calls to API or MCP backends and returns MCP results. The graph also captures authentication, sessions, configuration storage and synchronization, and the documented OpenAPI conversion capability. Some backend handlers and UI modules were not sampled, so uncertain implementation-level links are omitted or documented from the README.
Main entry points: App.tsx Management App · server.go MCP Server · apiserver/main.go Management API · mcp-gateway/main.go Gateway Process
Components 25
Management UI
- Management App
web/src/App.tsx - Login
web/src/pages/auth/login.tsx - Gateway Manager
web/src/pages/gateway/gateway-manager.tsx - Config Editor
web/src/pages/gateway/components/ConfigEditor.tsx - OpenAPI Import
web/src/pages/gateway/components/OpenAPIImport.tsx - Capabilities Viewer
web/src/pages/gateway/capabilities.tsx - Config Versions
web/src/pages/gateway/config-versions.tsx - User Management
web/src/pages/users/user-management.tsx - Tenant Management
web/src/pages/users/tenant-management.tsx
Control Plane
- Management API
cmd/apiserver/main.go - Auth and Tenant Handlers
internal/apiserver/handler/auth.go - OAuth Support
internal/auth/oauth.go
MCP Runtime
- Gateway Process
cmd/mcp-gateway/main.go - MCP Server
internal/core/server.go - Tool Response Handling
internal/core/handler.go - Template Rendering
internal/template/renderer.go
Persistence
- Session Store
internal/mcp/session/session.go - MCP Config Store
internal/mcp/storage/store.go - User Database
internal/apiserver/database/database.go - Config Notifier
internal/mcp/storage/notifier/notifier.go
Backend Integrations
- Configured APIs
- Existing MCP Servers
- OpenAPI Converter
pkg/openapi/converter.go
Other components
- Operator
- MCP Client
Connections 31
- Operator → Management App: uses
README.md - Management App → Login: routes to
web/src/App.tsx - Management App → Gateway Manager: routes to
web/src/App.tsx - Management App → Capabilities Viewer: routes to
web/src/App.tsx - Management App → Config Versions: routes to
web/src/App.tsx - Management App → User Management: routes to
web/src/App.tsx - Management App → Tenant Management: routes to
web/src/App.tsx - Gateway Manager → Config Editor: renders
web/src/pages/gateway/gateway-manager.tsx - Gateway Manager → OpenAPI Import: renders
web/src/pages/gateway/gateway-manager.tsx - Gateway Manager → Management API: manages configs
README.md - Login → Management API: authenticates
- User Management → Management API: manages users
- Tenant Management → Management API: manages tenants
- Management API → Auth and Tenant Handlers: routes requests
cmd/apiserver/main.go - Auth and Tenant Handlers → User Database: reads and writes
internal/apiserver/handler/auth.go - Management API → MCP Config Store: initializes
cmd/apiserver/main.go - Management API → Config Notifier: initializes
cmd/apiserver/main.go - Auth and Tenant Handlers → OAuth Support: uses
- OpenAPI Import → OpenAPI Converter: imports spec
- Operator → OpenAPI Converter: converts spec
README.md - MCP Client → MCP Server: invokes tools
README.md - Gateway Process → MCP Server: starts
cmd/mcp-gateway/main.go - Gateway Process → MCP Config Store: initializes
cmd/mcp-gateway/main.go - Gateway Process → Session Store: initializes
cmd/mcp-gateway/main.go - Gateway Process → Config Notifier: initializes
cmd/mcp-gateway/main.go - MCP Server → MCP Config Store: loads config
internal/core/server.go - MCP Server → Session Store: uses sessions
internal/core/server.go - MCP Server → Tool Response Handling: handles responses
internal/core/server.go - Tool Response Handling → Template Rendering: renders templates
internal/core/handler.go - MCP Server → Configured APIs: calls configured APIs
README.md - MCP Server → Existing MCP Servers: proxies MCP
README.md