Skip to content

feat: MCP tokens section in user settings - #371

Merged
neSpecc merged 3 commits into
mainfrom
feat/mcp-tokens
Oct 28, 2026
Merged

neSpecc merged 3 commits into
mainfrom
feat/mcp-tokens

Conversation

@neSpecc

@neSpecc neSpecc commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds an "MCP" section to the user settings page, so users can connect AI assistants (Claude, Cursor) to their notes through the new MCP endpoint in notes.api.

Depends on codex-team/notes.api#309, which adds the /user/mcp-tokens routes and the /mcp endpoint.

  • New token: label plus an "Allow editing" switch (off by default, so tokens are read-only unless the user opts in).
  • Created token is shown once, with copy buttons and ready-made setup snippets for Claude Code, Cursor and Claude custom connectors (${VITE_API_URL}/mcp + Authorization: Bearer …).
  • Token list: label, ntx_… preview, permission, last usage, request count; revoke with confirmation.

Layers follow the existing structure: McpToken entity, repository interface, McpTokenService, McpTokenRepository on NotesApiTransport, useMcpTokens composable, and the McpTokens.vue component rendered from Settings.vue. Texts are added to en.json (the only locale).

image image

Test plan

  • vue-tsc --noEmit
  • ESLint on changed files
  • Manually against a local notes.api from [Bug]: Note settings tab patches to note name #309: created read and write tokens, copied snippets, checked the list updates and usage counters, revoked a token (it then gets 401 from /mcp), no horizontal scroll at 375px width

Let users create personal MCP tokens for AI assistants (Claude, Cursor)
and manage them from the settings page. Works with the /user/mcp-tokens
routes and the /mcp endpoint in notes.api.

- Create a token with a label and an optional "Allow editing" switch
  (read-only by default).
- Show the new token once with copy buttons and setup snippets for
  Claude Code, Cursor and Claude custom connectors.
- List tokens with permission, preview, last usage and request count,
  and revoke them with confirmation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
codex-ui Ready Ready Preview Oct 21, 2026 12:28am UTC

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.

🟡 Changes recommended

Initial loading can overwrite newly created tokens, and load failures hide token management without visible recovery.

2 open issues
What changed in this PR

Adds MCP token management to user settings, connecting AI assistants to notes through the existing application, domain, and repository layers.

Changes:

  • Adds token creation with read-only defaults and copyable setup instructions.
  • Lists token permissions and usage, with confirmed revocation.
  • Adds API integration and English UI text.
File Description
src/​presentation/​pages/​Settings.vue Includes the MCP section.
src/​presentation/​components/​mcp/​McpTokens.vue Adds token management and setup UI.
src/​infrastructure/​mcpToken.repository.ts Implements token API requests.
src/​infrastructure/​index.ts Registers the token repository.
src/​domain/​mcpToken.service.ts Adds token service operations.
src/​domain/​mcpToken.repository.interface.ts Defines the repository contract.
src/​domain/​index.ts Exports the token service.
src/​domain/​entities/​McpToken.ts Defines token data types.
src/​application/​services/​useMcpTokens.ts Manages token loading and mutations.
src/​application/​i18n/​messages/​en.json Adds MCP interface text.

Review effort: Balanced

Comment thread src/domain/mcpToken.service.ts Resolved
- Disable "Create token" until the initial token list is loaded, so a
  late list response can't replace a just-created token.
- Show "Could not load tokens" with a retry button when loading fails,
  instead of looking the same as having no tokens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Rename McpTokenService and McpTokenRepository to UserSettingsService
  and UserSettingsRepository with getMcpTokens, createMcpToken and
  revokeMcpToken methods.
- Rename the useMcpTokens composable to useUserMcpSettings.
- Use the text-monospaced class from the codex-ui typescale for setup
  snippets instead of custom font styles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@neSpecc
neSpecc merged commit 475e705 into main Oct 28, 2026
8 checks passed
@neSpecc
neSpecc deleted the feat/mcp-tokens branch October 28, 2026 16:47

This branch was successfully deployed

1 active deployment
Preview — 58a9135a Deployed Oct 21, 2026 by vercel[bot]
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