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: src/python/cocalc-api/src/cocalc_api/mcp/DEVELOPMENT.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,13 +174,15 @@ except Exception as e:
174
174
175
175
-`COCALC_API_KEY` - API key (required)
176
176
-`COCALC_HOST` - CoCalc instance URL (optional, defaults to `https://cocalc.com`)
177
-
-`COCALC_PROJECT_ID` - Project ID for project-scoped keys (optional, embedded in key)
177
+
-`COCALC_PROJECT_ID` - Optional project ID used only with **account-scoped** keys to target a specific project. Ignored for project-scoped keys (project_id comes from the key itself).
178
178
179
179
### API Key Scope Detection
180
180
181
-
The server calls `hub.system.test()` to determine scope:
Copy file name to clipboardExpand all lines: src/python/cocalc-api/src/cocalc_api/mcp/README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,8 @@ A Model Context Protocol (MCP) server that provides LLMs (Claude, etc.) with dir
9
9
```bash
10
10
export COCALC_API_KEY="sk-your-api-key"# Account or project-scoped
11
11
export COCALC_HOST="http://localhost:5000"# Optional, defaults to https://cocalc.com
12
+
# Optional: only used with account-scoped keys to target a specific project
13
+
# export COCALC_PROJECT_ID="your-project-uuid"
12
14
```
13
15
14
16
### 2. Run the Server
@@ -18,6 +20,7 @@ uv run cocalc-mcp-server
18
20
```
19
21
20
22
The server will detect your API key type and automatically register the appropriate tools/resources.
23
+
If you supply `COCALC_PROJECT_ID` with an account-scoped key, the MCP server will also prepare a project client for that project. For project-scoped keys, `COCALC_PROJECT_ID` is ignored because the project is embedded in the key.
0 commit comments