Skip to content

docs(mcp): document browser login and multi-project scoping - #404

Closed
Matovidlo wants to merge 2 commits into
mainfrom
martinvasko/docs-mcp-auth-scoping-update
Closed

docs(mcp): document browser login and multi-project scoping#404
Matovidlo wants to merge 2 commits into
mainfrom
martinvasko/docs-mcp-auth-scoping-update

Conversation

@Matovidlo

Copy link
Copy Markdown
Contributor

Jira issue(s): none (no PROOF ticket — small factual doc correction/addition)

Changes:

  • Documents the MCP server's browser-based login/logout CLI as the recommended way to authenticate a local server, and the token-based fallback (KBC_STORAGE_TOKEN + KBC_PROJECT_ID/X-KBC-ProjectId) for containers/CI using stack-wide programmatic tokens (kbc_at_/kbc_pat_).
  • Documents the new multi-project session flow: get_accessible_projects and set_project_scope, including the scope_token resend requirement on the stateless HTTP transport.
  • Fixes a stale env var name (KBC_API_URLKBC_STORAGE_API_URL) that no longer matched the server's actual config.
  • Replaces a hardcoded "15 read-only tools" table (now stale — actual count is 23+) with a pointer to the auto-generated TOOLS.md in the mcp-server repo.

Source: reviewed the current keboola/mcp-server source (config.py, scope.py, tools/project.py, clients/auth_bridge.py) and its README, which already reflects these changes, to make sure integrate/mcp.md here is accurate rather than just copying prose.

Reflects the MCP server's BC auth changes: the login/logout CLI
for browser-based sessions, programmatic-token (kbc_at_/kbc_pat_)
project selection via get_accessible_projects/set_project_scope,
and fixes a stale KBC_API_URL env var name plus a hardcoded
read-only tools list that had drifted out of date.
@Matovidlo

Copy link
Copy Markdown
Contributor Author

@claude review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Keboola MCP integration documentation to reflect current authentication and project-scoping behavior, replacing stale/duplicated tool listings and correcting environment variable naming.

Changes:

  • Replaces the static “read-only tools” list with a reference to the auto-generated TOOLS.md in keboola/mcp-server.
  • Updates the documented env var and example command to use KBC_STORAGE_API_URL instead of the stale KBC_API_URL.
  • Documents browser-based login/logout and the multi-project scoping flow (get_accessible_projects / set_project_scope), including scope_token handling notes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread integrate/mcp.md
uvx keboola_mcp_server login --api-url https://connection.YOUR_REGION.keboola.com
```

This saves a stack-wide session to `~/.keboola/mcp/credentials.json` (readable only by you). Afterwards, start the server with only `KBC_STORAGE_API_URL` set — no token required. Which project(s) to work on is then chosen from within the conversation itself (see [Working Across Multiple Projects](#working-across-multiple-projects) below), not at login time.
Comment thread integrate/mcp.md
2. Ask the user whether to operate across all of them or a chosen subset.
3. Call `set_project_scope` with the selected `project_ids` (and optionally `read_only=true` to mint a read-only scoped token).

`set_project_scope` mints a scoped access token narrowed to the chosen projects. Read-only tools then run against every scoped project in a single call; write operations always target the first scoped project only — re-scope first to write elsewhere. Because the server does not keep session state between calls on the stateless HTTP transport, `set_project_scope` and `get_accessible_projects` return a `scope_token` that must be resent as the `scope_token` argument on every subsequent tool call in the conversation (OAuth-authenticated sessions are the exception — the server persists the scope server-side for those, so no resending is needed).
KBC_STORAGE_TOKEN still works but is being phased out in favor of
the browser login flow; flags this at the point of use (uv, Docker)
and in the login section itself.
Comment thread integrate/mcp.md
Instead of setting a static `KBC_STORAGE_TOKEN`, you can sign in once with your browser; the server stores the session and refreshes it automatically:

```bash
uvx keboola_mcp_server login --api-url https://connection.YOUR_REGION.keboola.com

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be refered via env variable as above.

@Matovidlo
Matovidlo requested a review from jordanrburger August 3, 2026 08:14
@Matovidlo
Matovidlo marked this pull request as ready for review August 3, 2026 08:14

@keboola-pr-reviewer-bot keboola-pr-reviewer-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: needs_human (risk 2/5) · profile docs

Needs human: substantive new product-behaviour claims and a cross-repo link that can't be verified from this diff.

Concerns:

  • integrate/mcp.md: New product-behaviour claims (login flow, scope_token, token prefixes) unverifiable from diff
  • integrate/mcp.md: Cross-repo link to keboola/mcp-server TOOLS.md not verifiable
  • integrate/mcp.md: Env-var rename KBC_API_URL to KBC_STORAGE_API_URL unconfirmed against source

Suggested reviewers: @keboola/docs

@jordanrburger

Copy link
Copy Markdown
Contributor

Can you move this to the help docs? We're killing dev docs.

@Matovidlo

Copy link
Copy Markdown
Contributor Author

@jordanrburger it should be moved at once I think. Do we have some ETA when its happening?

@jordanrburger

Copy link
Copy Markdown
Contributor

We're moving it in pieces. MCP was moved already.

@Matovidlo

Copy link
Copy Markdown
Contributor Author

Closing this — Jordan confirmed integrate/mcp.md is being consolidated into connection-docs per PRDCT-580 (keboola/connection-docs#1050, open) and will be deleted from this repo in a follow-up PR once that merges. Re-landing the browser-login/multi-project-scoping content directly in connection-docs instead of here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants