@@ -32,19 +32,26 @@ Search by what code *does*, not what it's named.
3232
3333## Install
3434
35- Add to your MCP config (Claude Code ` ~/.claude.json ` , Cursor settings, etc.):
35+ The MCP server automatically detects the project root — no path argument needed.
36+
37+ Add to your MCP config (Claude Code ` ~/.claude.json ` , Cursor settings, opencode, etc.):
3638
3739``` json
3840{
3941 "mcpServers" : {
4042 "rpg" : {
4143 "command" : " npx" ,
42- "args" : [" -y" , " -p" , " rpg-encoder" , " rpg-mcp-server" , " /path/to/your/project " ]
44+ "args" : [" -y" , " -p" , " rpg-encoder" , " rpg-mcp-server" ]
4345 }
4446 }
4547}
4648```
4749
50+ > [ !TIP]
51+ > The path argument is optional. When omitted, the server falls back to the current working directory.
52+ > MCP clients (like opencode, Claude Code, Cursor) launch the server from the workspace directory,
53+ > so ` current_dir() ` automatically points to your project. If you pass a path explicitly, it will use that instead.
54+
4855<details >
4956<summary >Alternative: build from source</summary >
5057
@@ -59,46 +66,49 @@ Then use the binary path directly:
5966{
6067 "mcpServers" : {
6168 "rpg" : {
62- "command" : " /path/to/rpg-encoder/target/release/rpg-mcp-server" ,
63- "args" : [" /path/to/your/project" ]
69+ "command" : " /path/to/rpg-encoder/target/release/rpg-mcp-server"
6470 }
6571 }
6672}
6773```
6874
75+ > [ !TIP]
76+ > The binary also accepts an optional path argument. Omit it to use the current working directory.
77+
6978</details >
7079
7180<details >
7281<summary ><strong >Multi-repo setup</strong ></summary >
7382
74- The MCP server operates on the directory passed as its first argument. For multi-repo usage:
83+ The path argument is optional — the server defaults to the current working directory. This works
84+ automatically because MCP clients launch the server from the workspace directory.
7585
76- ** Option 1: Global config (single primary repo )**
86+ ** Global config (all repos use cwd )**
7787
78- Set your main development repo in ` ~/.claude.json ` :
88+ No path needed — each session uses the directory where the MCP client was started :
7989
8090``` json
8191{
8292 "mcpServers" : {
8393 "rpg" : {
8494 "command" : " npx" ,
85- "args" : [" -y" , " -p" , " rpg-encoder" , " rpg-mcp-server" , " /path/to/primary/repo " ]
95+ "args" : [" -y" , " -p" , " rpg-encoder" , " rpg-mcp-server" ]
8696 }
8797 }
8898}
8999```
90100
91- ** Option 2: Per-project override**
101+ ** Per-project override (explicit path) **
92102
93- Create ` .claude/mcp_servers.json ` in each repo that needs RPG :
103+ If you need a specific repo, pass the path :
94104
95105``` json
96106{
97- "rpg " : {
98- "type " : " stdio " ,
99- "command" : " npx" ,
100- "args" : [" -y" , " -p" , " rpg-encoder" , " rpg-mcp-server" , " /path/to/this/repo" ],
101- "env" : { }
107+ "mcpServers " : {
108+ "rpg " : {
109+ "command" : " npx" ,
110+ "args" : [" -y" , " -p" , " rpg-encoder" , " rpg-mcp-server" , " /path/to/this/repo" ]
111+ }
102112 }
103113}
104114```
0 commit comments