Skip to content

Commit ae1c42d

Browse files
committed
docs: add CLI commands and project configuration guide to README
- Document codingbuddy init command and usage - Add MCP resources, tools, and prompts reference tables - Add project configuration guide with examples - Update paths and environment variables
1 parent 5f0fa81 commit ae1c42d

2 files changed

Lines changed: 175 additions & 9 deletions

File tree

mcp-server/README.md

Lines changed: 132 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,49 @@
1-
# Codingbuddy Rules MCP Server
1+
# Codingbuddy MCP Server
22

3-
A NestJS-based Model Context Protocol (MCP) server that exposes the Multi-AI Rules System (`.ai-rules/`) to AI clients.
3+
A NestJS-based Model Context Protocol (MCP) server that provides AI coding assistants with project-specific context and rules.
4+
5+
## Quick Start
6+
7+
```bash
8+
# Initialize project configuration (AI-powered)
9+
npx codingbuddy init
10+
11+
# This analyzes your project and creates codingbuddy.config.js
12+
```
413

514
## Features
615

7-
- **Resources**: Access rule files directly (`rules://core`, `rules://agents/frontend-developer`, etc.)
8-
- **Tools**: Search rules (`search_rules`) and get agent profiles (`get_agent_details`).
9-
- **Prompts**: Activate agents with context (`activate_agent`).
16+
### CLI Commands
17+
18+
| Command | Description |
19+
|---------|-------------|
20+
| `codingbuddy init` | Analyze project and generate configuration |
21+
| `codingbuddy --help` | Show help |
22+
| `codingbuddy --version` | Show version |
23+
24+
### MCP Resources
25+
26+
| Resource | Description |
27+
|----------|-------------|
28+
| `config://project` | Project configuration (tech stack, architecture, language) |
29+
| `rules://rules/core.md` | Core workflow rules |
30+
| `rules://rules/project.md` | Project setup rules |
31+
| `rules://agents/{name}.json` | Specialist agent definitions |
32+
33+
### MCP Tools
34+
35+
| Tool | Description |
36+
|------|-------------|
37+
| `get_project_config` | Get project configuration settings |
38+
| `search_rules` | Search through rules and guidelines |
39+
| `get_agent_details` | Get detailed profile of a specialist agent |
40+
| `parse_mode` | Parse PLAN/ACT/EVAL workflow mode (includes language setting) |
41+
42+
### MCP Prompts
43+
44+
| Prompt | Description |
45+
|--------|-------------|
46+
| `activate_agent` | Activate a specialist agent with project context |
1047

1148
## Prerequisites
1249

@@ -26,12 +63,14 @@ Add the following configuration to your Claude Desktop config:
2663
"mcpServers": {
2764
"codingbuddy-rules": {
2865
"command": "npx",
29-
"args": ["codingbuddy"]
66+
"args": ["codingbuddy-mcp"]
3067
}
3168
}
3269
}
3370
```
3471

72+
> **Note**: Use `codingbuddy-mcp` for the MCP server. The `codingbuddy` command is for CLI operations like `init`.
73+
3574
### Option 2: Global Installation
3675

3776
```bash
@@ -63,7 +102,7 @@ yarn build
63102
"mcpServers": {
64103
"codingbuddy-rules": {
65104
"command": "node",
66-
"args": ["/ABSOLUTE/PATH/TO/codingbuddy/mcp-server/dist/main.js"]
105+
"args": ["/ABSOLUTE/PATH/TO/codingbuddy/mcp-server/dist/src/main.js"]
67106
}
68107
}
69108
}
@@ -100,6 +139,91 @@ The server will start in SSE mode, exposing:
100139
| `MCP_TRANSPORT` | Transport mode (`stdio` or `sse`) | `stdio` |
101140
| `PORT` | HTTP port for SSE mode | `3000` |
102141
| `CODINGBUDDY_RULES_DIR` | Custom path to `.ai-rules` directory | Auto-detected |
142+
| `CODINGBUDDY_PROJECT_ROOT` | Project root for config loading | Current directory |
143+
| `ANTHROPIC_API_KEY` | API key for `codingbuddy init` | Required for init |
144+
145+
## Project Configuration
146+
147+
### Initialize Configuration
148+
149+
```bash
150+
# Basic usage (requires ANTHROPIC_API_KEY env var)
151+
npx codingbuddy init
152+
153+
# With options
154+
npx codingbuddy init --format json # Output as JSON instead of JS
155+
npx codingbuddy init --force # Overwrite existing config
156+
npx codingbuddy init /path/to/project # Specify project path
157+
npx codingbuddy init --api-key sk-... # Pass API key directly
158+
```
159+
160+
### Configuration File
161+
162+
The `codingbuddy init` command creates a `codingbuddy.config.js` file:
163+
164+
```javascript
165+
module.exports = {
166+
// Response language (ko, en, ja, etc.)
167+
language: 'ko',
168+
169+
// Project metadata
170+
projectName: 'my-awesome-app',
171+
description: 'A modern web application',
172+
173+
// Technology stack
174+
techStack: {
175+
languages: ['TypeScript'],
176+
frontend: ['React', 'Next.js', 'Tailwind CSS'],
177+
backend: ['Node.js', 'Prisma'],
178+
database: ['PostgreSQL'],
179+
tools: ['ESLint', 'Prettier', 'Vitest'],
180+
},
181+
182+
// Architecture pattern
183+
architecture: {
184+
pattern: 'feature-sliced-design',
185+
structure: ['app', 'widgets', 'features', 'entities', 'shared'],
186+
},
187+
188+
// Coding conventions
189+
conventions: {
190+
style: 'airbnb',
191+
naming: {
192+
files: 'kebab-case',
193+
components: 'PascalCase',
194+
functions: 'camelCase',
195+
},
196+
},
197+
198+
// Testing strategy
199+
testStrategy: {
200+
approach: 'tdd',
201+
frameworks: ['Vitest', 'Playwright'],
202+
coverage: 80,
203+
},
204+
};
205+
```
206+
207+
### File Structure
208+
209+
```
210+
my-project/
211+
├── codingbuddy.config.js # Main configuration
212+
├── .codingignore # Files to ignore (gitignore syntax)
213+
└── .codingbuddy/ # Additional context (optional)
214+
└── context/
215+
├── architecture.md # Architecture documentation
216+
└── api-guide.md # API usage guide
217+
```
218+
219+
### How AI Uses Configuration
220+
221+
When you use an AI assistant with this MCP server:
222+
223+
1. **Language**: AI responds in your configured language
224+
2. **Tech Stack**: AI provides code examples using your frameworks
225+
3. **Architecture**: AI suggests structures following your patterns
226+
4. **Conventions**: AI follows your naming and style rules
103227

