Skip to main content
Glama
lacrif
by lacrif

mcp-archimate

Docker Pulls Unit Tests Docker Build & Push

A REST API and MCP (Model Context Protocol) server for querying and modifying ArchiMate models stored in XML or native Archi Tool files.

The API supports multiple simultaneous data sources, each declared in config.json. All data routes are prefixed with the source identifier (/:source_id/).

Data schemas are aligned with the official ArchiMate 3.1 Open Exchange Format XSDs: archimate3_Model.xsd, archimate3_View.xsd, archimate3_Diagram.xsd.

In-memory mutations: Create / update / delete operations modify the model in memory. Changes are lost on server restart unless you call the save endpoint (POST /:source_id/save) to write them back to disk. The API also supports creating new source files and removing sources from the registry.

Purpose

This project provides services for querying and modifying ArchiMate models via:

  1. A REST API (Express / Node.js) for programmatic access and modification of elements, relationships, and views

  2. An MCP server (Model Context Protocol) for integrating models into AI workflows (read and write)

Supported data formats

Format

Extension

Description

Open Exchange Format (OEF)

.xml

Standardised ArchiMate 3.1 export, conforming to the official XSDs

Native Archi Tool

.archimate

Native format of the Archi modelling tool

Configuration (config.json)

The config.json file at the project root declares the data sources to load at startup:

{
  "sources": [
    {
      "id": "open-exchange",
      "name": "Open Exchange Demo",
      "path": "data/open-exchange.xml",
      "format": "oef"
    },
    {
      "id": "archisurance",
      "name": "ArchiSurance",
      "path": "data/archisurance.archimate",
      "format": "archi"
    }
  ]
}

Field

Description

id

Unique source identifier — used as the route prefix (/:source_id/)

name

Human-readable source name

path

Path to the file, relative to the project root

format

"oef" (Open Exchange XML) or "archi" (native Archi Tool format)

All sources are loaded into memory at startup. You can also create and delete sources at runtime via the API — config.json is updated automatically.

Project structure

.
├── config.json                     # Data source declarations
├── data/
│   ├── open-exchange.xml           # ArchiMate model in Open Exchange format
│   └── archisurance.archimate      # ArchiMate model in native Archi Tool format
├── src/
│   ├── schemas.ts                  # TypeScript interfaces: output types + CRUD input types
│   ├── model.ts                    # Open Exchange XML parser (fast-xml-parser)
│   ├── archi-parser.ts             # Native Archi Tool format parser (.archimate)
│   ├── serializer.ts               # XML serializers (ArchiModel → OEF XML / Archi format)
│   ├── registry.ts                 # Data source registry + addSource / removeSource
│   ├── app.ts                      # Express app, REST routes, and MCP server
│   └── main.ts                     # HTTP server entry point
├── tests/
│   └── api.test.ts                 # Unit and integration tests (206 tests)
├── dist/                           # Compiled JavaScript output (generated by tsc)
├── package.json                    # Node.js dependencies
├── tsconfig.json                   # TypeScript configuration
├── Dockerfile                      # Docker image (Node.js 22)
├── docker-compose.yml              # Compose with volumes and watch
└── README.md                       # This file

ArchiMate overview

ArchiMate is an enterprise architecture modelling standard maintained by The Open Group. It provides a common language for describing an architecture from multiple coherent viewpoints.

The model is organised into ArchiMate layers:

  • Strategy: capabilities, resources, courses of action, goals

  • Business: actors, roles, processes, functions, business services

  • Application: application components, interfaces, application services, flows

  • Technology: nodes, systems, technical services, networks, infrastructure

  • Physical: equipment and materials

  • Motivation: goals, principles, constraints, requirements

  • Implementation and Migration: deliverables, plateaus, gaps, work packages

Elements are linked by standardised relationships (Serving, Access, Composition, Aggregation, Realization, Assignment, Flow, Influence, Association, etc.).

Data schemas (ArchiMate 3.1 XSD alignment)

All API fields follow the names defined in the official XSDs.

Element (archimate3_Model.xsdElementType)

Field

Type

Description

identifier

string

Unique identifier (xs:ID)

name

string

Element name

type

string

ArchiMate type (see list below)

documentation

string|null

Text description

properties

PropertyOut[]

Properties: property_definition_ref + value

Relationship (archimate3_Model.xsdRelationshipType)

Field

Type

Description

identifier

string

Unique identifier

type

string

Relationship type (see list below)

source

string

IDREF to the source element

target

string

IDREF to the target element

name

string|null

Optional name

documentation

string|null

Description

properties

PropertyOut[]

Properties

access_type

string|null

Access|Read|Write|ReadWrite (Access relationships only)

is_directed

bool|null

