feat: External API integration with MCP tools and Raycast support#925
Draft
feat: External API integration with MCP tools and Raycast support#925
Conversation
Renames the existing mcp-server target's product to tablepro-mcp and moves source from TablePro/MCPBridge to TablePro/CLI per plan. Adds auto-launch of TablePro via tablepro://integrations/start-mcp with a 10-second poll for the handshake file, plus stale-PID detection that relaunches the host. Bridges SSE responses by emitting each data: line as a separate JSON-RPC message on stdout. Adds an explicit TablePro -> mcp-server target dependency so the helper binary always builds before the app embed step. Sets PRODUCT_BUNDLE_IDENTIFIER=com.TablePro.tablepro-mcp. Verification: xcodebuild -scheme mcp-server -configuration Debug build succeeds; tablepro-mcp ends up at TablePro.app/Contents/MacOS/tablepro-mcp, executable, codesigned, hardened runtime on. swiftlint --strict clean on TablePro/CLI/. build-release.sh now fails fast if the embedded helper is missing from the release bundle. The internal Xcode target name stays "mcp-server" to keep the pbxproj diff minimal; only the product name, bundle id, and source path change.
Move the full parameter list (core, SSH, SSL, plugin-specific af_* fields) from features/deep-links into external-api/url-scheme. The url-scheme page previously punted to deep-links via 'See Deep Links for the full parameter list', which becomes a dangling link once deep-links is removed.
…-api The previous page duplicated the External API tool catalog, token model, and stdio bridge config in less detail. It also hardcoded a stale default port (23508) and the internal Xcode target name (mcp-server) instead of the shipped binary name (tablepro-mcp). Replace with a focused page that covers the in-app Settings > MCP UI: enable toggle, lazy-start, remote access, TLS, audit log. Link to the canonical external-api pages for protocol details, the tool catalog, tokens, pairing, and client setup. Section anchors #enabling-the-server and #remote-access are preserved so existing cross-references from customization/settings.mdx and external-api/cursor-claude.mdx still resolve.
The page documented the pre-0.37 'tablepro://connect/<name>' syntax, which contradicts external-api/url-scheme.mdx (UUID-keyed paths only). Database URL schemes (mysql://, postgresql://, etc.) are already canonical in databases/connection-urls.mdx, and the tablepro://import parameter table now lives in external-api/url-scheme.mdx. - Delete docs/features/deep-links.mdx - Update features/overview.mdx Workflow card to point to external-api/url-scheme - Remove features/deep-links from docs.json Workflow group
…o path The MCP subsystem wrote its handshake, tokens, and audit DB under ~/Library/Application Support/com.TablePro/, while every other on-disk file (connections.json, TabState/, LastQuery/, known_hosts, themes) lives under ~/Library/Application Support/TablePro/. Bundle-id paths are the sandboxed-app convention; TablePro is non-sandboxed and should use the friendly app-name directory throughout. Updates the three MCP path constructions, the bundled tablepro-mcp bridge, the Raycast extension, and every docs reference. The com.TablePro identifier is preserved in OSLog subsystems, Keychain, UserDefaults keys, the bundle id, AppGroup ids, and NSUserActivity types since those are not file paths. No migration code or compat shim per CLAUDE.md "no backward-compat hacks". After upgrading, users must re-pair Raycast, Cursor, Claude Desktop, and any other external MCP clients, and may delete the stale directory with `rm -rf ~/Library/Application Support/com.TablePro`.
Also log previously swallowed best-effort failures from updateCommandMetadata and the post-pair redirect so they surface in dev. The setInterval polling in WaitingView remains, since LocalStorage cannot signal cross-command writes.
6 tasks
# Conflicts: # CHANGELOG.md
…ce destroyed connection window)
…ess of loading state machine
…tead of new native window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ships TablePro's first-class External API for Raycast, Cursor, Claude Desktop, and other MCP-compatible clients. Three integration channels with clearly separated responsibilities:
tablepro://URL scheme for navigation actions (open connection, table, query)49 commits across Swift (foundation, pairing, audit, tools, CLI binary, settings rename), Mintlify docs (full External API section + cross-references through the existing docs site), and unit tests (export injection regression).
What's new
Swift
tablepro://URL scheme; newintegrations/pair,integrations/start-mcp,connect/<uuid>/query?...&token=actionsblocked/readOnly/readWrite, defaults toreadOnly)MCPPairingServicewith PKCE exchange + native approval sheetmcp-audit.db, 90-day retention) + Activity Log view in Settingslist_recent_tabs,search_query_history,open_connection_window,open_table_tab,focus_query_tabtablepro-mcpstdio CLI binary embedded in the app bundle (enables Cursor / Claude Desktop / Claude Code without an extension)~/Library/Application Support/TablePro/(matches macOS convention for non-sandboxed apps)Security hardening (post-review)
export_datatable names validated against^[A-Za-z0-9_][A-Za-z0-9_.]*$and dialect-quoted; synthesized queries now route throughcheckQueryPermissionlike the explicit query branchlist_connectionsfiltered by the token'sallowedConnectionIds; empty Set means no accessfocus_query_tabrejects tabs without a connection (no auth bypass via nil-connection scratch tabs)open_connection_window,open_table_tab,focus_query_tabonly requirereadOnly(was blocking the default Raycast user sincereadOnlyis the connection default)export_dataoutput_pathrestricted to~/Downloads/; symlinks and..resolved before the bounds checkfocus_query_tab(no window-focus-then-deny TOCTOU)Docs
docs/external-api/section: URL scheme reference, MCP tools catalog, MCP resources, pairing sequence, tokens model, MCP clients (9 client config examples), versioning policyfeatures/deep-links.mdxfeatures/mcp.mdxfrom 307 lines to 81 as an orientation page that links intodocs/external-api/Tests
MCPToolHandlerExportTests(new, 7 cases): regression tests forexport_datatable-name injection (;DROP TABLE, backtick escape, leading dot, empty), schema-qualified-name acceptance, sandbox enforcement onoutput_pathNote on the Raycast extension
The Raycast extension that consumes this API is shipped separately to the official Raycast Store via a PR to github.com/raycast/extensions, per Raycast's distribution model (every Store extension lives in that monorepo). That follow-up PR is staged locally and will go up after this lands and the next TablePro version ships, so the extension can reference shipped behavior.
Breaking changes
tablepro://connect/<name>/...deep links removed. Replace with UUID-keyed paths via Copy Connection Deep Link in the sidebar context menu. User-saved bookmarks must be regenerated.~/Library/Application Support/com.TablePro/to~/Library/Application Support/TablePro/. Existing tokens, audit log, and handshake files are not migrated. Re-pair Raycast / Cursor / Claude Desktop / any external clients after upgrading. Optionally delete the old directory:rm -rf ~/Library/Application Support/com.TablePro/Architecture decisions
MCPTokenStore)readOnlybelt-and-suspenders against accidental mutations from a token withfullAccessscopeTest plan
xcodebuild ... buildsucceeds cleanopen "tablepro://connect/<uuid>"opens the connection; old name-keyed paths fail gracefullyopen_table_tabworks from Raycast on a defaultreadOnlyconnection (regression check for the readWrite-gate fix)readOnlyconnection rejects mutating SQL with 403export_datarejects table names with SQL metacharacters; only writes under~/Downloads/tablepro-mcpinto Claude Desktop'smcp-config.json, restart,@tableprolists toolsRelated
mainas of c9a17b1)