Channel faces on every routed application, one _meta segment, and the server GUI as a separate component
Problem
Three application classes expose the same router on different channels: OpenApiApplication (REST and OpenAPI), McpOpenApiApplication (REST, OpenAPI and MCP) and McpApplication (MCP only). McpOpenApiApplication is the most common base, and its name is long.
Each class reserves its own path segments inside the application: _meta and mcp. The rule for what an application may name its own routes is not written anywhere.
The server application _server extends OpenApiApplication, so it has no MCP face. A browser interface for _server is being built on gramlot. If it lives in kajenn, gramlot becomes a required dependency of the core.
Current state
src/kajenn/routed_application.py:1272026-11-03RoutedApplication is BaseApplication plus the genro-routes RoutingClass. Its execute is the single execution point that REST, MCP, WSX and the KajennBus reach.src/kajenn/applications/openapi.py:892026-11-03OpenApiApplication attaches _meta with schema_json, docs (Swagger UI) and index.src/kajenn/applications/mcp.py:3872026-11-03McpOpenApiApplication adds the MCP JSON-RPC face under the segment mcp (mcp_name_segment). The channel plugin decides visibility: the MCP face lists only entries declared for channel mcp, and an undeclared method is REST only.src/kajenn/applications/mcp.py:3232026-11-03McpApplication makes the whole application one JSON-RPC endpoint over an external RoutingClass, with no REST face.src/kajenn/well_known.py:402026-11-03WELL_KNOWN_PATTERN goes to the route the application declared for it in its class dict well_known. No segment inside the application is reserved for it.src/kajenn/server_app/server_app.py:2072026-11-03ServerApplication extends OpenApiApplication.src/kajenn/asgi_server.py:1392026-11-03ServerApplication under _server when no declared application has that code.src/kajenn/server.py:5592026-11-03Proposed solution
Channel faces on RoutedApplication
- The REST/OpenAPI face and the MCP face move into
RoutedApplication. Every application with routes has both, with no switch to turn them off. - The
channelplugin keeps deciding visibility. Turning MCP on everywhere exposes nothing that is not declared for channelmcp. OpenApiApplication,McpOpenApiApplicationandMcpApplicationbecome deprecated aliases, then are removed. No new class name is needed.BaseApplicationstays for applications without routes:RemoteApplicationand raw ASGI applications.
One reserved segment: _meta
Inside a RoutedApplication the only reserved segment is _meta. It holds the administrative routes of the application. Application routes are never under it: a route pippo is reached as /<app>/pippo over REST and as tool pippo over MCP.
| Path | Content | Today |
|---|---|---|
_meta/index | Application page with links to the channel descriptions | _meta/index |
_meta/openapi/schema_json | OpenAPI 3.1 document | _meta/schema_json |
_meta/openapi/docs | Swagger UI | _meta/docs |
POST _meta/mcp | MCP JSON-RPC entry | mcp |
GET _meta/mcp/tools | List of the MCP tools, readable without speaking MCP | none |
The names mcp and api become free for application routes.
Discovery documents are not under _meta: an application declares its well-known URLs in a class dict, and the _well_known branch was removed (well-known-urls, 2026-11-02).
SpaConsole in kajenn-orchestra
SpaConsoleMcpApplication becomes a RoutedApplication. The routes of SpaConsole are declared for channel mcp, so the REST face refuses them. Its MCP client moves from /<mount>/ to /<mount>/_meta/mcp.
Server application: API in kajenn, GUI in its own repository
ServerApplicationstays in kajenn and serves REST and MCP only. It gains MCP by inheriting fromRoutedApplication. kajenn does not depend on gramlot.- The GUI is a component in the repository
kajenn-serverapp-gui, which depends on kajenn and gramlot. - The recipe enables it on the server element:
gui(gui_class=...). Without the element there is no GUI. The core never names the GUI package. ServerApplicationbuilds the component asgui_class(self)(dual relationship) and passes every request onui/...to it. The component releases its resources inon_shutdown. The URL is/_server/ui/.- The GUI reads and writes only through the REST routes of
_server, like any other client.
Extension pages
- The REST routes of an extension keep using
attach_section(section, name)of the core. - The GUI pages of an extension register on the GUI component, only when the component exists.
ServerApplicationexposes the component, orNone. - gramlot is an optional extra of the extension, for example
kajenn-orchestra[gui]. - Pages generated from the OpenAPI description of each section are a future direction. They are not designed here.
Decisions
Consequences
- Two URLs change:
/<app>/_meta/schema_jsonbecomes/<app>/_meta/openapi/schema_json, and/<app>/mcpbecomes/<app>/_meta/mcp. The old URLs answer with a deprecation warning for one minor release. - MCP clients and links to the docs must be updated.
- Every routed application reserves
_meta. A route named_metamust fail at registration. ServerApplicationgains an MCP face.- genropy-kajenn uses
OpenApiApplicationthroughGenropyProxyOpenApiApplication; it keeps working on the alias and must move before the removal. - kajenn-orchestra moves
SpaConsoleMcpApplicationand registers its pool pages on the GUI component.