Directed relationship (Association only)

modifier

string|null

Influence strength (Influence only)

View (archimate3_View.xsdViewType)

Field

Type

Description

identifier

string

Unique identifier

name

string

View name

documentation

string|null

Description

viewpoint

string|null

ArchiMate viewpoint (e.g. Layered, Motivation)

node_count

int

Number of nodes in the view

connection_count

int

Number of connections in the view

nodes

NodeOut[]

Diagram nodes (detail endpoint only)

connections

ConnectionOut[]

Diagram connections (detail endpoint only)

Diagram node (archimate3_Diagram.xsdViewNodeType)

Field

Type

Description

identifier

string

Unique node identifier

element_ref

string|null

IDREF to the represented ArchiMate element

x, y

int|null

Position from the top-left corner (pixels)

w, h

int|null

Width and height (pixels)

style

StyleOut|null

Visual style (line_color, fill_color, font)

children

NodeOut[]

Child nodes (nested containers)

Diagram connection (archimate3_Diagram.xsdConnectionType)

Field

Type

Description

identifier

string

Unique connection identifier

relationship_ref

string|null

IDREF to the corresponding ArchiMate relationship

source

string|null

IDREF to the source node

target

string|null

IDREF to the target node

style

StyleOut|null

Connection visual style

Visual style (archimate3_Diagram.xsdStyleType / RGBColorType)

Colours are exposed as decomposed RGB values (r, g, b: 0–255) as defined in the XSD.

Valid element types (archimate3_Model.xsdElementTypeEnum)

62 types in total, organised by layer:

Layer

Types

Business

BusinessActor, BusinessRole, BusinessCollaboration, BusinessInterface, BusinessProcess, BusinessFunction, BusinessInteraction, BusinessEvent, BusinessService, BusinessObject, Contract, Representation, Product

Application

ApplicationComponent, ApplicationCollaboration, ApplicationInterface, ApplicationFunction, ApplicationInteraction, ApplicationProcess, ApplicationEvent, ApplicationService, DataObject

Technology

Node, Device, SystemSoftware, TechnologyCollaboration, TechnologyInterface, Path, CommunicationNetwork, TechnologyFunction, TechnologyProcess, TechnologyInteraction, TechnologyEvent, TechnologyService, Artifact

Physical

Equipment, Facility, DistributionNetwork, Material

Motivation

Stakeholder, Driver, Assessment, Goal, Outcome, Principle, Requirement, Constraint, Meaning, Value

Strategy

Resource, Capability, CourseOfAction, ValueStream

Impl. & Migration

WorkPackage, Deliverable, ImplementationEvent, Plateau, Gap

Composites

Grouping, Location

Junctions

AndJunction, OrJunction

Valid relationship types (archimate3_Model.xsdRelationshipTypeEnum)

Composition, Aggregation, Assignment, Realization, Serving, Access, Influence, Triggering, Flow, Specialization, Association

REST API

The API is available at http://localhost:8000.

Interactive documentation (Swagger UI)

Path

Description

/docs

Swagger UI — interactive exploration of all routes

/openapi.json

OpenAPI 3.0 spec as JSON

The spec is generated dynamically from code: ArchiMate 3.1 type enums are always in sync with the constants in src/schemas.ts.

Source management endpoints

Method

Path

Body

Description

GET

/sources

List all configured sources (with counts)

POST

/sources

SourceCreateInput

Create a new blank model file and register it (returns 201)

DELETE

/sources/{source_id}

Remove a source from the registry (add ?delete_file=true to also delete the file)

POST

/:source_id/save

Serialize the in-memory model and write it back to its file

SourceCreateInput (all fields required):

{
  "id": "my-model",
  "name": "My Model",
  "path": "data/my-model.xml",
  "format": "oef"
}

format must be "oef" (Open Exchange XML) or "archi" (native Archi Tool format).

POST /:source_id/save response:

{ "saved": true, "path": "data/my-model.xml" }

Per-source endpoints (/:source_id/) — Read

Replace :source_id with the source identifier declared in config.json (e.g. open-exchange, archisurance).

Method

Path

Description

GET

/:source_id/

Model metadata (identifier, name, version, counts)

GET

/:source_id/elements/types

Element types present in the model

GET

/:source_id/elements

Elements (filters: type, name)

GET

/:source_id/elements/{identifier}

Element detail

GET

/:source_id/relationships/types

Relationship types present in the model

GET

/:source_id/relationships

Relationships (filters: type, source_id, target_id)

GET

/:source_id/relationships/{identifier}

Relationship detail

GET

/:source_id/views

Views (node_count, connection_count, viewpoint)

GET

/:source_id/views/{identifier}

View detail with nodes, connections, and styles

GET

