API / MCP Server
Since version 30.7, WebSSH introduces a built-in API / MCP (Model Context Protocol) server, enabling external applications to interact with WebSSH programmatically.
This opens up a range of possibilities for integration—including with AI applications such as Claude Desktop. By using the API, these tools can automate tasks, retrieve data, or incorporate WebSSH’s capabilities into more complex workflows.
This feature is only available on macOS.
Example Use Cases
-
AI Applications (e.g., Claude Desktop):
Automate SSH sessions, manage terminals, or extract data for analysis within the app. -
Custom Integrations:
Connect your own scripts or automation tools directly to WebSSH’s functionality. -
Data Retrieval and Management:
Programmatically fetch server status, logs, or outputs for use in dashboards or other applications.
Available Features
- ✅ Retrieve Terminal Content
- ✅ Send Commands to Terminal
- ✅ Retrieve your IP Addresses
- ✅ Make DNS Lookup
- ✅ Make Whois Requests
- 🚧 Make Ping Requests
- 🚧 Launch Traceroute
Usage Instructions
Enabling the API / MCP Server
- Open WebSSH on your Mac
- Navigate to WebSSH menu > Settings
- Locate the API / MCP settings panel
- Toggle "Feature Availability" to Enabled
- Close the settings window
- Go to Inventory > Tools
- Toggle the API / MCP Server switch to ON
Using Claude Desktop as a MCP Client
Claude Desktop only talks to local MCP servers through stdio: it refuses localhost URLs in its Connectors settings, whatever the scheme, because custom connectors are reached from Anthropic's servers. Since version 33.3, WebSSH therefore ships a tiny bridge inside the app bundle, WebSSH.app/Contents/MacOS/webssh-mcp, which relays Claude's requests to the API / MCP server running in WebSSH. WebSSH writes the port and the token for it: nothing to install, nothing to copy by hand.
One-click setup
- In WebSSH, go to Inventory > Tools, right-click (or long-press) API / MCP and choose Claude > Install into Claude Desktop…
- A file panel opens on Claude's folder (
~/Library/Application Support/Claude): click Open. WebSSH adds itswebsshentry (bridge path, port and token) toclaude_desktop_config.json, keeping everything else in the file and a copy of the previous version next to it (claude_desktop_config.json.webssh-backup). Run it again whenever you change the port or the token - Quit and relaunch Claude Desktop
Manual setup
- In WebSSH, right-click API / MCP and choose Claude > Copy Claude Desktop Configuration
- In Claude Desktop, open Settings > Developer > Edit Config (this opens
claude_desktop_config.json) - Paste the copied fragment, merging the
websshentry into an existingmcpServersobject if you already have one:
{
"mcpServers": {
"webssh": {
"command": "/Applications/WebSSH.app/Contents/MacOS/webssh-mcp",
"env": {
"WEBSSH_MCP_TOKEN": "YOUR_BEARER_TOKEN_HERE",
"WEBSSH_MCP_PORT": "1985"
}
}
}
}
- Quit and relaunch Claude Desktop
- Make sure the API / MCP switch is ON in WebSSH, then ask Claude to use WebSSH!
You do not even need WebSSH to be running when Claude starts: the tools are listed right away, and the first time Claude uses one, WebSSH is launched in the background and its server started (the installer also sets Start Strategy to Launch when WebSSH starts). If WebSSH cannot start, Claude receives a clear message telling you what to check.
The Claude submenu only appears when a Claude application is detected on your Mac (Claude Desktop or Claude Code).
The former WebSSH MCPB extension (
webssh-mcpb-dxt-extension, which required Docker Desktop) is deprecated: the built-in bridge replaces it. You can remove the extension from Claude Desktop.
Using Claude Code, Cursor, VS Code or Codex
These clients connect to a local HTTP MCP server directly. In WebSSH, right-click API / MCP and choose Claude > Copy Claude Code Command to get a ready-to-run command such as:
claude mcp add --transport http webssh http://127.0.0.1:1985/mcp --header "Authorization: Bearer YOUR_BEARER_TOKEN_HERE"
For other clients, use the URL http://127.0.0.1:1985/mcp (Streamable HTTP) with the Authorization: Bearer … header described below.
Network access
By default the server listens on 127.0.0.1 only: it can be reached from this Mac and nothing else. To let another device on your local network connect (with the Bearer token), set Listen on to Any device on the local network in WebSSH > Settings > API / MCP, then switch the server off and on again.
WebSSH OpenAPI Specification
Once the API / MCP server is enabled, you can access the OpenAPI specification by navigating to:
http://localhost:1985/openapi.json
This JSON file describes all available endpoints, request/response formats, and authentication methods for interacting with the WebSSH API. You can use this specification to generate client libraries or documentation for your specific use case.
WebSSH MCP Server
With the API / MCP server enabled, you can access the MCP endpoints at:
http://localhost:1985/mcp
You can use any external application which supports MCP protocol to connect to WebSSH and interact with its features programmatically.
To play and debug MCP requests, you can use the awesome Context app : https://github.com/indragiek/Context
Authentication
Authentication is handled via a Bearer Token, which can be found in the API / MCP settings panel within WebSSH.
When making requests to the API, include the following HTTP header:
Authorization: Bearer YOUR_BEARER_TOKEN_HERE