Skip to content

Conversation

delorenj
Copy link
Contributor

Description

This PR fixes an issue where the Smart Connections plugin is not detected by MCP Tools on Linux systems, even though Smart Connections is installed and fully functional.

Problem

On Linux, Smart Connections doesn't consistently expose its API via window.SmartSearch. Instead, it's accessible through Obsidian's plugin system at app.plugins.plugins["smart-connections"].env.

Solution

Added a fallback detection mechanism that:

  1. First checks window.SmartSearch (works on some platforms)
  2. Falls back to checking app.plugins.plugins["smart-connections"].env (fixes Linux)
  3. Caches the API reference in window.SmartSearch for consistency

Changes

  • Modified loadSmartSearchAPI function in packages/obsidian-plugin/src/shared/index.ts
  • Added TypeScript type definitions for the smart-connections plugin interface
  • Added proper typing for the env property on the smart-connections plugin

Testing

Tested on Linux (Ubuntu) with:

  • Obsidian v1.5.x
  • MCP Tools v0.2.22
  • Smart Connections v3.0.39

Before fix: Smart Connections shows as ❌ not installed
After fix: Smart Connections shows as ✅ installed

✅ All TypeScript checks pass (bun run check)

Related Issues

Fixes detection issue on Linux systems where Smart Connections is functional but not detected.

delorenj added 4 commits June 21, 2025 13:27
- Added fallback detection method using plugin system
- Smart Connections doesn't always expose window.SmartSearch on Linux
- Now checks app.plugins.plugins['smart-connections'].env as fallback
- Caches the API reference in window.SmartSearch for consistency
- Added proper TypeScript types for the smart-connections plugin

Fixes issue where Smart Connections shows as not installed on Linux
despite being fully functional.
- Removed duplicate App interface declaration from types.ts
- Updated existing smart-connections type in mcp-server-install/types.ts
- Added SmartConnections import for proper typing
- Fixed type errors caught by bun run check
`versions.json` files to `0.2.24` to reflect the latest changes.
Copy link

netlify bot commented Jun 21, 2025

Deploy Preview for superb-starlight-b5acb5 canceled.

Name Link
🔨 Latest commit 28d5c3e
🔍 Latest deploy log https://app.netlify.com/projects/superb-starlight-b5acb5/deploys/6856f9f05e37da00081a1193

@mbbroberg
Copy link

I'm having a detection issue on macOS as well -- noting that this may help in that scenario as well.

@MayneX
Copy link

MayneX commented Jun 23, 2025

  • MacOS trouble. Thanks for the fix! @jacksteamdev Sorry if I bother you with mentioning, I'm just really excited about the fix

@4xle
Copy link

4xle commented Jun 24, 2025

I am also encountering a detection issue for this on Windows as well.

Copy link
Owner

@jacksteamdev jacksteamdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Clean solution with proper fallback detection for Linux compatibility. Good catch on the caniuse-lite dependency resolution too.

The implementation maintains existing behavior while gracefully handling the platform difference. Ready to merge! 🚀

@jacksteamdev jacksteamdev merged commit eb7bbb3 into jacksteamdev:main Jul 13, 2025
4 checks passed
jacksteamdev added a commit that referenced this pull request Jul 13, 2025
- Integrates Smart Connections v3.0+ smart_sources.lookup() API
- Maintains cross-platform detection fallback from PR #23
- Creates compatibility wrapper for v3.0 result format transformation
- Preserves backwards compatibility with v2.x via window.SmartSearch
- Fixes detection issues on Linux, macOS, and Windows
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.

5 participants