Skip to content

feat(mcp): prefer Local HTTP over opening SQLite - #554

Merged
cursor[bot] merged 9 commits into
developfrom
cursor/wire-mcp-local-http-d6ed
Aug 22, 2026
Merged

feat(mcp): prefer Local HTTP over opening SQLite#554
cursor[bot] merged 9 commits into
developfrom
cursor/wire-mcp-local-http-d6ed

Conversation

@tomymaritano

@tomymaritano tomymaritano commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Wire @dripnex/mcp-server to Dripnex Local HTTP so Cursor / Grok / Claude talk Bearer loopback instead of opening SQLite when the HTTP env is set. Settings → Integrations → MCP now copies that same HTTP env.

  • Prefer DRIPNEX_LOCAL_SERVER_URL + DRIPNEX_LOCAL_TOKEN (loopback only). SQLite (DRIPNEX_DB_PATH) remains the fallback when those are unset.
  • Map existing tools onto the real routes in localServer.ts (notes, search, books=notebooks, tags).
  • Add the missing HTTP surfaces: dripnex_status, notebook CRUD, tag create/update, dripnex_get_changes.
  • Soft-delete vs hard-delete follows the desktop handler: DELETE /api/notes/:id is trash; ?permanent=1 is hard delete (dripnex_trash_note permanent).
  • Writes stay gated by Settings → Integrations → Allow writes (mcp.json) / DRIPNEX_MCP_WRITES. Enabling Local HTTP is not a write grant (verified: httpApiEnabled vs mcpWrites are separate). Flipping Allow writes does not change the copied snippet.
  • Settings snippets: Claude Code / Codex copy DRIPNEX_LOCAL_SERVER_URL + DRIPNEX_LOCAL_TOKEN (the URL and token already shown in the panel) when Local HTTP or MCP is on. DRIPNEX_DB_PATH is only used when HTTP is off. The launch path stays the real mcp-server entry when the app knows it; otherwise /ABS/PATH/... remains a placeholder — HTTP env is still preferred.
  • HTTP client unit tests use mocked fetch. HTTP store mapping is covered with a stub client. Snippet tests use placeholder-token and /tmp paths only.

docs/ai/ is not on develop — it lives on docs/ai-mcp-plan. Env and Cursor/Grok config are in packages/mcp-server/README.md (placeholders only; no tokens).

Type of Change

  • New feature
  • Documentation update

Checklist

  • PR targets develop branch (not main)
  • MCP tests: 35 passed (http client/config/store, writes, notes, sqliteRepo)
  • Snippet tests: 7 passed
  • Monorepo typecheck passed on push
  • fts5-triggers fails in this cloud Node build (no such module: fts5) — pre-existing, file not changed
Open in Web Open in Cursor 

Map MCP tools onto the desktop loopback API when
DRIPNEX_LOCAL_SERVER_URL and DRIPNEX_LOCAL_TOKEN are set. Keep the
SQLite path as fallback. Add status, notebook CRUD, tag writes, and
changes tools. Writes stay gated by mcp.json / DRIPNEX_MCP_WRITES.
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@tomymaritano, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 8 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 11d9b147-32bf-48fd-8919-8b729f7a64de

📥 Commits

Reviewing files that changed from the base of the PR and between d35220f and e266aa7.

📒 Files selected for processing (15)
  • apps/desktop/src/renderer/pages/settings/sections/McpCard.tsx
  • apps/desktop/src/renderer/utils/__tests__/mcpSnippets.test.ts
  • apps/desktop/src/renderer/utils/mcpSnippets.ts
  • packages/mcp-server/README.md
  • packages/mcp-server/src/__tests__/httpClient.test.ts
  • packages/mcp-server/src/__tests__/httpConfig.test.ts
  • packages/mcp-server/src/__tests__/httpStore.test.ts
  • packages/mcp-server/src/__tests__/notes.test.ts
  • packages/mcp-server/src/__tests__/writes.test.ts
  • packages/mcp-server/src/db.ts
  • packages/mcp-server/src/http.ts
  • packages/mcp-server/src/httpStore.ts
  • packages/mcp-server/src/index.ts
  • packages/mcp-server/src/sqliteStore.ts
  • packages/mcp-server/src/store.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Lock note/book/tag/changes calls to the Local HTTP shapes and keep
prepareFtsQuery private to the SQLite store.
Comment thread packages/mcp-server/src/http.ts Fixed
Comment thread packages/mcp-server/src/http.ts Fixed
@tomymaritano
tomymaritano marked this pull request as ready for review August 22, 2026 04:28
tomymaritano and others added 2 commits August 21, 2026 21:28
Settings → Integrations → MCP now pastes DRIPNEX_LOCAL_SERVER_URL and
DRIPNEX_LOCAL_TOKEN when the loopback API is on. DRIPNEX_DB_PATH stays
the fallback only when HTTP is off. Writes remain the separate toggle.
@cursor
cursor Bot enabled auto-merge (squash) August 22, 2026 17:52
CodeQL flagged `rawUrl.replace(/\/+$/, '')` as js/polynomial-redos (high).
`/+$` backtracks quadratically on a long run of slashes that is not at the
end of the string: 40k slashes took ~1.3s. Replace it with a linear scan.

Adds a test with a 100ms budget on that pathological input, plus one
covering multiple trailing slashes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tomymaritano

Copy link
Copy Markdown
Collaborator Author

Pushed a fix for the CodeQL js/polynomial-redos (high) alert on packages/mcp-server/src/http.ts.

rawUrl.replace(/\/+$/, '') backtracks quadratically on a long run of slashes that is not at the end of the string — measured ~1.3s for 40k slashes. Replaced with a linear scan, plus a test that fails if it regresses (100ms budget on that input) and one covering multiple trailing slashes.

mcp-server tests: 42/42 green.

tomymaritano and others added 3 commits August 22, 2026 18:05
github-code-quality flagged `data !== null` as a comparison between
inconvertible types. The preceding `data &&` already excludes null and
undefined, so the check was dead. Behaviour is unchanged; the 401 case in
httpClient.test.ts covers this branch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cursor
cursor Bot merged commit bcc1b78 into develop Aug 22, 2026
16 checks passed
@cursor
cursor Bot deleted the cursor/wire-mcp-local-http-d6ed branch August 22, 2026 21:37
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.17.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants