Skip to content

Commit 675237a

Browse files
committed
Add MCP configuration generator documentation
1 parent d06c24b commit 675237a

File tree

2 files changed

+136
-5
lines changed

2 files changed

+136
-5
lines changed

docs/getting-started/command-reference.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,106 @@ ctx init -c context.json
8383

8484
> **Note**: Only `json` and `yaml` formats are supported for the configuration file.
8585
86+
## Generate MCP Configuration
87+
88+
Generates MCP configuration snippets for connecting CTX to Claude Desktop or other MCP clients. This command
89+
automatically detects your operating system and generates the appropriate configuration format.
90+
91+
```bash
92+
ctx mcp:config
93+
```
94+
95+
### Options
96+
97+
| Option | Description |
98+
|-----------------------|----------------------------------------------------|
99+
| `--explain` | Show detailed setup instructions |
100+
| `--interactive`, `-i` | Interactive mode with guided questions |
101+
| `--client`, `-c` | MCP client type (claude, generic). Default: claude |
102+
| `--global`, `-g` | Use global project registry (no -c option) |
103+
104+
### Examples
105+
106+
**Auto-detect and generate global registry configuration:**
107+
108+
```bash
109+
ctx mcp:config
110+
```
111+
112+
**Interactive mode with guided questions:**
113+
114+
```bash
115+
ctx mcp:config --interactive
116+
# or
117+
ctx mcp:config -i
118+
```
119+
120+
**Global registry mode (default):**
121+
122+
```bash
123+
ctx mcp:config --global
124+
# or
125+
ctx mcp:config -g
126+
```
127+
128+
**Generate for different MCP clients:**
129+
130+
```bash
131+
ctx mcp:config --client=generic
132+
# or
133+
ctx mcp:config -c generic
134+
```
135+
136+
### Sample Output
137+
138+
**Global Registry Mode:**
139+
140+
```json
141+
{
142+
"mcpServers": {
143+
"ctx": {
144+
"command": "ctx",
145+
"args": [
146+
"server"
147+
]
148+
}
149+
}
150+
}
151+
```
152+
153+
**Project-Specific Mode:**
154+
155+
```json
156+
{
157+
"mcpServers": {
158+
"ctx": {
159+
"command": "ctx",
160+
"args": [
161+
"server",
162+
"-c",
163+
"/path/to/project"
164+
]
165+
}
166+
}
167+
}
168+
```
169+
170+
**WSL Configuration:**
171+
172+
```json
173+
{
174+
"mcpServers": {
175+
"ctx": {
176+
"command": "bash.exe",
177+
"args": [
178+
"-c",
179+
"ctx server -c /path/to/project"
180+
]
181+
}
182+
}
183+
}
184+
```
185+
86186
## MCP Server
87187

88188
Starts the Model Control Protocol (MCP) server to enable direct integration with Claude AI. This server acts as a bridge

docs/mcp/index.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,48 @@ First, you need to [install](https://claude.ai/download) Claude app and latest v
109109

110110
> **Note**: The MCP server is only available in the desktop version of Claude. The web version does not support it.
111111
112-
### Steps
112+
### Quick Setup
113+
114+
The easiest way to set up MCP integration is using the built-in configuration generator:
115+
116+
```bash
117+
ctx mcp:config
118+
```
119+
120+
> **Note**: All the command options can be found in
121+
> the [CLI Reference](../getting-started/command-reference.md#generate-mcp-configuration).
122+
123+
This command will:
124+
125+
- 🔍 Auto-detect your operating system (Windows, Linux, macOS, WSL)
126+
- 🎯 Generate the correct configuration for your environment
127+
- 📋 Provide copy-paste ready JSON for Claude Desktop
128+
- 🧭 Include setup instructions and troubleshooting tips
129+
130+
### Manual Configuration Steps
113131

114132
1. Download Claude App for your operating system
115133
2. Open **Settings****Developer****Edit config** → open config file `claude_desktop_config`
116-
3. Register the **CTX** MCP server using the appropriate configuration
134+
3. Add the generated configuration to your Claude Desktop config file
135+
4. Save and restart Claude Desktop
117136

118-
---
119-
120-
**Important: You must specify the path to your project using the `-c` flag. The project root should contain a
137+
> **Important: You must specify the path to your project using the `-c` flag. The project root should contain a
121138
`context.json` or `context.yaml` configuration file.**
122139

140+
### Configuration Modes
141+
142+
**Global Registry Mode (recommended for multiple projects):**
143+
144+
- Uses `ctx server` without project path
145+
- Enables dynamic switching between registered projects
146+
- Requires projects to be registered with `ctx project:add`
147+
148+
**Project-Specific Mode (single project):**
149+
150+
- Uses `ctx server -c /path/to/project`
151+
- Ties configuration to a specific project path
152+
- Good for focused single-project workflows
153+
123154
### Platform-Specific Configurations
124155

125156
#### Linux Configuration

0 commit comments

Comments
 (0)