context-mapper-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@context-mapper-mcpList all bounded contexts in my model."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Context Mapper MCP Server
An MCP (Model Context Protocol) server that enables AI assistants to work with Domain-Driven Design models using Context Mapper's CML (Context Mapping Language).
Features
Parse and serialize CML files - Full support for Context Mapper's CML syntax
Manage bounded contexts - Create, update, delete bounded contexts
Work with aggregates - Define entities, value objects, domain events, commands, and services
Context map relationships - Define and manage relationships between bounded contexts (Partnership, SharedKernel, Upstream-Downstream with patterns like OHS, PL, ACL, CF)
Generate PlantUML diagrams - Visualize context maps and aggregate structures
Real-time validation - Catch errors at creation time, not at save time
ID Value Objects - Dedicated tool for creating DDD-compliant identifier types
Related MCP server: Edgee MCP Server
Validation Features
The server validates models in real-time to prevent common CML errors:
Validation | When | Example Error |
Duplicate names | On create |
|
Invalid types | On create |
|
Reserved names | On create |
|
Reserved attributes | On save | Auto-escaped with |
Valid Attribute Types
Primitives:
String,int,long,boolean,DateTime,BigDecimal,UUIDCollections:
List<Type>,Set<Type>References:
- TypeName(reference to domain objects)
Invalid Types (Rejected)
Map<K,V>,Any,Tuple,Runnable,Callbacks, nested generics
Installation
Claude Code
claude mcp add context-mapper -- npx -y context-mapper-mcp@latestClaude Desktop
Add to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"context-mapper": {
"command": "npx",
"args": ["-y", "context-mapper-mcp@latest"]
}
}
}Available Tools
Model Management
Tool | Description |
| Create a new empty CML model |
| Load a CML file |
| Save model to disk |
| Validate CML syntax and semantics |
| Get model statistics |
Query Tools
Tool | Description |
| List all bounded contexts |
| Get context details |
| List aggregates (optionally filtered by context) |
| Get aggregate with all its elements |
| Search by name pattern (regex) |
| List context map relationships |
Context Tools
Tool | Description |
| Create a context map |
| Create a bounded context |
| Update a bounded context |
| Delete a bounded context |
Aggregate Tools
Tool | Description |
| Create an aggregate |
| Update an aggregate |
| Delete an aggregate |
| Add entity to aggregate |
| Add value object |
| Add ID value object (DDD best practice) |
| Add domain event |
| Add command |
| Add domain service |
| Batch create multiple domain objects in one call |
| Delete entity |
| Delete value object |
| Delete domain event |
| Delete command |
| Delete service |
Batch Creation (cml_batch_add_elements)
Create multiple domain objects in a single call for improved efficiency:
{
"contextName": "CustomerManagement",
"aggregateName": "Customer",
"identifiers": [
{ "name": "CustomerId" }
],
"entities": [
{
"name": "Customer",
"aggregateRoot": true,
"attributes": [
{ "name": "id", "type": "- CustomerId", "key": true },
{ "name": "email", "type": "String" }
]
}
],
"valueObjects": [
{
"name": "Address",
"attributes": [
{ "name": "street", "type": "String" },
{ "name": "city", "type": "String" }
]
}
],
"domainEvents": [
{ "name": "CustomerRegistered", "attributes": [{ "name": "customerId", "type": "- CustomerId" }] }
],
"commands": [
{ "name": "RegisterCustomer", "attributes": [{ "name": "email", "type": "String" }] }
]
}Benefits:
Faster: Single round-trip instead of 8+ individual calls
Atomic validation: All elements validated before any are created
Error handling: Use
failFast: falseto collect all errors at once
Relationship Tools
Tool | Description |
| Create context map relationship |
| Update relationship |
| Delete relationship |
| Get relationship details |
Supported relationship types:
Partnership - Symmetric, both contexts cooperate
SharedKernel - Symmetric, shared code/models
UpstreamDownstream - Asymmetric with patterns:
Upstream: OHS (Open Host Service), PL (Published Language)
Downstream: ACL (Anticorruption Layer), CF (Conformist)
Generation Tools
Tool | Description |
| Generate PlantUML context map |
| Generate aggregate class diagram |
| Generate full model diagram |
Example CML File
ContextMap ECommerceContextMap {
type = AS_IS
contains CustomerManagement, OrderManagement, Inventory
CustomerManagement [U,OHS,PL] -> [D,ACL] OrderManagement
OrderManagement [U] -> [D,CF] Inventory
}
BoundedContext CustomerManagement {
domainVisionStatement = "Manages customer data"
implementationTechnology = "TypeScript"
Aggregate Customer {
Entity Customer {
aggregateRoot
key String customerId
String email
String firstName
}
ValueObject Address {
String street
String city
}
DomainEvent CustomerRegistered {
String customerId
Date registeredAt
}
Command RegisterCustomer {
String email
String firstName
}
}
}Development
git clone https://github.com/thijs-hakkenberg/contextmapper_mcp.git
cd contextmapper_mcp
npm install
npm run build
npm testArchitecture
Parser: Chevrotain-based lexer and parser for CML syntax
Writer: Serializes model back to CML format
Validation: Checks model consistency and semantic rules
Tools: MCP tool implementations for all operations
Generators: PlantUML diagram generators
License
MIT
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
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/thijs-hakkenberg/contextmapper_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server