-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Description
Description
The MCP Server binary (plugins/mcp-tools/bin/mcp-server) appears to be hardcoded to connect to the Local REST API on port 27124. It does not read the port from the Local REST API plugin's data.json configuration, nor does it accept port configuration via environment variables or command-line arguments.
This makes it impossible to:
- Use the MCP Server with a vault whose Local REST API is configured on a non-default port
- Run multiple vaults simultaneously with MCP access (since only one vault can occupy port 27124)
Steps to Reproduce
- Install MCP Tools and Local REST API in two separate vaults
- Configure Vault A's Local REST API on the default port (27124)
- Configure Vault B's Local REST API on a non-default port (e.g., 27126)
- Add both vaults to
claude_desktop_config.jsonwith separate entries:
"mcpServers": {
"obsidian-vault-a": {
"command": "/path/to/vault-a/.obsidian/plugins/mcp-tools/bin/mcp-server",
"env": {
"OBSIDIAN_API_KEY": "<vault-a-key>"
}
},
"obsidian-vault-b": {
"command": "/path/to/vault-b/.obsidian/plugins/mcp-tools/bin/mcp-server",
"env": {
"OBSIDIAN_API_KEY": "<vault-b-key>",
"OBSIDIAN_PORT": "27126"
}
}
}- Restart Claude Desktop
Expected Behavior
Vault B's MCP Server should connect to port 27126, either by:
- Reading the port from the co-located Local REST API plugin's
data.json(which correctly contains"port": 27126) - Accepting an
OBSIDIAN_PORTenvironment variable - Accepting a
--portcommand-line argument
Actual Behavior
- Vault B's MCP Server ignores the
OBSIDIAN_PORTenv variable and connects to port 27124 - If Vault A is running on 27124, Vault B's MCP Server connects to Vault A with Vault B's API key, resulting in an unauthenticated response and the error:
GET / 200: apiExtensions must be an array (was missing), certificateInfo must be an object (was missing) - If no vault is running on 27124, the connection fails entirely with:
Unable to connect. Is the computer able to access the url?
Environment
- macOS
- Obsidian v1.11.7
- MCP Tools v0.2.27
- Local REST API v3.2.0
- Claude Desktop (Cowork mode)
Suggested Fix
Allow port configuration via one or more of these methods (in order of preference):
- Read the port from the vault's own Local REST API
data.json(most seamless — no user config needed) - Accept an
OBSIDIAN_PORTenvironment variable inclaude_desktop_config.json - Accept a
--portcommand-line argument
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels