Bitly MCP Server
官方將您的AI助手轉變為數位行銷中心,可隨需建立、整理並分析連結與QR Code。
文件
Bitly MCP 伺服器
歡迎來到 Bitly MCP 伺服器指南。
如果你已經來到這裡,大概已經知道什麼是 MCP 伺服器了,但如果你需要入門介紹,可以參考我們的「什麼是 MCP?」頁面。
Bitly MCP 伺服器提供了你期望從 Bitly 介面獲得的所有功能——就像 Bitly API、bitly.com 網站、Bitly Chrome 擴充功能、Bitly 行動應用程式一樣——但這次是為你選擇的 AI 代理程式所設計。
想在 ChatGPT 中使用 Bitly?Bitly MCP 伺服器或 Bitly 自訂 GPT。想在 Claude 中使用 Bitly?Bitly MCP 伺服器。想在 Cursor、VS Code 或 Windsurf 中使用 Bitly?Bitly MCP 伺服器。
快速設定
Bitly MCP 伺服器託管於 https://api-ssl.bitly.com/v4/mcp.
驗證選項:
- OAuth 2.1(建議) – 適用於支援 OAuth 的客戶端,提供安全、基於權杖的驗證,並具備自動客戶端註冊功能
- API 權杖 – 適用於較簡單的設定或不支援 OAuth 的客戶端,使用來自 https://bitly.com/settings/api 的 Bitly API 權杖
以下是包含詳細說明連結的設定網格——如果我們遺漏了你使用的工具,你可以在設定詳細資訊頁面找到指引。我們將隨著時間推移陸續新增更多設定指南。
| AI 代理程式 | 設定說明 | 備註 |
|---|---|---|
| ChatGPT | 設定 ChatGPT | 使用動態客戶端註冊的 OAuth |
| Claude 網頁介面 (claude.ai) | 設定 Claude 網頁 | 使用動態客戶端註冊的 OAuth |
| Claude 桌面版 | 設定 Claude 桌面版 | 支援 OAuth 和 API 權杖 |
| Claude Code | 設定 Claude Code | HTTP 傳輸 – 支援 OAuth 和 API 權杖 |
| Cursor | 設定 Cursor | HTTP 傳輸 – 支援 OAuth 和 API 權杖 |
| VS Code | 設定 VS Code | HTTP 傳輸 – 支援 OAuth 和 API 權杖 |
| Windsurf | 設定 Windsurf | 使用 npx 代理進行本地連線 |
| 大多數其他相容 HTTP 的代理程式 | 查看我們的設定區段 | 通用 HTTP 設定適用於大多數情況 |
設定
Claude Code
新增至 ~/.claude/mcp.json:
使用 OAuth(建議):
{
"mcpServers": {
"Bitly": {
"type": "http",
"url": "https://api-ssl.bitly.com/v4/mcp"
}
}
}
使用 API 權杖:
{
"mcpServers": {
"Bitly": {
"type": "http",
"url": "https://api-ssl.bitly.com/v4/mcp",
"headers": {
"Authorization": "Bearer YOUR_BITLY_AUTH_TOKEN"
}
}
}
}
新增設定後重新啟動 Claude Code。
Cursor
新增至 ~/.cursor/mcp.json:
新增設定後重新啟動 Cursor。
Claude 桌面版
新增至你的 Claude 設定檔:
macOS:~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"Bitly": {
"url": "https://api-ssl.bitly.com/v4/mcp"
}
}
}
使用 API 權杖(使用 npx 代理):
先決條件: 需要 Node.js 20 LTS 或更高版本,並支援
npx。
{
"mcpServers": {
"Bitly": {
"command": "npx",
"args": [
"mcp-remote",
"https://api-ssl.bitly.com/v4/mcp",
"--header",
"Authorization: Bearer ${AUTH_TOKEN}"
],
"env": {
"AUTH_TOKEN": "YOUR_BITLY_AUTH_TOKEN"
}
}
}
}
新增設定後重新啟動 Claude 桌面版。
VS Code
在你的工作區中新增至 ~/.vscode/mcp.json:
{
"servers": {
"Bitly": {
"type": "http",
"url": "https://api-ssl.bitly.com/v4/mcp"
}
}
}
{
"servers": {
"Bitly": {
"type": "http",
"url": "https://api-ssl.bitly.com/v4/mcp",
"headers": {
"Authorization": "Bearer YOUR_BITLY_AUTH_TOKEN"
}
}
}
}
Windsurf
新增至 ~/.windsurf/config.json:
### Claude Web
For Claude on the web (claude.ai), use OAuth authentication:
1. Navigate to your Claude workspace settings
2. Go to the MCP servers configuration section
3. Add the Bitly MCP Server:
* **Server URL:** `https://api-ssl.bitly.com/v4/mcp`
* **Authentication:** OAuth
When prompted, log in to your Bitly account and authorize the connection. Claude will handle the OAuth flow automatically using Dynamic Client Registration.
> **Note:** OAuth support in Claude Web requires Workspace Admin enablement for Team and Enterprise Plans.
### ChatGPT
For ChatGPT, use OAuth authentication:
1. In ChatGPT, go to **Settings > Apps & Connectors > Advanced Settings**
2. Toggle **Developer Mode** on
3. Go back and click **Create**
4. Add the Bitly MCP Server:
* **Server URL:** `https://api-ssl.bitly.com/v4/mcp`
* **Authentication:** OAuth
When prompted, log in to your Bitly account and authorize the connection. ChatGPT will handle the OAuth flow automatically using Dynamic Client Registration.
> **Note:** MCP support in ChatGPT requires Plus, Team, Enterprise, or Edu plans. For workspace plans, you must be an admin to access these settings.
## Authentication
The Bitly MCP Server supports two authentication methods:
### OAuth 2.1 with Dynamic Client Registration (Recommended)
For clients that support OAuth (like Claude Web, ChatGPT, and other modern AI assistants), OAuth provides:
* **Enhanced Security** \- No need to manually manage API tokens
* **Automatic Client Registration** \- Dynamic Client Registration (DCR) handles client setup automatically
* **Token Refresh** \- Automatic token renewal without manual intervention
When configuring OAuth, your AI client will:
1. Redirect you to Bitly's authorization page
2. Ask you to log in and authorize the connection
3. Automatically register as an OAuth client using DCR
4. Receive and manage access tokens transparently
### API Token (Alternative)
For simpler setups or clients without OAuth support:
1. Log in to your Bitly account at bitly.com
2. Navigate to Settings → API
3. Click Generate Access Token
4. Copy the token and store it securely
5. Use it in your MCP client configuration as shown in the examples above
## Test It Out
Once configured, try asking your AI:
「有哪些 Bitly 工具可用?」
「請縮短這個網址:https://example.com/very-long-url」
從這裡開始,你應該就一切就緒了!
---