# flamey3t1/tm1-mcp-server architecture

> Architecture diagram of the GitHub repository flamey3t1/tm1-mcp-server, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/flamey3t1/tm1-mcp-server
- Repository: https://github.com/flamey3t1/tm1-mcp-server

## Overview

This is an MCP server that lets an MCP-compatible client inspect and manage an IBM Planning Analytics/TM1 model. The principal workflow is a client tool request, registered by the server, handled by a domain tool, and executed through the TM1 client against the server; read-only MCP resources and workflow prompts provide alternate entry points. Separate tool domains cover model structure, data, TI processes and operations, while analysis tools add code-graph and model-audit capabilities. The map follows documented capabilities; several tool-to-service details are inferred only at the documented category level because their source was not sampled.

Main entry points: [`src/tools`](https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools) (TM1 tools), [`src/index.ts`](https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/index.ts) (Server entry), [`src/tools/analysis`](https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/analysis) (Analysis tools), [`src/tm1-client.ts`](https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/tm1-client.ts) (TM1 client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mcp["MCP interface"]
  node_server["Server entry<br/>[index.ts]"]
  node_http["HTTP transport<br/>[http-transport.ts]"]
  node_toolreg["Tool registry<br/>[index.ts]"]
  node_tools["TM1 tools"]
  node_resources["Read resources<br/>[index.ts]"]
  node_prompts["Workflow prompts<br/>[index.ts]"]
end

subgraph group_access["TM1 access"]
  node_tmclient["TM1 client<br/>[tm1-client.ts]"]
  node_session["Session manager<br/>[session-manager.ts]"]
  node_dispatcher["REST dispatcher<br/>[dispatcher.ts]"]
  node_services["Domain services"]
end

subgraph group_lifecycle["Model lifecycle"]
  node_metadata["Metadata and dimensions"]
  node_model["Cubes and subsets"]
  node_cells["Cell and view tools"]
  node_process["TI development"]
  node_schedule["Chore scheduling"]
  node_security["Security tools"]
  node_operations["Operations and files"]
end

subgraph group_insight["Analysis and audits"]
  node_analysis["Analysis tools"]
  node_callgraph["Code graph and metrics"]
  node_feeder["Feeder analysis"]
  node_complexity["Complexity analysis"]
end

node_user(("MCP client"))
node_tm1[("TM1 server")]

node_user -->|"stdio requests"| node_server
node_server -.->|"starts HTTP"| node_http
node_user -.->|"HTTP requests"| node_http
node_server -->|"registers tools"| node_toolreg
node_toolreg -->|"registers"| node_tools
node_server -->|"registers resources"| node_resources
node_server -->|"registers prompts"| node_prompts
node_tools -->|"handles TM1 calls"| node_tmclient
node_resources -->|"reads TM1"| node_tmclient
node_tmclient -->|"authenticates"| node_session
node_tmclient -->|"uses services"| node_services
node_session -->|"sends auth requests"| node_dispatcher
node_services -->|"sends REST requests"| node_dispatcher
node_dispatcher -->|"REST traffic"| node_tm1
node_metadata -->|"registered by"| node_tools
node_model -->|"registered by"| node_tools
node_cells -->|"registered by"| node_tools
node_process -->|"registered by"| node_tools
node_schedule -->|"registered by"| node_tools
node_security -->|"registered by"| node_tools
node_operations -->|"registered by"| node_tools
node_analysis -->|"registered by"| node_tools
node_analysis -->|"analyzes code"| node_callgraph
node_analysis -->|"checks feeders"| node_feeder
node_analysis -->|"audits complexity"| node_complexity

click node_server "https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/index.ts"
click node_http "https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/http-transport.ts"
click node_toolreg "https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/tools/index.ts"
click node_tools "https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools"
click node_resources "https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/resources/index.ts"
click node_prompts "https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/prompts/index.ts"
click node_tmclient "https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/tm1-client.ts"
click node_session "https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/session-manager.ts"
click node_dispatcher "https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/tm1-client/dispatcher.ts"
click node_services "https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tm1-client/services"
click node_metadata "https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/metadata"
click node_model "https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/model-building"
click node_cells "https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/celldata"
click node_process "https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/ti-development"
click node_schedule "https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/scheduling"
click node_security "https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/security"
click node_operations "https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/operations"
click node_analysis "https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/analysis"
click node_callgraph "https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/lib/callgraph"
click node_feeder "https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/lib/feeders"
click node_complexity "https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/lib/complexity"

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_server,node_http,node_toolreg,node_tools,node_resources,node_prompts,node_user toneBlue
class node_tmclient,node_session,node_dispatcher,node_services,node_tm1 toneAmber
class node_metadata,node_model,node_cells,node_process,node_schedule,node_security,node_operations toneMint
class node_analysis,node_callgraph,node_feeder,node_complexity toneRose
```

## Components

### MCP interface

- [Server entry](https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/index.ts): `src/index.ts`
- [HTTP transport](https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/http-transport.ts): `src/http-transport.ts`
- [Tool registry](https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/tools/index.ts): `src/tools/index.ts`
- [TM1 tools](https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools): `src/tools`
- [Read resources](https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/resources/index.ts): `src/resources/index.ts`
- [Workflow prompts](https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/prompts/index.ts): `src/prompts/index.ts`

### TM1 access

- [TM1 client](https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/tm1-client.ts): `src/tm1-client.ts`
- [Session manager](https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/session-manager.ts): `src/session-manager.ts`
- [REST dispatcher](https://github.com/flamey3t1/tm1-mcp-server/blob/main/src/tm1-client/dispatcher.ts): `src/tm1-client/dispatcher.ts`
- [Domain services](https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tm1-client/services): `src/tm1-client/services`

### Model lifecycle

- [Metadata and dimensions](https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/metadata): `src/tools/metadata`
- [Cubes and subsets](https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/model-building): `src/tools/model-building`
- [Cell and view tools](https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/celldata): `src/tools/celldata`
- [TI development](https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/ti-development): `src/tools/ti-development`
- [Chore scheduling](https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/scheduling): `src/tools/scheduling`
- [Security tools](https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/security): `src/tools/security`
- [Operations and files](https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/operations): `src/tools/operations`

### Analysis and audits

- [Analysis tools](https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/tools/analysis): `src/tools/analysis`
- [Code graph and metrics](https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/lib/callgraph): `src/lib/callgraph`
- [Feeder analysis](https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/lib/feeders): `src/lib/feeders`
- [Complexity analysis](https://github.com/flamey3t1/tm1-mcp-server/tree/main/src/lib/complexity): `src/lib/complexity`

### Other components

- **MCP client**
- **TM1 server**

## Connections

- MCP client → Server entry: stdio requests
- Server entry → HTTP transport: starts HTTP
- MCP client → HTTP transport: HTTP requests
- Server entry → Tool registry: registers tools
- Tool registry → TM1 tools: registers
- Server entry → Read resources: registers resources
- Server entry → Workflow prompts: registers prompts
- TM1 tools → TM1 client: handles TM1 calls
- Read resources → TM1 client: reads TM1
- TM1 client → Session manager: authenticates
- TM1 client → Domain services: uses services
- Session manager → REST dispatcher: sends auth requests
- Domain services → REST dispatcher: sends REST requests
- REST dispatcher → TM1 server: REST traffic
- Metadata and dimensions → TM1 tools: registered by
- Cubes and subsets → TM1 tools: registered by
- Cell and view tools → TM1 tools: registered by
- TI development → TM1 tools: registered by
- Chore scheduling → TM1 tools: registered by
- Security tools → TM1 tools: registered by
- Operations and files → TM1 tools: registered by
- Analysis tools → TM1 tools: registered by
- Analysis tools → Code graph and metrics: analyzes code
- Analysis tools → Feeder analysis: checks feeders
- Analysis tools → Complexity analysis: audits complexity
