# danielstieger/mcpme architecture

> Architecture diagram of the GitHub repository danielstieger/mcpme, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/danielstieger/mcpme
- Repository: https://github.com/danielstieger/mcpme

## Overview

McpME is an MCP server that exposes a MoWare business application through the same commands, pages, permissions, and validation used by its human interface. An MCP client calls tools at the servlet endpoint; tool handlers operate on a per-session application instance, which reports command and page state through the data-oriented toolkit. Authentication binds requests to a person, while the toolkit represents forms, tables, charts, dialogs, and generated documents. The README documents the full tool set; some implementation details are unsampled, so those relationships are shown only where the excerpts, source index, or README support them.

Main entry points: [`src/main/java/org/modellwerkstatt/mcpme/core/AppInstance.java`](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/AppInstance.java) (App session), [`src/main/java/org/modellwerkstatt/mcpme/McpmeServlet.java`](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/McpmeServlet.java) (MCP servlet), [`src/main/java/org/modellwerkstatt/mcpme/core/McpAppFactory.java`](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/McpAppFactory.java) (Application factory), [`src/main/java/org/modellwerkstatt/mcpme/core/PageView.java`](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/PageView.java) (Page state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_protocol["MCP protocol"]
  node_servlet["MCP servlet<br/>[McpmeServlet.java]"]
  node_catalog["Tool catalog<br/>[ToolCatalog.java]"]
  node_handlers["Tool handlers<br/>[ToolHandlers.java]"]
end

subgraph group_runtime["Application runtime"]
  node_application["MCP application"]
  node_factory["Application factory<br/>[McpAppFactory.java]"]
  node_instance["App session<br/>[AppInstance.java]"]
  node_entry["Command entries<br/>[Entry.java]"]
  node_mainwindow["Main window<br/>[McpMainWindow.java]"]
  node_pageview["Page state<br/>[PageView.java]"]
end

subgraph group_toolkit["Data toolkit"]
  node_commandui["Command window<br/>[McpCommandUi.java]"]
  node_form["Form base<br/>[McpForm.java]"]
  node_table["Table form<br/>[McpTableForm.java]"]
  node_editor["Field editor<br/>[McpEditor.java]"]
  node_chart["Chart form<br/>[McpChartForm.java]"]
  node_chartdata["Chart data adapters"]
  node_seriesdata["Series data adapter"]
end

subgraph group_identity["Identity and output"]
  node_authprovider["Auth provider"]
  node_entra["Entra ID auth"]
  node_verifier["Token verifier<br/>[TokenVerifier.java]"]
  node_print["Print factory"]
end

node_client(("MCP client"))
node_moware["MoWare runtime"]

node_client -->|"calls endpoint"| node_servlet
node_servlet -->|"dispatches tools"| node_handlers
node_servlet -->|"registers tools"| node_catalog
node_servlet -->|"configures app"| node_application
node_servlet -->|"checks identity"| node_authprovider
node_handlers -->|"executes actions"| node_instance
node_application -->|"uses factory"| node_factory
node_application -->|"creates sessions"| node_instance
node_instance -->|"lists entries"| node_entry
node_instance -->|"builds page state"| node_pageview
node_instance -->|"uses window"| node_mainwindow
node_instance -->|"uses command UI"| node_commandui
node_pageview -->|"reads table data"| node_table
node_pageview -->|"reads field data"| node_editor
node_pageview -->|"reads chart data"| node_chart
node_commandui -->|"holds content"| node_form
node_table -->|"extends base"| node_form
node_chart -->|"extends base"| node_form
node_chart -->|"reads pie data"| node_chartdata
node_chart -->|"reads series data"| node_seriesdata
node_factory -->|"creates UI"| node_commandui
node_factory -->|"creates forms"| node_form
node_entra -->|"implements provider"| node_authprovider
node_verifier -->|"uses provider"| node_authprovider
node_print -->|"uses window"| node_mainwindow
node_factory -->|"implements toolkit"| node_moware
node_instance -->|"runs commands"| node_moware

click node_servlet "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/McpmeServlet.java"
click node_catalog "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/ToolCatalog.java"
click node_handlers "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/tools/ToolHandlers.java"
click node_application "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/McpApplication.java"
click node_factory "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/McpAppFactory.java"
click node_instance "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/AppInstance.java"
click node_entry "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/Entry.java"
click node_mainwindow "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/McpMainWindow.java"
click node_pageview "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/PageView.java"
click node_commandui "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/ui/McpCommandUi.java"
click node_form "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/ui/McpForm.java"
click node_table "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/ui/McpTableForm.java"
click node_editor "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/ui/McpEditor.java"
click node_chart "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/ui/McpChartForm.java"
click node_chartdata "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/addons/components/support/CustomDataUxListBound.java"
click node_seriesdata "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/addons/components/support/MultiSeriesUxListBound.java"
click node_authprovider "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/auth/IMcpAuthProvider.java"
click node_entra "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/auth/EntraIdMcpAuth.java"
click node_verifier "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/TokenVerifier.java"
click node_print "https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/print/McpPrintFactory.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_servlet,node_catalog,node_handlers,node_client toneBlue
class node_application,node_factory,node_instance,node_entry,node_mainwindow,node_pageview toneAmber
class node_commandui,node_form,node_table,node_editor,node_chart,node_chartdata,node_seriesdata toneMint
class node_authprovider,node_entra,node_verifier,node_print toneRose
class node_moware toneIndigo
```

## Components

### MCP protocol

- [MCP servlet](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/McpmeServlet.java): `src/main/java/org/modellwerkstatt/mcpme/McpmeServlet.java`
- [Tool catalog](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/ToolCatalog.java): `src/main/java/org/modellwerkstatt/mcpme/ToolCatalog.java`
- [Tool handlers](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/tools/ToolHandlers.java): `src/main/java/org/modellwerkstatt/mcpme/tools/ToolHandlers.java`

### Application runtime

- [MCP application](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/McpApplication.java): `src/main/java/org/modellwerkstatt/mcpme/core/McpApplication.java`
- [Application factory](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/McpAppFactory.java): `src/main/java/org/modellwerkstatt/mcpme/core/McpAppFactory.java`
- [App session](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/AppInstance.java): `src/main/java/org/modellwerkstatt/mcpme/core/AppInstance.java`
- [Command entries](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/Entry.java): `src/main/java/org/modellwerkstatt/mcpme/core/Entry.java`
- [Main window](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/McpMainWindow.java): `src/main/java/org/modellwerkstatt/mcpme/core/McpMainWindow.java`
- [Page state](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/PageView.java): `src/main/java/org/modellwerkstatt/mcpme/core/PageView.java`

### Data toolkit

- [Command window](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/ui/McpCommandUi.java): `src/main/java/org/modellwerkstatt/mcpme/ui/McpCommandUi.java`
- [Form base](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/ui/McpForm.java): `src/main/java/org/modellwerkstatt/mcpme/ui/McpForm.java`
- [Table form](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/ui/McpTableForm.java): `src/main/java/org/modellwerkstatt/mcpme/ui/McpTableForm.java`
- [Field editor](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/ui/McpEditor.java): `src/main/java/org/modellwerkstatt/mcpme/ui/McpEditor.java`
- [Chart form](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/ui/McpChartForm.java): `src/main/java/org/modellwerkstatt/mcpme/ui/McpChartForm.java`
- [Chart data adapters](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/addons/components/support/CustomDataUxListBound.java): `src/main/java/org/modellwerkstatt/addons/components/support/CustomDataUxListBound.java`
- [Series data adapter](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/addons/components/support/MultiSeriesUxListBound.java): `src/main/java/org/modellwerkstatt/addons/components/support/MultiSeriesUxListBound.java`

### Identity and output

- [Auth provider](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/auth/IMcpAuthProvider.java): `src/main/java/org/modellwerkstatt/mcpme/auth/IMcpAuthProvider.java`
- [Entra ID auth](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/auth/EntraIdMcpAuth.java): `src/main/java/org/modellwerkstatt/mcpme/auth/EntraIdMcpAuth.java`
- [Token verifier](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/core/TokenVerifier.java): `src/main/java/org/modellwerkstatt/mcpme/core/TokenVerifier.java`
- [Print factory](https://github.com/danielstieger/mcpme/blob/master/src/main/java/org/modellwerkstatt/mcpme/print/McpPrintFactory.java): `src/main/java/org/modellwerkstatt/mcpme/print/McpPrintFactory.java`

### Other components

- **MCP client**
- **MoWare runtime**

## Connections

- MCP client → MCP servlet: calls endpoint (evidence: `README.md`)
- MCP servlet → Tool handlers: dispatches tools (evidence: `src/main/java/org/modellwerkstatt/mcpme/McpmeServlet.java`)
- MCP servlet → Tool catalog: registers tools (evidence: `src/main/java/org/modellwerkstatt/mcpme/McpmeServlet.java`)
- MCP servlet → MCP application: configures app (evidence: `src/main/java/org/modellwerkstatt/mcpme/McpmeServlet.java`)
- MCP servlet → Auth provider: checks identity (evidence: `src/main/java/org/modellwerkstatt/mcpme/McpmeServlet.java`)
- Tool handlers → App session: executes actions (evidence: `src/main/java/org/modellwerkstatt/mcpme/tools/ToolHandlers.java`)
- MCP application → Application factory: uses factory (evidence: `src/main/java/org/modellwerkstatt/mcpme/core/McpApplication.java`)
- MCP application → App session: creates sessions (evidence: `src/main/java/org/modellwerkstatt/mcpme/core/McpApplication.java`)
- App session → Command entries: lists entries (evidence: `src/main/java/org/modellwerkstatt/mcpme/core/AppInstance.java`)
- App session → Page state: builds page state (evidence: `src/main/java/org/modellwerkstatt/mcpme/core/AppInstance.java`)
- App session → Main window: uses window (evidence: `src/main/java/org/modellwerkstatt/mcpme/core/AppInstance.java`)
- App session → Command window: uses command UI (evidence: `src/main/java/org/modellwerkstatt/mcpme/core/AppInstance.java`)
- Page state → Table form: reads table data (evidence: `src/main/java/org/modellwerkstatt/mcpme/core/PageView.java`)
- Page state → Field editor: reads field data (evidence: `src/main/java/org/modellwerkstatt/mcpme/core/PageView.java`)
- Page state → Chart form: reads chart data (evidence: `src/main/java/org/modellwerkstatt/mcpme/core/PageView.java`)
- Command window → Form base: holds content (evidence: `src/main/java/org/modellwerkstatt/mcpme/ui/McpCommandUi.java`)
- Table form → Form base: extends base (evidence: `src/main/java/org/modellwerkstatt/mcpme/ui/McpTableForm.java`)
- Chart form → Form base: extends base (evidence: `src/main/java/org/modellwerkstatt/mcpme/ui/McpChartForm.java`)
- Chart form → Chart data adapters: reads pie data (evidence: `src/main/java/org/modellwerkstatt/mcpme/ui/McpChartForm.java`)
- Chart form → Series data adapter: reads series data (evidence: `src/main/java/org/modellwerkstatt/mcpme/ui/McpChartForm.java`)
- Application factory → Command window: creates UI (evidence: `src/main/java/org/modellwerkstatt/mcpme/core/McpAppFactory.java`)
- Application factory → Form base: creates forms (evidence: `src/main/java/org/modellwerkstatt/mcpme/core/McpAppFactory.java`)
- Entra ID auth → Auth provider: implements provider (evidence: `src/main/java/org/modellwerkstatt/mcpme/auth/EntraIdMcpAuth.java`)
- Token verifier → Auth provider: uses provider (evidence: `src/main/java/org/modellwerkstatt/mcpme/core/TokenVerifier.java`)
- Print factory → Main window: uses window (evidence: `src/main/java/org/modellwerkstatt/mcpme/print/McpPrintFactory.java`)
- Application factory → MoWare runtime: implements toolkit (evidence: `README.md`)
- App session → MoWare runtime: runs commands (evidence: `README.md`)
