MCP Integration
Setup
Step-by-step instructions for connecting AI clients to the Shorten MCP server.
Prerequisites
- A Shorten account with an active API key (
sk_) - An MCP-compatible client (Claude Desktop, Claude Code, Cursor, or similar)
Client setup
Add to your Claude Desktop configuration file:
| Platform | Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%/Claude/claude_desktop_config.json |
{
"mcpServers": {
"shorten": {
"command": "npx",
"args": ["@shorten-dev/mcp"],
"env": {
"SHORTEN_API_KEY": "sk_your_key_here"
}
}
}
}Restart Claude Desktop after saving. The Shorten tools will appear in the tools menu.
Add to your project's .mcp.json:
{
"mcpServers": {
"shorten": {
"command": "npx",
"args": ["@shorten-dev/mcp"],
"env": {
"SHORTEN_API_KEY": "sk_your_key_here"
}
}
}
}Add the MCP server through your editor's MCP settings:
{
"mcpServers": {
"shorten": {
"command": "npx",
"args": ["@shorten-dev/mcp"],
"env": {
"SHORTEN_API_KEY": "sk_your_key_here"
}
}
}
}Refer to your editor's MCP documentation for the exact configuration location.
Verify the connection
Once configured, ask your AI agent:
Create a short link for https://google.com
If the connection is working, you should receive a response with the shortened URL and slug.
Troubleshooting
| Issue | Solution |
|---|---|
| "Unauthorized" error | Verify API key is valid and has read/write scopes |
| Tools not appearing | Restart your MCP client after configuration changes |
| Rate limit errors | Rate limit is 300 req/hr per user — check current usage |
| Wrong tool results | Ensure the API key has the required scope for the tool |