@sharnix/mcp-server
v1.1.0
Published
Sharnix MCP server — lets AI agents create tunnels and share links
Readme
@sharnix/mcp-server
Model Context Protocol (MCP) server for Sharnix — lets AI agents (Claude, Cursor, Windsurf, etc.) create preview tunnels and share links without the user touching a dashboard.
Setup (automatic — recommended)
The easiest way is to run the setup command, which handles everything automatically:
npx @sharnix/agent setupThis opens your browser, creates an API key, and writes the MCP config to your editors automatically. No manual file editing needed. Restart your editor after it completes.
Setup (manual)
If you prefer to configure manually, add this to your editor's MCP config file:
{
"mcpServers": {
"sharnix": {
"command": "npx",
"args": ["-y", "@sharnix/mcp-server@latest"],
"env": {
"SHARNIX_API_KEY": "shx_..."
}
}
}
}Config file locations:
| Editor | File |
|--------|------|
| Claude Desktop (macOS) | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Claude Desktop (Windows) | %APPDATA%\Claude\claude_desktop_config.json |
| Claude Desktop (Linux) | ~/.config/Claude/claude_desktop_config.json |
| Cursor | ~/.cursor/mcp.json |
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
Get your API key from relay.sharnix.com/app/settings → API Keys, or have your AI agent create one with create_api_key.
Requirements
- Node.js 18 or later
- A Sharnix account at relay.sharnix.com
- A local tunnel running via
@sharnix/agent
Available tools
| Tool | Plan | Description |
|------|------|-------------|
| list_tunnels | Free | List all tunnels and their live status |
| get_tunnel | Free | Get details and active links for a tunnel |
| create_share_link | Free | Create a shareable preview URL |
| revoke_link | Free | Immediately revoke a share link |
| reactivate_link | Free | Reactivate a paused share link |
| list_suspended_links | Free | List all links paused due to agent disconnection |
| claim_subdomain | Free | Claim a permanent subdomain for a tunnel |
| list_orgs | Free | List workspaces the API key has access to |
| list_api_keys | Free | List API keys on the account |
| create_api_key | Free | Create a new API key (shown once — save it) |
| get_link_stats | Pro | Visit analytics for a share link |
Example prompts
"Share my app with the client as read-only, expiring in 48 hours"
"Create a full-access link for anyone at acme.com"
"How many people visited my preview today?"
"Reactivate any paused share links"
"Claim the subdomain my-app for my tunnel"
"Create me an API key for Cursor and add it to my Cursor MCP config"
Premium features
Some options on create_share_link require a paid plan. The agent will tell you when a feature needs an upgrade:
require_auth(force viewer login) — Pro planget_link_stats(visit analytics) — Pro plan- IP allowlist — Team plan
- Geo allowlist — Team plan
Upgrade at relay.sharnix.com/app/settings.
How share links work
Share links are JWT-signed URLs that proxy through the Sharnix relay to your local machine. When the agent running @sharnix/agent disconnects, links are automatically paused and visitors see a "Preview paused" page. When the agent reconnects and stays stable, an email is sent with one-click reactivation links.
Environment variables
| Variable | Description |
|----------|-------------|
| SHARNIX_API_KEY | Your API key (required) |
| SHARNIX_ORG | Org slug to use (auto-detected if omitted) |
| SHARNIX_URL | Override relay URL (default: https://relay.sharnix.com) |
License
MIT
