Skip to content

Add one-line setup for AI client global rules + MCP OAuth connection#134

Merged
rahilp merged 3 commits into
mainfrom
133-add-one-line-setup-for-ai-client-global-rules-+-mcp-oauth-connection
Jun 7, 2026
Merged

Add one-line setup for AI client global rules + MCP OAuth connection#134
rahilp merged 3 commits into
mainfrom
133-add-one-line-setup-for-ai-client-global-rules-+-mcp-oauth-connection

Conversation

@rahilp

@rahilp rahilp commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds scripts/connect-ai-clients.sh and scripts/connect-ai-clients.ps1 — cross-platform one-liners that append global system instructions to the local AI client config files (~/.claude/CLAUDE.md, ~/.codex/AGENTS.md) and register the worker's /mcp endpoint with both clients via OAuth, with no bearer token ever touching the script, shell history, or a config file
  • Adds AI_Instructions/CODEX_INSTRUCTIONS.md, a Codex-tailored copy of the mandatory rules (source: "codex", codex-response tag)
  • Updates README.md's connect step to the new one-liners and corrects the OAuth section, which previously claimed the CLI clients "keep using the Authorization: Bearer header, no change needed" — both now support the cleaner, verified browser-based OAuth flow directly (claude mcp add --transport http ... and codex mcp add ... --url ... both trigger discovery + DCR + browser login automatically against the live worker)

Closes #133

Test plan

  • Sandboxed dry run (HOME redirected, claude/codex stubbed on PATH): confirms marker-wrapped instruction blocks are appended correctly to both config files
  • Re-run is fully idempotent — skips with "already configured", no duplicate blocks
  • Pre-existing unmarked manual installs are detected via sentinel-phrase match and skipped (no duplication)
  • Already-registered MCP servers are detected and skipped cleanly on re-run
  • Malformed worker URLs (missing scheme) are rejected with a clear error
  • Live-tested the underlying claude mcp add --transport http ... and codex mcp add ... --url ... commands against the deployed worker — both complete OAuth discovery/registration/login and the resulting connections can call real MCP tools
  • Run scripts/connect-ai-clients.ps1 on Windows or via pwsh (not available in dev environment)
  • End-to-end smoke test of the published one-liners themselves once merged to main (raw.githubusercontent fetch currently 404s for files that only exist on this branch)
  • shellcheck scripts/connect-ai-clients.sh (not installed in dev environment)

…ection

Connecting an AI tool to Second Brain required several manual steps spread
across docs and a wiki page (pasting global instructions into per-tool config
files, then registering the /mcp endpoint by hand). This adds a single
cross-platform one-liner that appends global system instructions to the
relevant AI client config files (idempotently, with detection of pre-existing
manual installs) and registers the worker's /mcp endpoint via OAuth — no
bearer token ever touches the script, shell history, or a config file. Also
corrects the README's OAuth section, which previously claimed the CLI clients
"keep using the Authorization: Bearer header, no change needed" — both now
support the cleaner browser-based OAuth flow directly.
@rahilp rahilp linked an issue Jun 7, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 81.27% 547 / 673
🔵 Statements 82.08% 646 / 787
🔵 Functions 80.95% 85 / 105
🔵 Branches 75.78% 385 / 508
File CoverageNo changed files found.
Generated in workflow #129 for commit 833c2c8 by the Vitest Coverage Report Action

rahilp added 2 commits June 7, 2026 14:32
The one-line setup instructions belong in the Connect-to-AI-Clients wiki
page (where all per-client connection steps already live) rather than
inline in the README — keeps the README scannable and the wiki as the
single source of truth for connection instructions.
Restructures the setup walkthrough around how someone actually proceeds:
deploy, then either run the CLI one-liner (Claude Code / Codex) or follow
the per-app wiki steps for ChatGPT and Claude's desktop/web apps — surfacing
the one-line setup directly instead of burying it behind a generic link.
@rahilp rahilp merged commit 272a6ee into main Jun 7, 2026
1 check passed
@rahilp rahilp deleted the 133-add-one-line-setup-for-ai-client-global-rules-+-mcp-oauth-connection branch June 7, 2026 18:35
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.

Add one-line setup for AI client global rules + MCP OAuth connection

1 participant