Skip to content

Add spark_login so Claude can auth in-chat without a pre-minted token - #4

Open
Hewlbern wants to merge 1 commit into
mainfrom
cursor/spark-login-mcp-51fb
Open

Add spark_login so Claude can auth in-chat without a pre-minted token#4
Hewlbern wants to merge 1 commit into
mainfrom
cursor/spark-login-mcp-51fb

Conversation

@Hewlbern

@Hewlbern Hewlbern commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Claude (and Gemini Spark) can now log in with handle + password inside the chat, then save and share conversation logs to the user's Solid pod. A pre-minted token from /app is no longer required.

What changed

New MCP tools on the Vercel-hosted server (api/mcp.js, mirrored in frontend/api and Go internal/openidmcp):

  • spark_loginhandle (or email) + password → POST /idp/login → mint a 30-day Spark connect token the same way /api/spark-token does (api/_lib/jwt.js + grant persist). Returns { ok, handle, webId, mcpUrl, token, expires, tokenType: "Bearer", hint }. Does not echo or log the password.
  • spark_register — handle + password + optional name, same mint path via /idp/register.

Server instructions tell the model: if the user says “save this conversation”, “share these logs”, or “log into my OpenID”, call spark_login when there is no token yet, then spark_save_conversation with the full thread, then spark_share_conversation and return the /share/c/… URL.

The existing Authorization: Bearer header path (Claude custom connector Request headers / /app mint) still works.

Claude setup

A. Mint on /app and paste Authorization: Bearer <token> into the connector headers.

B. Add https://<origin>/mcp with no auth and use spark_login in chat.

Railway is unchanged (no GitHub reconnect; pod stays on the ghcr.io image).

Preview proof

Preview: https://identity-o5dbm6myc-hewlberns-projects.vercel.app
GET /mcp advertises spark.login: spark_login.

MCP_URL=https://identity-o5dbm6myc-hewlberns-projects.vercel.app ./scripts/prove-spark-login.sh

Result (2026-09-01):

  • tools/list includes spark_login, spark_register, spark_save_conversation, spark_share_conversation
  • spark_register + spark_login(handle, pass) minted a 30-day Bearer (password not echoed)
  • spark_save_conversation wrote the thread
  • spark_share_conversation returned /share/c/…
  • public GET 200

Example share: https://identity-o5dbm6myc-hewlberns-projects.vercel.app/share/c/prove1788303427.799da161a617ea0c1d4ebaa724e05b72

Open in Web Open in Cursor 

Mint a 30-day Spark connect token from handle+password via /idp/login
(and optional spark_register), keep the existing Bearer header path, and
document both Claude connector setups.

Co-authored-by: audacity <Hewlbern@users.noreply.github.com>
@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
identity Building Building Preview Sep 1, 2026 10:56pm UTC

@Hewlbern
Hewlbern marked this pull request as ready for review September 1, 2026 22:57
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.

2 participants