/:source_id/views/{identifier}/image

SVG or PNG render of the view (?format=svg default, ?format=png requires sharp)

Per-source endpoints (/:source_id/) — Write (in memory)

Method

Path

Body

Description

POST

/:source_id/elements

ElementCreateInput

Create an element (returns 201)

PUT

/:source_id/elements/{identifier}

ElementUpdateInput

Update an element (partial patch)

DELETE

/:source_id/elements/{identifier}

Delete an element and its relationships (returns 204)

POST

/:source_id/relationships

RelationshipCreateInput

Create a relationship (returns 201)

PUT

/:source_id/relationships/{identifier}

RelationshipUpdateInput

Update a relationship (partial patch)

DELETE

/:source_id/relationships/{identifier}

Delete a relationship (returns 204)

Request body — Elements

ElementCreateInput (POST — name and type are required):

{
  "name": "My Application",
  "type": "ApplicationComponent",
  "documentation": "Optional description",
  "properties": [
    { "property_definition_ref": "status", "value": "active" }
  ]
}

ElementUpdateInput (PUT — all fields are optional; only provided fields are modified):

{
  "name": "New name",
  "documentation": null
}

Request body — Relationships

RelationshipCreateInput (POST — type, source, and target are required):

{
  "type": "Association",
  "source": "source-element-id",
  "target": "target-element-id",
  "name": "Optional name",
  "is_directed": true
}

RelationshipUpdateInput (PUT — all fields are optional):

{
  "name": "New name",
  "documentation": "New description"
}

HTTP status codes: 201 created, 204 deleted, 404 not found, 422 invalid type or unknown reference.

Type validation: an invalid type (not in the ArchiMate 3.1 set) returns HTTP 422. An unknown source_id returns HTTP 404.

Cascade on delete: deleting an element also removes all relationships that reference it (as source or target).

Example requests

# List configured sources
curl http://localhost:8000/sources

# Model metadata for the open-exchange source
curl http://localhost:8000/open-exchange/

# ApplicationComponent elements from archisurance
curl "http://localhost:8000/archisurance/elements?type=ApplicationComponent"

# Create an element in open-exchange
curl -X POST http://localhost:8000/open-exchange/elements \
  -H "Content-Type: application/json" \
  -d '{"name": "My Service", "type": "ApplicationService"}'

# Update an element's name
curl -X PUT http://localhost:8000/open-exchange/elements/element-id \
  -H "Content-Type: application/json" \
  -d '{"name": "New name"}'

# Create a relationship between two elements
curl -X POST http://localhost:8000/open-exchange/relationships \
  -H "Content-Type: application/json" \
  -d '{"type": "Serving", "source": "source-id", "target": "target-id"}'

# Delete an element (and its relationships)
curl -X DELETE http://localhost:8000/open-exchange/elements/element-id

# Save in-memory model back to disk
curl -X POST http://localhost:8000/open-exchange/save

# Create a new source (blank model written to data/new-model.xml)
curl -X POST http://localhost:8000/sources \
  -H "Content-Type: application/json" \
  -d '{"id": "new-model", "name": "New Model", "path": "data/new-model.xml", "format": "oef"}'

# Remove a source from the registry and delete its file
curl -X DELETE "http://localhost:8000/sources/new-model?delete_file=true"

# View detail in open-exchange
curl http://localhost:8000/open-exchange/views/view-id

Deployment

Running locally

# Install dependencies
npm install

# Start in development mode (with hot reload)
npm run dev

# Start in production mode
npm start

Running via Docker (Docker Hub image)

Published image: lacrif/mcp-archimate:latest

# Run with data and configuration bundled in the image
docker run -p 8000:8000 lacrif/mcp-archimate:latest

# Mount your own configuration and data
docker run -p 8000:8000 \
    -v /path/to/config.json:/app/config.json:ro \
    -v /path/to/data:/app/data:ro \
    lacrif/mcp-archimate:latest

Running via local Docker build

# Build the image locally
docker build -t mcp-archimate:local .

# Run with local volumes (config + data)
docker run -p 8000:8000 \
    -v ./config.json:/app/config.json:ro \
    -v ./data:/app/data:ro \
    mcp-archimate:local

Docker Compose (volumes + watch)

The docker-compose.yml file automatically mounts config.json and the data/ directory as volumes, and enables automatic reloading via docker compose watch.

# Build and start the service with mounted volumes
docker compose up --build

# Watch mode: automatic rebuild or sync on file changes
docker compose watch

Watch behaviour:

Watched path

Action

Detail

src/

rebuild

Recompiles TypeScript and restarts the container

package.json, package-lock.json

rebuild

Reinstalls dependencies

tsconfig.json

rebuild

