You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 17, 2025. It is now read-only.
A convention developers can all easily adopt to capture and communicate the context of your codebase for both AI coding agents and humans. Similar to .env and .editorconfig, but focused on documenting your code. Visit [codebasecontext.org](https://codebasecontext.org/) to learn more about the specification.
4
+
AI coding has evolved from simple file-level completions to sophisticated project-wide assistance. As these tools become more capable, they need more context - not just about individual files, but about your project's architecture, history, and design decisions.
4
5
5
-
## Overview
6
+
dotcontext emerged from a common pattern: developers repeatedly sharing README files with AI assistants to help them understand projects before starting tasks. We've standardized this approach into a structured system that helps AI coding agents grasp your codebase's full context from the start.
6
7
7
-
This package provides a comprehensive system for managing and leveraging codebase context through two main components:
8
-
9
-
1.**CLI Tool (`dotcontext`)**: A command-line interface that helps developers:
10
-
- Initialize and structure context documentation
11
-
- Validate context files against the CCS specification
2.**MCP Server (`dotcontext-mcp`)**: An integration layer that enables AI tools to understand your codebase by:
17
-
- Providing programmatic access to context information
18
-
- Exposing architectural diagrams and documentation
19
-
- Enabling automated context validation
20
-
- Supporting tools like [Cline](https://codebasecontext.org/tools/code-generation/cline) in making informed decisions about your code
10
+
```mermaid
11
+
%%{init: { 'theme': 'dark' } }%%
12
+
sequenceDiagram
13
+
participant Dev as Developer
14
+
participant DC as .context/
15
+
participant MCP as MCP Server
16
+
participant AI as AI Assistant
17
+
18
+
rect rgba(50, 50, 50, 0.5)
19
+
Note over Dev,AI: Initial Setup
20
+
Dev->>DC: Create context structure
21
+
Dev->>DC: Add documentation
22
+
Dev->>DC: Create diagrams
23
+
end
24
+
25
+
rect rgba(50, 50, 50, 0.5)
26
+
Note over Dev,AI: Development Flow
27
+
Dev->>AI: Start new task
28
+
AI->>MCP: Request context
29
+
MCP->>DC: Read context
30
+
DC-->>MCP: Project context
31
+
MCP-->>AI: Structured information
32
+
Note over AI: AI processes<br/>complete context
33
+
AI-->>Dev: Informed assistance
34
+
Dev->>DC: Update context
35
+
end
36
+
37
+
rect rgba(50, 50, 50, 0.5)
38
+
Note over Dev,AI: Continuous Learning
39
+
loop Project Evolution
40
+
Dev->>DC: Update documentation
41
+
AI->>MCP: Get fresh context
42
+
MCP->>DC: Read updates
43
+
DC-->>AI: Latest context
44
+
end
45
+
end
46
+
47
+
Note over Dev,AI: Project Evolution
48
+
```
21
49
22
-
Together, these components create a bridge between human-readable documentation and machine-interpretable context, making your codebase more accessible to both developers and AI tools.
MCP is a communication standard that lets AI Coding Agents understand your codebase better. Think of it like a translator between your documentation and AI assistants. When an AI tool supports MCP, it can:
26
53
27
-
### CLI Quick Start
54
+
- Read and understand your project's documentation
55
+
- Parse architectural diagrams
56
+
- Make informed suggestions about your code
57
+
- Validate documentation structure
28
58
29
-
The CLI tool provides direct command-line access to context management features:
59
+
## Quick Start 🚀
30
60
61
+
### 1. Install and Initialize
31
62
```bash
32
-
# Initialize a new context directory
63
+
# Navigate to your project root
64
+
cd your-project
65
+
66
+
# Create your first context directory
33
67
npx dotcontext init
34
68
35
69
# Validate your context structure
36
70
npx dotcontext validate
37
-
38
-
# View available diagrams
39
-
npx dotcontext diagrams --content
40
71
```
41
72
42
-
### MCP Integration
43
-
44
-
Enable AI tools to understand your codebase by adding the MCP server to your client's configuration:
73
+
### 2. Configure MCP Server 🔌
45
74
75
+
#### For most environments:
46
76
```json
47
77
{
48
78
"mcpServers": {
@@ -56,8 +86,7 @@ Enable AI tools to understand your codebase by adding the MCP server to your cli
56
86
}
57
87
```
58
88
59
-
For Windows users experiencing 'spawn NOENT' errors in Cline, use this configuration:
60
-
89
+
#### For Windows users (resolves 'spawn NOENT' errors):
61
90
```json
62
91
{
63
92
"mcpServers": {
@@ -71,56 +100,81 @@ For Windows users experiencing 'spawn NOENT' errors in Cline, use this configura
71
100
}
72
101
```
73
102
74
-
The MCP server provides tools for AI agents to:
75
-
- Read and parse your context documentation
76
-
- Access architectural diagrams
77
-
- Validate context structure
78
-
- Extract project metadata
103
+
## Features 🛠️
79
104
80
-
All tools automatically use the `.context` directory in your project root unless specified otherwise.
105
+
### MCP Tools
106
+
-`init`: Create new context directories
107
+
-`validate`: Check documentation structure
108
+
- 💡 `context`: Get project documentation and insights
109
+
> **AI Assistant Tip**: Use this command to understand a project before starting tasks!
110
+
> ```
111
+
> Custom Instruction: "use dotcontext's context to understand this project before starting on your task"
112
+
> ```
113
+
- `diagrams`: View architectural diagrams
81
114
82
-
## Learn More About CCS
115
+
All tools automatically work from your project root, looking for a `.context` directory.
83
116
84
-
- 📺 [Watch the CCS Introduction Video](https://youtu.be/6icquh4thCw)
85
-
- 📄 [Read the CCS RFC on SubStack](https://agenticinsights.substack.com/p/codebase-context-specification-rfc)
0 commit comments