@cognitivegraphai/decomposition
v0.0.1
Published
MCP server for breaking down complex problems into manageable components
Readme
Decomposition MCP Server
A Model Context Protocol (MCP) server for breaking down complex problems into manageable components.
Overview
The Decomposition MCP server provides tools for analyzing problems through a structured decomposition process that identifies components, dependencies, and relationships. It helps in breaking down complex systems or problems into smaller, manageable parts, identifying dependencies between components, and planning implementation strategies.
Installation
npm install @modelcontextprotocol/server-decompositionUsage
Starting the Server
You can start the server using the provided binary:
npx mcp-server-decompositionOr run it directly from the source:
node dist/index.jsEnvironment Variables
DECOMPOSITION_STATE_FILE_PATH: Path to the state file (default:decomposition-state.jsonin the same directory as the script)DISABLE_DECOMPOSITION_LOGGING: Set to "true" to disable console logging (default: false)
Tool Schema
The server exposes a single tool named decomposition with the following actions:
Actions
createProblem: Create a new problem definitionupdateProblem: Update an existing problemcreateComponent: Create a new component for a problemupdateComponent: Update an existing componentlinkComponents: Create a dependency relationship between componentsstartPhase: Start a new decomposition phasecompletePhase: Complete a decomposition phase and calculate metricscalculateMetrics: Calculate metrics for a problem's decompositiongetDecomposition: Get all components for a problemgetComponentDetails: Get details for a specific componentgetProblemDetails: Get details for a specific problemgetPhaseHistory: Get the history of decomposition phases
Examples
Creating a Problem
{
"action": "createProblem",
"problemData": {
"problemId": "p1",
"problemStatement": "Build a scalable e-commerce platform",
"complexity": 8,
"domain": "Web Development",
"constraints": ["Must support mobile devices", "Must handle 10,000 concurrent users"]
}
}Creating a Component
{
"action": "createComponent",
"componentData": {
"componentId": "c1",
"parentProblemId": "p1",
"name": "User Authentication Service",
"description": "Handles user registration, login, and session management",
"dependencies": [],
"status": "pending",
"complexity": 6
}
}Linking Components
{
"action": "linkComponents",
"sourceId": "c2",
"targetId": "c1"
}Getting Decomposition
{
"action": "getDecomposition",
"problemId": "p1"
}Metrics
The server calculates the following metrics for a problem's decomposition:
componentCount: Total number of componentsaverageComplexity: Average complexity of all componentsmaxDepth: Maximum depth of the dependency graphdependencyCount: Total number of dependenciesbalanceScore: Score indicating how balanced the decomposition is (1-10)
State Management
The server maintains state in a JSON file, which includes:
- Problems
- Components
- Decomposition phases
- Metrics
The state is automatically saved after each operation and can be persisted across server restarts.