Recompiles with the new configuration

config.json

sync+restart

Copies the file and restarts the container

data/

sync

Copies files directly without a rebuild

Using your own models

To point the API at your own ArchiMate files:

  1. Place your files in data/ (.xml OEF or .archimate Archi Tool)

  2. Edit config.json to declare your sources

  3. Restart the server (or let docker compose watch do it)

{
  "sources": [
    {
      "id": "my-model",
      "name": "My Enterprise Architecture",
      "path": "data/my-model.xml",
      "format": "oef"
    }
  ]
}

MCP server

The project exposes an MCP server (read and write), mounted inside the same Express application.

MCP endpoint

  • Base URL: http://localhost:8000/mcp

  • Transport: streamable-http

Exposed MCP tools

Every tool accepts an optional source_id parameter (default: first configured source).

Read

Tool

Description

get_model_info

Global model metadata

list_element_types

Element types present in the model

list_elements

Elements with optional filters (element_type, name)

get_element

Element detail by element_id

list_relationship_types

Relationship types present in the model

list_relationships

Relationships with filters (rel_type, source_id_filter, target_id)

get_relationship

Relationship detail by relationship_id

list_views

Views with node_count, connection_count, viewpoint

get_view

View detail with nodes, connections, and styles

Write (in-memory changes)

Tool

Required parameters

Description

create_element

name, type

Create an ArchiMate element

update_element

element_id

Update an element (partial patch)

delete_element

element_id

Delete an element and its relationships

create_relationship

type, source, target

Create a relationship between two elements

update_relationship

relationship_id

Update a relationship (partial patch)

delete_relationship

relationship_id

Delete a relationship

Rendering

Tool

Required parameters

Description

render_view

view_id

Generate an SVG or PNG image of a view (format: "svg" (default) or "png"). PNG requires the optional sharp package (npm install sharp). The MCP response uses the image content type so AI clients can display it inline.

File persistence

Tool

Required parameters

Description

save_model

Write the in-memory model back to its source file on disk

create_source

id, name, path, format

Create a new blank model file and register it as a source

delete_source

source_id

Remove a source from the registry (set delete_file: true to also delete the file)

Tool descriptions include the valid ArchiMate 3.1 types to guide LLMs.

MCP client configuration

The MCP server uses the streamable-http transport at http://localhost:8000/mcp. The server must be running before any MCP client connects.

Claude Code (CLI)

The .mcp.json file at the project root is automatically detected by Claude Code:

{
    "mcpServers": {
        "mcp-archimate": {
            "type": "http",
            "url": "http://localhost:8000/mcp"
        }
    }
}

Or via the CLI:

claude mcp add mcp-archimate http://localhost:8000/mcp --transport http

Claude Desktop

Edit the Claude Desktop configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

{
    "mcpServers": {
        "mcp-archimate": {
            "type": "http",
            "url": "http://localhost:8000/mcp"
        }
    }
}

Restart Claude Desktop after editing.

VS Code / GitHub Copilot

The .vscode/mcp.json file is already included in the project:

{
    "servers": {
        "mcp-archimate": {
            "url": "http://localhost:8000/mcp",
            "type": "http"
        }
    },
    "inputs": []
}

Enable MCP support in VS Code:

// .vscode/settings.json
{
    "github.copilot.chat.mcp.enabled": true
}

The MCP tools then appear in the Copilot Chat panel (tool icon).

OpenAI Codex CLI

In the Codex configuration file (~/.codex/config.toml):

[mcp_servers.mcp-archimate]
type = "http"
url = "http://localhost:8000/mcp"

Tests

Tests are located in tests/api.test.ts (181 tests) and cover:

  • Unit tests: conversion helpers, colour conversion, XSD constants, CRUD functions (createElement, updateElement, deleteElement, createRelationship, updateRelationship, deleteRelationship), serializers (serializeToOEF, serializeToArchi with round-trip tests), saveModel, listSources

  • Integration tests: all REST endpoints (/sources, CRUD cycles for elements and relationships, POST /sources, DELETE /sources/:id, POST /:source_id/save), MCP service (initialize + tools/list with all 18 tools)

Running tests locally

# Install dependencies
npm install

# Run tests
npm test

Quick reference

  • Data format: ArchiMate 3.1 Open Exchange XML and native Archi Tool format

  • API: Express (REST)

  • MCP server: @modelcontextprotocol/sdk (streamable-http)

  • Runtime: Node.js 22 / TypeScript

  • Default port: 8000

  • MCP endpoint: http://localhost:8000/mcp (streamable-http)

A
license - permissive license
-
quality - not tested
C
maintenance

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lacrif/mcp-archimate'

If you have feedback or need assistance with the MCP directory API, please join our Discord server