architecture-pattern-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., "@architecture-pattern-mcpDesign a scalable architecture for a real-time chat application."
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.
architecture-pattern-mcp
An MCP (Model Context Protocol) server that provides architecture design expertise to AI coding agents. Given a requirements string and a domain, it analyses the problem, selects matching architecture patterns (from 36+ built-in patterns), generates a concrete architecture design with components, relationships, API contracts, data models, and event contracts, and evaluates it against quality attributes (maintainability, scalability, reliability, security, performance).
Prerequisites
Python 3.12+
uv (fast Python package manager)
Docker & Docker Compose (for containerized deployment)
API key for an LLM provider (OpenAI, MiniMax, Anthropic, etc.)
Related MCP server: MarkdownLM MCP Server
Quick Start — Docker
1. Clone and configure
git clone https://github.com/architecture-pattern/architecture-pattern-mcp.git
cd architecture-pattern-mcp
cp config/config.json ~/.config/architecture-pattern-mcp/config.jsonAdd your API keys to ~/.config/architecture-pattern-mcp/config.json or export them as environment variables (see Environment Variables):
export GENERATOR_API_KEY=your_key_hereNote for Docker users: The docker compose file ships
MINIMAXAI_API_KEYas the outer env var and maps it toGENERATOR_API_KEYinside the container. If you setGENERATOR_API_KEYdirectly (as shown above), it takes precedence and works for both local and Docker runs.
2. Build and start
# Option A: via docker compose (builds + starts)
docker compose -f docker/docker-compose.yml up --build
# Option B: via make (builds the image, then starts services)
make docker-build
make docker-upThe MCP server starts on streamable-http transport on port 8050. The TEI embedder container (Qwen3-Embedding-0.6B) must be healthy before the server accepts requests — the depends_on + healthcheck in the compose file handles this.
3. Connect an AI agent
See AI Agent Configuration for your specific agent.
Quick Start — Local Development
1. Clone and install
git clone https://github.com/architecture-pattern/architecture-pattern-mcp.git
cd architecture-pattern-mcp
# Install with all development dependencies
make install
# Or manually:
uv pip install -e ".[dev]"2. Configure
cp config/config.json ~/.config/architecture-pattern-mcp/config.jsonEdit ~/.config/architecture-pattern-mcp/config.json or set environment variables:
export GENERATOR_API_KEY=your_key_here
export GENERATOR_PROVIDER=openai # or minimax, anthropic, etc.
export GENERATOR_BASE_URL=https://api.openai.com/v13. Start the server
# Direct Python (requires TEI embedder running separately on port 8080)
uv run python -m src.main
# Or use the installed console script
architecture-pattern-mcpThe MCP server listens on streamable-http transport at http://localhost:8050/mcp.
TEI embedder: The local install does not start the TEI embedder automatically. The server will start but pattern retrieval by domain will fall back to the default pattern until the embedder is available at
http://127.0.0.1:8080/v1.
4. Connect an AI agent
See AI Agent Configuration for your specific agent.
Tools
The server exposes six MCP tools:
Tool | Description |
| Analyse requirements and domain; returns strengths, weaknesses, recommended style, selected patterns, and quality metrics |
| Generate an architecture design from requirements, domain, and selected patterns |
| Evaluate an existing design against criteria; returns per-metric scores, findings, and recommendations |
| Full pipeline: analyse → generate → evaluate → refine (up to 3 attempts); returns the best design and its evaluation |
| List all known patterns (name + description); optional |
| Get the full JSON of a specific pattern by name (e.g. |
Pattern Catalog Access
Two ways to browse the architecture pattern catalog:
Option A — MCP tools (recommended, works in every client)
The list_architecture_patterns and get_architecture_pattern tools return plain JSON text and work in all MCP clients including Claude Code, OpenCode, and Codex.
list_architecture_patterns() # all 36+ patterns
list_architecture_patterns(category="structural") # filter by category
list_architecture_patterns(domain="microservices") # filter by domain
list_architecture_patterns(category="dataflow", domain="etl") # combined filters
get_architecture_pattern(name="microservices") # full pattern JSON
get_architecture_pattern(name="pipe-and-filter")Output of list_architecture_patterns():
[
{ "name": "microservices", "description": "Large-scale distributed systems requiring independent deployability..." },
{ "name": "pipe-and-filter", "description": "Data transformation pipelines composed of independent filters..." },
{ "name": "event-driven", "description": "Loosely coupled components communicating asynchronously via events..." }
]Valid category values: messaging, structural, cloud, data, ai_cognitive, specialized, api_gateway, coordination, dataflow, presentation.
Option B — MCP resources (pattern://)
The server also exposes patterns as MCP resources. In OpenCode use the model-invoked resource tools:
mcp_list_resources(server="architecture-pattern") # list all
mcp_read_resource(server="architecture-pattern", uri="pattern://microservices") # by nameAvailable resource URIs:
URI | Description |
| List all patterns (returns JSON array with uri, name, description) |
| Get a specific pattern by name (e.g. |
| Get an architecture template by name |
| Get a component blueprint by type (e.g. |
OpenCode @-mention limitation:
@-mentioning a resource with a custom URI scheme (likepattern://) may fail because OpenCode attempts to HTTP-dereference the URI as a URL — see opencode#30928. Prefer Option A (the tools) for reliable access in OpenCode.
Raw curl (advanced)
If you need to test resources directly via HTTP, the MCP Streamable HTTP transport requires a session ID:
# 1. Initialize and capture the Mcp-Session-Id header
SESSION=$(curl -sS -i -X POST http://localhost:8050/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"resources":{}},"clientInfo":{"name":"test","version":"1.0"}}}' \
| grep -i 'mcp-session-id' | awk '{print $2}' | tr -d '\r\n')
# 2. Use the session for subsequent requests
curl -sS -X POST http://localhost:8050/mcp \
-H "Content-Type: application/json" \
-H "Mcp-Session-Id: $SESSION" \
-d '{"jsonrpc":"2.0","id":2,"method":"resources/list","params":{}}'
curl -sS -X POST http://localhost:8050/mcp \
-H "Content-Type: application/json" \
-H "Mcp-Session-Id: $SESSION" \
-d '{"jsonrpc":"2.0","id":3,"method":"resources/read","params":{"uri":"pattern://microservices"}}'Example prompts
Note:
DomainandStyleare structured tool parameters — the MCP server does not parse them from the requirements text. An AI agent must extract them and pass them as separate tool arguments.
Build a scalable distributed system for processing IoT sensor data with
100k events per second throughput, written in Python, deployed on Kubernetes.Analyse the requirements for an e-commerce platform handling flash-sales events.
Domain: e-commerce.Design an architecture for an e-commerce platform handling flash-sales events.
Use microservices style.
Domain: e-commerce. Style: microservices.Evaluate this architecture for a banking application that requires strong
consistency and low latency.Getting pattern details
Ask about any specific pattern to see its full description, components, tradeoffs, and best practices:
Show me details about the blackboard pattern.
What are the components of the event-driven architecture pattern?
Explain the microservices pattern in detail.This calls get_architecture_pattern(name="blackboard") (or whichever pattern name is mentioned) and returns the full JSON including:
Field | Description |
| Pattern name |
| Pattern category (e.g. |
| When this pattern applies |
| Key advantages |
| Disadvantages and costs |
| Scores (1–10) for scalability, maintainability, reliability, security, performance, simplicity |
| Where this pattern works well |
| Where to avoid this pattern |
| Concrete examples |
| Key components and their roles |
| Common technology choices |
| Core principles to follow |
| Recommended practices |
Example output for get_architecture_pattern(name="blackboard"):
{
"name": "blackboard",
"category": "ai_cognitive",
"context": "Complex problems requiring multiple specialized knowledge sources where no deterministic solution strategy exists...",
"benefits": [
"Reusable knowledge sources: each KS can be reused across different problem domains",
"Fault tolerance and robustness: wrong hypotheses are filtered out...",
"Support for changeability and maintainability: KSs, control algorithm, and central data structure are strictly separated"
],
"quality_attributes": {
"scalability": 7,
"maintainability": 6,
"reliability": 6,
"security": 3,
"performance": 4,
"simplicity": 4
}
}Example Output
Request to design_architecture for an IoT data-processing pipeline:
Requirements: "ETL pipeline for IoT sensor data: ingest 10k events/sec from Kafka,
parse JSON, enrich with geolocation from Redis, write to InfluxDB and S3"
Domain: data-processing
Style: pipe-and-filterThe server returns a PipelineResult containing:
Architecture overview
{
"overview": {
"style": "pipe-and-filter",
"category": "dataflow",
"principles": [
"Single Responsibility: Each filter performs one distinct transformation",
"Independent Scalability: Each filter scales horizontally based on workload",
"Fault Isolation: Failures in one filter don't cascade to others"
]
}
}Components (7 filters + source + sink)
{
"components": [
{
"id": "kafka-source",
"name": "Kafka Source Connector",
"type": "data-source",
"description": "Ingests raw IoT sensor data from Kafka topic with consumer group management",
"technology_stack": ["Apache Kafka", "Confluent Schema Registry"],
"config_requirements": ["KAFKA_BOOTSTRAP_SERVERS", "KAFKA_TOPIC", "KAFKA_CONSUMER_GROUP"]
},
{
"id": "json-parser-filter",
"name": "JSON Parser Filter",
"type": "filter",
"description": "Parses JSON-encoded sensor payloads into structured objects",
"technology_stack": ["Python", "orjson", "pydantic"]
}
]
}Evaluation
{
"summary": {
"overall_score": 78.0,
"strengths": ["Scalable parallel processing", "Fault isolation per stage"],
"weaknesses": ["Operational complexity of Kafka"]
},
"metrics": {
"maintainability": 8.2,
"scalability": 9.1,
"reliability": 7.8,
"security": 6.5,
"performance": 8.0
},
"recommendations": {
"maintainability": [
"Split transformer-filter into unit-converter-filter, timestamp-normalizer-filter, and outlier-detector-filter"
],
"scalability": [
"Ensure Kafka partition count exceeds maximum parallelism (recommend 2x current max of 20)"
]
}
}AI Agent Configuration
All three major AI coding agents use MCP. The server runs as a local stdio subprocess.
Claude Code
First install the package, then add it as an MCP server:
# Install the package (one-time)
uv pip install -e .
# Add as MCP server
claude mcp add architecture-pattern -- architecture-pattern-mcpOr with environment variables:
claude mcp add architecture-pattern \
-e GENERATOR_API_KEY=your_key \
-e GENERATOR_PROVIDER=openai \
-- architecture-pattern-mcpProject-scoped (shared with team via .mcp.json):
claude mcp add --scope project architecture-pattern -- architecture-pattern-mcpOpenCode
The architecture-pattern-mcp server uses HTTP transport (streamable-http on port 8050 by default). Start the server first, then configure opencode as a remote MCP server.
1. Install and start the server:
# Install the package (one-time)
uv pip install -e .
# Option A: Direct Python (from project directory)
uv run python -m src.main
# Option B: Via Docker
make docker-up2. Add to opencode.json (project root or ~/.config/opencode/opencode.json):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"architecture-pattern": {
"type": "remote",
"url": "http://localhost:8050/mcp"
}
}
}Note: The server must be running before opencode connects. Environment variables like GENERATOR_API_KEY are read from the server's config file (~/.config/architecture-pattern-mcp/config.json), not from opencode's config.
Codex CLI
First install the package, then add it as an MCP server:
# Install the package (one-time)
uv pip install -e .Add to ~/.codex/config.toml:
[mcp_servers.architecture-pattern]
command = "architecture-pattern-mcp"
[mcp_servers.architecture-pattern.env]
GENERATOR_API_KEY = "your_key"
GENERATOR_PROVIDER = "openai"Or via CLI:
codex mcp add architecture-pattern \
--env GENERATOR_API_KEY=your_key \
-- architecture-pattern-mcpBuilding & Development
The project uses Make as its primary build automation tool. Run make help to see all available targets.
Common targets
Target | Description |
| Install package in editable mode with all dev dependencies |
| Run ruff linting checks |
| Auto-fix linting issues and format code |
| Run pyright type checking |
| Run integration tests ( |
| Run the example MCP client demo (requires server running) |
| Build the production Docker image |
| Build and start all services via docker compose |
| Stop all docker compose services |
| Show docker compose logs |
| Follow docker compose logs |
| Smoke-test the running MCP server (POST initialize, SSE stream, HTTP 406 rejection) |
| Run unit tests inside a Docker container |
| Remove the Docker image |
Development workflow
# First-time setup
make install
# Before pushing
make lint typecheck integration-tests
# Docker workflow
make docker-up # Start services
make docker-verify # Smoke-test MCP handshake
make docker-logs-follow # Watch logs in real time
make docker-down # Stop servicesExtending with New Patterns
Architecture patterns are loaded from ~/.config/architecture-pattern-mcp/pattern/ (configurable via PATTERN_DIRECTORY). The server ships with 36+ patterns in pattern/. To add a custom pattern, place a JSON file there.
Minimal pattern structure
{
"$schema": "https://json-schema.org/draft-07/schema#",
"category": "structural",
"name": "my-custom-pattern",
"context": "Describe when this pattern applies. Be specific about the problem it solves.",
"benefits": [
"Benefit 1",
"Benefit 2"
],
"tradeoffs": [
"Tradeoff 1",
"Tradeoff 2"
],
"quality_attributes": {
"scalability": 7,
"maintainability": 8,
"reliability": 7,
"security": 6,
"performance": 7,
"simplicity": 5
},
"suitable_domains": ["microservices", "cloud-native"],
"unsuitable_domains": ["simple-crud-applications", "small-teams"]
}Required fields
Field | Type | Description |
| string (enum) |
|
| string | Unique kebab-case name |
| string | Problem description |
| array of strings | What the pattern provides |
| array of strings | Disadvantages |
| object | Scores 1–10 for |
Optional fields
Field | Type | Description |
| array of strings | Domain names where this pattern works well |
| array of strings | Domain names where to avoid |
| array of strings | Concrete use case examples |
| array of strings | When NOT to use this pattern |
| array of strings | Key component roles in the pattern |
| array of strings | Common technology choices |
| array of strings | Common mistakes with this pattern |
| array of strings | Patterns commonly migrated from |
| array of strings | Patterns commonly migrated to |
| array of strings | Core design principles |
| array of strings | Recommended practices |
The full JSON Schema (with all domain enums) is at docs/pattern-schema.json.
Configuration Reference
The server reads config/config.json (or the path in CONFIG_PATH).
{
"generator": {
"provider": "openai",
"config": {
"model": "gpt-4o-mini",
"base_url": "https://api.openai.com/v1",
"api_key": "{env:GENERATOR_API_KEY}",
"temperature": 0.7,
"top_p": 1.0,
"top_k": 20
}
},
"embedder": {
"provider": "tei",
"config": {
"model": "data/qwen3-embedding-0.6b",
"base_url": "http://127.0.0.1:8080/v1",
"embedding_dim": 1024
}
},
"retrieval": {
"bm25_top_k": 0,
"dense_top_k": 0,
"top_k_patterns": 5,
"mode": "reciprocal_rerank",
"min_quality_score": 50.0,
"pattern_context_limits": {
"benefits": 3,
"tradeoffs": 3,
"best_practices": 3,
"component_types": 5,
"technology_stack": 5,
"anti_patterns": 3,
"suitable_domains": 5
}
},
"pattern_directory": "~/.config/architecture-pattern-mcp/pattern"
}Note:
bm25_top_k: 0/dense_top_k: 0means "full corpus" — no limit is applied to stage-1 recall. The retriever uses the full pattern set before fusion and re-ranking.
The {env:VAR:-default} syntax expands environment variables at load time.
Environment Variables
Variable | Default | Description |
|
| Path to config file |
|
| LLM provider ( |
|
| Model name |
|
| API base URL |
| (required) | API key for the LLM provider |
|
| LLM sampling temperature |
|
| Embedder provider ( |
|
| TEI model name or path |
|
| TEI server URL |
|
| TEI API key (not needed for local TEI) |
|
| Directory for pattern JSON files |
|
| BM25 retrieval count (0 = full corpus, no limit) |
|
| Dense vector retrieval count (0 = full corpus, no limit) |
|
| Number of top patterns to retrieve |
|
| Retrieval fusion mode |
|
| Early-stop quality threshold |
Troubleshooting
Server starts but tools are not visible
Check the agent's MCP connection: Claude Code
/mcp, OpenCodeopencode mcp list, Codexcodex mcp list.Verify the server process started: the compose logs should show
MCPArchitectServer initialized.Confirm the TEI embedder is healthy:
curl http://127.0.0.1:8080/healthinside the container.
"Connection refused" or timeout errors
The server waits for the TEI embedder to become healthy. Check:
docker compose -f docker/docker-compose.yml logs teiIf TEI fails to start, verify the model path data/qwen3-embedding-0.6b is accessible inside the container (it's baked in at build time via docker/Dockerfile.tei).
LLM provider errors (502 / 401)
Confirm
GENERATOR_API_KEYis set and not expired.Verify
GENERATOR_BASE_URLmatches your provider's endpoint.If using a proxy, check
GENERATOR_BASE_URLis reachable from inside the container.
No patterns found for domain
The embedder is required for domain-scoped pattern retrieval. Without it, the server falls back to the DEFAULT_FALLBACK_PATTERN_NAME pattern. Ensure:
curl http://127.0.0.1:8080/v1/embeddings \
-X POST \
-d '{"inputs":"cloud-native microservices"}' \
-H 'Content-Type: application/json'returns a vector.
Pattern JSON files not loading
Files must have
.jsonextension.Required fields:
category,name,context,benefits,tradeoffs,quality_attributes.Validate against
docs/pattern-schema.jsonwith a JSON schema validator.Check for trailing commas or missing quotes — the server uses Pydantic validation and will emit a clear error.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceAssists AI developers with intelligent requirement analysis and architecture design through guided clarification questions, branch-aware management, and automated architecture generation with persistent storage.133MIT

MarkdownLM MCP Serverofficial
FlicenseAqualityBmaintenanceProvides a persistent memory and governance layer that allows AI coding agents to query documented architecture rules and validate code against team standards. It enables agents to verify compliance across categories like security and testing before suggesting changes to ensure consistency across development sessions.317- AlicenseAqualityBmaintenanceAn architecture consulting server that reviews multi-agent systems against a knowledge graph of patterns derived from expert literature. It provides grounded recommendations with chapter citations, maturity scoring, and interactive architecture diagrams to identify and fix structural gaps.175AGPL 3.0
- Alicense-qualityAmaintenanceProvides architectural memory for AI coding agents, enabling reuse of existing abstractions and advisory-first guidance on code placement and imports.9MIT
Related MCP Connectors
Design intelligence for coding agents: audits, design systems, and a taste profile agents consult.
AI Agent with Architectural Memory. Impact analysis (free), tests and code from the graph (pro).
Architecture-grounded query for AI agents. Governance constraints, system dependencies, evidence.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/olk/architecture-pattern-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server