home / mcp / shoten mcp server

Shoten MCP Server

Provides a local MCP server to shorten URLs via x.gd using a per-user API key.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "hatimitu76-mcp-shoten-url": {
      "url": "https://mcp-shoten-url.example.com/mcp",
      "headers": {
        "XGD_API_KEY": "your_api_key_here"
      }
    }
  }
}

You can use this MCP server to create shortened URLs through x.gd, enabling quick sharing and tracking of links in your workflows. This server runs locally via MCP clients and requires an API key from x.gd to function.

How to use

To shorten URLs, configure your MCP client to launch the shortener server and pass your x.gd API key. When you place a URL through your MCP client, the server will call x.gd to generate a compact link that you can share. You can integrate this in IDEs or code editors that support MCP servers, making it easy to produce short links directly from your development environment.

How to install

Prerequisites you need before installation: Node.js and npm or a compatible JavaScript runtime that can execute MCP commands through npx.

{
  "mcpServers": {
    "shoten_url": {
      "command": "npx",
      "args": [
        "@hatimitu__hat/mcp-shoten-url"
      ],
      "env": {
        "XGD_API_KEY": "your_api_key_here"
      }
    }
  }
}

Additional setup notes

You must provide your own x.gd API key. Obtain it by following the API key issuance flow for x.gd. Once you have the key, insert it into the environment variable XGD_API_KEY in your MCP client configuration.

Configuration examples for popular clients

Use these exact configurations in your MCP client to run the shortener server.

{
  "mcpServers": {
    "shoten_url": {
      "command": "npx",
      "args": [
        "@hatimitu__hat/mcp-shoten-url"
      ],
      "env": {
        "XGD_API_KEY": "your_api_key_here"
      }
    }
  }
}

Additional usage tips

If your MCP client supports multiple MCP servers, you can add this shortener as a dedicated server named shoten_url for quick access. Ensure your API key remains secret and is not exposed in public configurations.

Troubleshooting

If you encounter issues with API authentication, double-check that XGD_API_KEY is correctly set in the configuration and that the key is active for your account. Verify that your MCP client is loading the updated configuration after making changes.