# aurda012/cursor10x architecture

> Architecture diagram of the GitHub repository aurda012/cursor10x, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aurda012/cursor10x
- Repository: https://github.com/aurda012/cursor10x

## Overview

##### Project Type and Purpose
- Cursor10x (now DevContext) is an AI-development context system—a CLI/plug-in style MCP (Model Context Protocol) server that provides persistent, project-centric memory, task management, and coding‐rules enforcement for AI assistants (e.g., Claude).
- It is not a traditional full-stack app but rather a developer tool that sits alongside your codebase, communicates with an LLM, and stores context in a database.

##### File‐Structure Analysis
- Top‐level files:
- `.gitignore`, `README.md`, `.cursorrules` (global rule definitions)
- Configuration directory:
- `.cursor/mcp.json` – defines which MCP servers (tools) to run and their environment variables (Turso DB URL & token).
- `.cursor/rules/*.mdc` – Markdown-based rule files that enforce coding and workflow standards.
- Tasks directory:
- `tasks/tasks.json` – defines the project’s task workflow.

##### Key Architectural Insights from README
- Four core components:
1. MCP Server (Node.js CLI tool registered via `.cursor/mcp.json`)
2. Memory Database (Turso)
3. Memory Subsystems (STM, LTM, Episodic, Semantic)
4. Vector Embedding Service (semantic indexing & search)
- Additional modules:
- Cursor Rules enforcement (.mdc files + `.cursorrules`)
- Task Management (tasks JSON + workflow toolchain)

a. Main Components:
- Developer Workspace (local code + `.cursor` config + `tasks` files)
- MCP Server (cursor10x-mcp CLI process)
- External LLM (e.g., Claude)
- Memory Database (Turso DB)
- Vector Embedding Service (could be OpenAI embeddings or internal)
- Memory Subsystems (STM, LTM, Episodic, Semantic modules within MCP Server)
- Cursor Rules Engine
- Task Manager

b. Interactions & Data Flow:
1. **Developer or LLM** issues a request (e.g., “Recall authentication decision”).
2. The **MCP Server** receives the request via MCP protocol.
3. The **Cursor Rules Engine** consults `.mdc` rules to validate or transform the request.
4. For memory operations: MCP Server routes read/write to the **Memory Subsystems**.
5. **STM/LTM/Episodic** modules read/write metadata and messages to **Turso DB** via standard queries.
6. **Semantic Memory** module calls the **Vector Embedding Service** to embed text/code, then stores/retrieves vectors in the DB.
7. The **Task Manager** loads tasks from `tasks/tasks.json`, persists progress in DB, and surfaces next tasks.
8. MCP Server collates context from all subsystems and returns results to the **LLM** or developer CLI.

c. Architectural Patterns & Principles:
- Modular “memory subsystem” pattern: each memory type is a plug-in.
- Separation of concerns: rules engine, embedding service, database access, and CLI interface are distinct modules.
- Single source of truth: all persistent data lives in Turso DB.
- Configuration-driven: `.cursor/mcp.json` and `.mdc` files drive behavior without code changes.

d. Technologies & Frameworks:
- Node.js (MCP server CLI via `npx cursor10x-mcp`)
- Turso (distributed SQLite-compatible DB)
- JSON (config and tasks definitions)
- Markdown Configuration (for rules)
- MCP protocol (tool registration)
- Vector embeddings (external service or library)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Workspace
    subgraph "Developer Workspace"
        subgraph ".cursor" 
            CursorDir[".cursor"]:::config
            MCPConfig["mcp.json"]:::config
            RulesFolder["rules/"]:::config
            CursorDir --> MCPConfig
            CursorDir --> RulesFolder
            Rule1["010-cursor-rules.mdc"]:::config
            Rule2["100-memory-system.mdc"]:::config
            Rule3["200-tasks-workflow.mdc"]:::config
            RulesFolder --> Rule1
            RulesFolder --> Rule2
            RulesFolder --> Rule3
        end
        subgraph "tasks/"
            TasksJson["tasks.json"]:::config
        end
    end

    %% Core Compute Components
    MCPServer["MCP Server (cursor10x-mcp)"]:::compute
    RulesEngine["Cursor Rules Engine"]:::config
    LLM["External LLM (Claude)"]:::external
    TaskManager["Task Manager"]:::compute
    subgraph "Memory Subsystems"
        STM["STM Module"]:::compute
        LTM["LTM Module"]:::compute
        Episodic["Episodic Module"]:::compute
        Semantic["Semantic Module"]:::compute
    end
    EmbeddingService["Vector Embedding Service"]:::compute

    %% Storage
    TursoDB["Turso DB"]:::storage

    %% Connections
    CursorDir -->|"load config"| MCPServer
    TasksJson -->|"load tasks"| TaskManager
    TaskManager -->|"communicates"| MCPServer
    MCPServer -->|"MCP request"| RulesEngine
    RulesEngine -->|"rule validation"| MCPServer
    MCPServer -->|"invoke"| STM
    MCPServer -->|"invoke"| LTM
    MCPServer -->|"invoke"| Episodic
    MCPServer -->|"invoke"| Semantic
    STM -->|"DB read/write"| TursoDB
    LTM -->|"DB read/write"| TursoDB
    Episodic -->|"DB read/write"| TursoDB
    Semantic -->|"embed request"| EmbeddingService
    EmbeddingService -->|"vector store"| TursoDB
    Semantic -->|"DB read/write"| TursoDB
    MCPServer -->|"memory/task context"| LLM
    LLM -->|"response"| MCPServer
    TaskManager -->|"persist progress"| TursoDB

    %% Click Events
    click MCPConfig "https://github.com/aurda012/cursor10x/blob/main/.cursor/mcp.json"
    click CursorDir "https://github.com/aurda012/cursor10x/tree/main/.cursor/"
    click Rule1 "https://github.com/aurda012/cursor10x/blob/main/.cursor/rules/010-cursor-rules.mdc"
    click Rule2 "https://github.com/aurda012/cursor10x/blob/main/.cursor/rules/100-memory-system.mdc"
    click Rule3 "https://github.com/aurda012/cursor10x/blob/main/.cursor/rules/200-tasks-workflow.mdc"
    click TasksJson "https://github.com/aurda012/cursor10x/blob/main/tasks/tasks.json"

    %% Styles
    classDef compute fill:#bbdefb,stroke:#1e88e5,color:#0d47a1;
    classDef storage fill:#c8e6c9,stroke:#388e3c,color:#1b5e20;
    classDef config fill:#ffeb99,stroke:#fbc02d,color:#f57f17;
    classDef external fill:#e1bee7,stroke:#8e24aa,color:#4a148c;
```