104228
## Development
105229

@@ -119,7 +243,7 @@ The [MCP Inspector](https://github.com/modelcontextprotocol/inspector) is a web-
119243
yarn build
120244

121245
# Run with Inspector
122-
npx @modelcontextprotocol/inspector node dist/main.js
246+
npx @modelcontextprotocol/inspector node dist/src/main.js
123247
```
124248

125249
### 2. Manual Test Script

yarn.lock

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,22 @@ __metadata:
5353
languageName: node
5454
linkType: hard
5555

56+
"@anthropic-ai/sdk@npm:^0.71.2":
57+
version: 0.71.2
58+
resolution: "@anthropic-ai/sdk@npm:0.71.2"
59+
dependencies:
60+
json-schema-to-ts: "npm:^3.1.1"
61+
peerDependencies:
62+
zod: ^3.25.0 || ^4.0.0
63+
peerDependenciesMeta:
64+
zod:
65+
optional: true
66+
bin:
67+
anthropic-ai-sdk: bin/cli
68+
checksum: 10c0/6561264d2d516b0a2a2f48bba739497b76ec1ef85a5b78deca7900701513ca7cb5317dc4ee8147fc3f734709d364e29e2aaf79b39afe8284b0bf0c0c172f8223
69+
languageName: node
70+
linkType: hard
71+
5672
"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.16.7":
5773
version: 7.27.1
5874
resolution: "@babel/code-frame@npm:7.27.1"
@@ -89,6 +105,13 @@ __metadata:
89105
languageName: node
90106
linkType: hard
91107

108+
"@babel/runtime@npm:^7.18.3":
109+
version: 7.28.4
110+
resolution: "@babel/runtime@npm:7.28.4"
111+
checksum: 10c0/792ce7af9750fb9b93879cc9d1db175701c4689da890e6ced242ea0207c9da411ccf16dc04e689cc01158b28d7898c40d75598f4559109f761c12ce01e959bf7
112+
languageName: node
113+
linkType: hard
114+
92115
"@babel/types@npm:^7.28.5":
93116
version: 7.28.5
94117
resolution: "@babel/types@npm:7.28.5"
@@ -2145,6 +2168,7 @@ __metadata:
21452168
version: 0.0.0-use.local
21462169
resolution: "codingbuddy@workspace:mcp-server"
21472170
dependencies:
2171+
"@anthropic-ai/sdk": "npm:^0.71.2"
21482172
"@modelcontextprotocol/sdk": "npm:^1.0.1"
21492173
"@nestjs/cli": "npm:^10.0.0"
21502174
"@nestjs/common": "npm:^10.0.0"
@@ -2162,7 +2186,8 @@ __metadata:
21622186
vitest: "npm:^4.0.15"
21632187
zod: "npm:^3.22.0"
21642188
bin:
2165-
codingbuddy-mcp: ./dist/main.js
2189+
codingbuddy: ./dist/src/cli/cli.js
2190+
codingbuddy-mcp: ./dist/src/main.js
21662191
languageName: unknown
21672192
linkType: soft
21682193

@@ -3781,6 +3806,16 @@ __metadata:
37813806
languageName: node
37823807
linkType: hard
37833808

3809+
"json-schema-to-ts@npm:^3.1.1":
3810+
version: 3.1.1
3811+
resolution: "json-schema-to-ts@npm:3.1.1"
3812+
dependencies:
3813+
"@babel/runtime": "npm:^7.18.3"
3814+
ts-algebra: "npm:^2.0.0"
3815+
checksum: 10c0/609bae04aa5e860a11b6d30ccf41445fae1c7f66fb600c1d170257cf33aa468aa9d03aa046428c3688aff0ff450c2b0c76584b66fa4a5d0da8e33799e4c439a6
3816+
languageName: node
3817+
linkType: hard
3818+
37843819
"json-schema-traverse@npm:^0.4.1":
37853820
version: 0.4.1
37863821
resolution: "json-schema-traverse@npm:0.4.1"
@@ -5502,6 +5537,13 @@ __metadata:
55025537
languageName: node
55035538
linkType: hard
55045539

5540+
"ts-algebra@npm:^2.0.0":
5541+
version: 2.0.0
5542+
resolution: "ts-algebra@npm:2.0.0"
5543+
checksum: 10c0/4ae93bec1bada635bba425854eec323dad50b6ffe86bc04ad2d7f9ce3fb129d673dcf483e19a6e70d07a3a9083e6a0a7f4e004bb8d2164cddc60cc9540ba187f
5544+
languageName: node
5545+
linkType: hard
5546+
55055547
"ts-api-utils@npm:^2.1.0":
55065548
version: 2.1.0
55075549
resolution: "ts-api-utils@npm:2.1.0"

0 commit comments

Comments
 (0)