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
Copy file name to clipboardExpand all lines: doc/workspace.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Consider these common scenarios:
16
16
"mcpServers": {
17
17
"filesystem": {
18
18
"command": "uvx",
19
-
"args": ["mcp-server-filesystem", "${PWD}"]
19
+
"args": ["mcp-server-filesystem", "${CWD}"]
20
20
}
21
21
}
22
22
}
@@ -29,7 +29,7 @@ Consider these common scenarios:
29
29
"lsp": {
30
30
"command": "mcp-language-server",
31
31
"args": [
32
-
"--workspace", "${PWD}",
32
+
"--workspace", "${CWD}",
33
33
"--lsp", "typescript-language-server",
34
34
"--", "--stdio"
35
35
]
@@ -40,6 +40,7 @@ Consider these common scenarios:
40
40
41
41
Without workspaces, you'd need to manually edit the global config for every project. With workspaces, each project gets its own configuration automatically.
42
42
43
+
43
44
## How It Works
44
45
45
46
#### 1. Project Detection
@@ -102,12 +103,12 @@ require("mcphub").setup({
102
103
"mcpServers": {
103
104
"filesystem": {
104
105
"command": "uvx",
105
-
"args": ["mcp-server-filesystem", "${PWD}"]
106
+
"args": ["mcp-server-filesystem", "${CWD}"]
106
107
},
107
108
"lsp": {
108
109
"command": "mcp-language-server",
109
110
"args": [
110
-
"--workspace", "${PWD}",
111
+
"--workspace", "${CWD}",
111
112
"--lsp", "lua-language-server",
112
113
"--", "--stdio"
113
114
]
@@ -118,18 +119,19 @@ require("mcphub").setup({
118
119
119
120
#### Environment Variables
120
121
121
-
Variables like `${PWD}` are automatically available since the hub starts with the project directory as its working directory. Basic environment variables (`HOME`, `USER`, `TERM`, `SHELL`, etc.) are always available.
122
+
`CWD` will be set to the working directory of the current running `mcp-hub`. Basic environment variables (`HOME`, `USER`, `TERM`, `SHELL`, etc.) are always available.
122
123
123
124
Additional variables can be set via:
124
125
1.**global_env** configuration in MCP Hub setup
125
126
2.**Process environment** when the hub starts
126
127
127
128
```lua
128
129
require("mcphub").setup({
129
-
global_env= {
130
-
"CUSTOM_VAR", -- Uses $CUSTOM_VAR from the environment
0 commit comments