Skip to content

Commit 0ef3a61

Browse files
committed
docs: updated docs for MCP
1 parent 6f584de commit 0ef3a61

File tree

4 files changed

+211
-4
lines changed

4 files changed

+211
-4
lines changed

docs/.vitepress/config.mts

+7-1
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,19 @@ export default withMermaid({
3333
items: [
3434
{text: 'Installation', link: '/getting-started'},
3535
{text: 'Configuration', link: '/configuration'},
36-
{text: 'MCP Server', link: '/mcp-server'},
3736
{text: 'Command Reference', link: '/getting-started/command-reference'},
3837
{text: 'Environment Variables', link: '/environment-variables'},
3938
{text: 'IDE Integration', link: '/getting-started/ide-integration'},
4039
{text: 'Logging', link: '/advanced/logging'}
4140
]
4241
},
42+
{
43+
text: 'MCP Server',
44+
items: [
45+
{text: 'Integration', link: '/mcp-server'},
46+
{text: 'Filesystem', link: '/mcp/filesystem'}
47+
]
48+
},
4349
{
4450
text: 'Config Reference',
4551
items: [

docs/index.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ When working with AI-powered development tools context is everything.
3535
code.
3636

3737
- **Seamless AI Integration**: With MCP support, [connect](/mcp-server) Claude AI directly to your codebase, allowing
38-
for real-time,
39-
context-aware assistance without manual context sharing.
38+
for real-time, context-aware assistance without manual context sharing.
4039

4140
## How it works
4241

docs/mcp-server.md

+42-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,29 @@ sequenceDiagram
4343
The diagram shows how Claude communicates with the MCP Server, which accesses your project files
4444
according to your configuration.
4545

46+
## Key Features
47+
48+
### Context Awareness
49+
50+
- Access to structured documentation and code from your project
51+
- Contextual understanding of project architecture and dependencies
52+
- Support for multiple context files organized by functionality or domain
53+
54+
### Filesystem Operations
55+
56+
- **Read files**
57+
- **Write and create files**
58+
- **Move and rename files** for project restructuring
59+
- **Get file information**
60+
61+
### Routing System
62+
63+
The MCP Server uses a flexible HTTP-style routing system that makes handling requests more maintainable and extensible.
64+
Each operation is handled by a dedicated controller, using appropriate HTTP semantics:
65+
66+
- `GET` requests for reading data
67+
- `POST` requests for actions that modify state
68+
4669
## Why?
4770

4871
**Developer-Controlled Context**: As a developer and product owner, YOU know your code best. Context Generator puts you
@@ -109,4 +132,22 @@ First of all you need to [install](https://claude.ai/download) Claude app and la
109132
}
110133
```
111134

112-
**Important:** After saving the configuration, restart the app.
135+
**Important:** After saving the configuration, restart the app.
136+
137+
## Available Tools
138+
139+
When connected via MCP, Claude has access to the following tools:
140+
141+
### Context Tools
142+
143+
- `context-request`: Request context using JSON schema specification
144+
- `context-get`: Get a specific document by its path
145+
- `context`: List all available contexts in the project
146+
147+
### Filesystem Tools
148+
149+
- `file-read`: Read the content of a file with optional encoding
150+
- `file-write`: Write content to a file with optional directory creation
151+
- `file-rename`: Rename a file or directory
152+
- `file-move`: Move a file to a different location
153+
- `file-info`: Get detailed information about a file or directory

docs/mcp/filesystem.md

+161
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
# Filesystem Tools
2+
3+
The Context Generator MCP server includes a comprehensive set of filesystem tools that allow Claude to directly interact
4+
with your project files. These tools enable powerful AI-assisted development workflows and make it easy to analyze,
5+
modify, and create files without leaving your conversation.
6+
7+
## Available Tools
8+
9+
### file-read
10+
11+
Reads content from a file with encoding support.
12+
13+
**Parameters:**
14+
15+
- `path` (required): Path to the file to read
16+
- `encoding` (optional): File encoding (default: utf-8)
17+
18+
**Example:**
19+
20+
```json
21+
{
22+
"path": "src/ExampleClass.php"
23+
}
24+
```
25+
26+
**Response:**
27+
Returns the content of the file as text.
28+
29+
### file-write
30+
31+
Writes content to a file with optional directory creation.
32+
33+
**Parameters:**
34+
35+
- `path` (required): Relative path to the file (e.g., "src/file.txt")
36+
- `content` (required): Content to write to the file
37+
- `createDirectory` (optional): Create directory if it doesn't exist (default: true)
38+
39+
**Example:**
40+
41+
```json
42+
{
43+
"path": "src/utils/Helper.php",
44+
"content": "<?php\n\ndeclare(strict_types=1);\n\nclass Helper\n{\n // Class implementation\n}"
45+
}
46+
```
47+
48+
**Response:**
49+
Returns a success message with the number of bytes written.
50+
51+
### file-rename
52+
53+
Renames a file or directory.
54+
55+
**Parameters:**
56+
57+
- `path` (required): Current relative path
58+
- `newPath` (required): New relative path
59+
60+
**Example:**
61+
62+
```json
63+
{
64+
"path": "src/OldName.php",
65+
"newPath": "src/NewName.php"
66+
}
67+
```
68+
69+
**Response:**
70+
Returns a success message confirming the rename operation.
71+
72+
### file-move
73+
74+
Moves a file to a different location with optional directory creation.
75+
76+
**Parameters:**
77+
78+
- `source` (required): Source relative path
79+
- `destination` (required): Destination relative path
80+
- `createDirectory` (optional): Create destination directory if it doesn't exist (default: true)
81+
82+
**Example:**
83+
84+
```json
85+
{
86+
"source": "src/utils/Helper.php",
87+
"destination": "src/helpers/UtilityHelper.php"
88+
}
89+
```
90+
91+
**Response:**
92+
Returns a success message confirming the move operation.
93+
94+
### file-info
95+
96+
Gets detailed information about a file or directory.
97+
98+
**Parameters:**
99+
100+
- `path` (required): Path to the file or directory
101+
102+
**Example:**
103+
104+
```json
105+
{
106+
"path": "src/ExampleClass.php"
107+
}
108+
```
109+
110+
**Response:**
111+
Returns detailed information about the file or directory in JSON format:
112+
113+
```json
114+
{
115+
"path": "src/ExampleClass.php",
116+
"exists": true,
117+
"type": "file",
118+
"size": 1024,
119+
"permissions": "644",
120+
"lastModified": "2023-04-12 15:30:42"
121+
}
122+
```
123+
124+
For directories, it also includes the list of files and subdirectories.
125+
126+
## Use Cases
127+
128+
### Code Analysis and Modification
129+
130+
Claude can read existing files, analyze them, and suggest modifications or improvements. For example:
131+
132+
1. Read a class file to understand its structure
133+
2. Analyze dependencies and relationships
134+
3. Suggest refactoring or optimization
135+
4. Write the modified version back to the file
136+
137+
### Code Generation
138+
139+
Claude can generate new files based on your requirements and project context:
140+
141+
1. Understand your project structure using context tools
142+
2. Generate new classes, interfaces, or utility functions
143+
3. Write the generated code to appropriate locations
144+
4. Create necessary directories if they don't exist
145+
146+
### Project Exploration
147+
148+
Claude can explore your project structure to better understand its organization:
149+
150+
1. Get information about directories to understand the project layout
151+
2. Examine specific files to understand their purpose and functionality
152+
3. Build a mental model of your codebase to provide more relevant assistance
153+
154+
### Refactoring and Reorganization
155+
156+
Claude can assist with refactoring and reorganizing your project:
157+
158+
1. Rename files to follow naming conventions
159+
2. Move files to more appropriate locations
160+
3. Create new directory structures for better organization
161+
4. Update file content to reflect the new structure

0 commit comments

Comments
 (0)