Skip to content

Commit 720c6b4

Browse files
DennisAlundCopilot
andcommitted
docs: update README with MCP endpoint configuration
Add client configuration examples for Claude Desktop, Claude Code, VS Code, and Cursor. Document the /_/mcp endpoint URL pattern and API key auth requirement. Update settings page link to point to GitHub docs. Add CHANGELOG entry for 0.7.0 with migration notes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent eb957c1 commit 720c6b4

3 files changed

Lines changed: 102 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 0.7.0
4+
5+
### MCP server moved into the Worker
6+
7+
The standalone `@oddbit/shrtnr-mcp` npm package has been replaced by a built-in remote MCP endpoint at `/_/mcp`. Every shrtnr deployment now serves an MCP server over Streamable HTTP transport, authenticated with API keys.
8+
9+
- Added `/_/mcp` endpoint using Cloudflare's `agents` SDK with `createMcpHandler()`
10+
- MCP tools call the service layer directly instead of going through HTTP
11+
- Stateless per-request design: no Durable Objects required
12+
- Removed the `mcp/` package directory and its npm publish workflow
13+
- Updated `release-packages.yml` and `detect-releases.sh` to cover SDK only
14+
15+
### Migration from `@oddbit/shrtnr-mcp`
16+
17+
Replace `npx @oddbit/shrtnr-mcp` with a remote connection to your shrtnr deployment. See the MCP section in `README.md` for client configuration examples.
18+
319
## 0.6.3
420

521
- Removed all em dashes from source files, page titles, and comments per writing rules

README.md

Lines changed: 84 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ It takes one click to deploy. You get a full admin UI, click analytics, a TypeSc
2020
- **Multi-language admin UI** with English, Indonesian, and Swedish built in
2121
- **API key authentication** with scoped Bearer tokens for programmatic access
2222
- **TypeScript SDK** ([`@oddbit/shrtnr`](https://www.npmjs.com/package/@oddbit/shrtnr)) for Node.js and browser apps
23-
- **MCP server** ([`@oddbit/shrtnr-mcp`](https://www.npmjs.com/package/@oddbit/shrtnr-mcp)) so Claude, Copilot, and other AI assistants can shorten URLs
23+
- **Built-in MCP server** at `/_/mcp` so Claude, Copilot, and other AI assistants can shorten URLs
2424
- **SSO via Cloudflare Access** supporting Google, GitHub, OTP, SAML, OIDC, and any IdP
2525
- **One-click deploy** with automatic database provisioning and migrations
2626

@@ -79,12 +79,90 @@ Shorten URLs, manage links, and read analytics from any TypeScript or JavaScript
7979

8080
### MCP Server (AI Integration)
8181

82-
Let Claude, GitHub Copilot, or any MCP-compatible AI assistant create and manage short links.
82+
Every shrtnr deployment includes a built-in [MCP](https://modelcontextprotocol.io/) endpoint at `/_/mcp`. Claude, GitHub Copilot, Cursor, and any MCP-compatible client can connect to it over Streamable HTTP transport to create and manage short links.
83+
84+
The endpoint requires an API key. Create one from the admin UI under **API Keys** with `create,read` scope.
85+
86+
#### Available tools
87+
88+
| Tool | Description |
89+
|---|---|
90+
| `health` | Check server health and version |
91+
| `list_links` | List all short links with slugs and click counts |
92+
| `get_link` | Get details for a link by ID |
93+
| `create_link` | Shorten a URL (supports labels, vanity slugs, expiry) |
94+
| `update_link` | Update a link's URL, label, or expiry |
95+
| `disable_link` | Disable a link so it stops redirecting |
96+
| `add_vanity_slug` | Add a custom slug to an existing link |
97+
| `get_link_analytics` | Get click stats by country, referrer, device, and browser |
98+
99+
#### Claude Desktop
100+
101+
Add to `claude_desktop_config.json`:
102+
103+
```json
104+
{
105+
"mcpServers": {
106+
"shrtnr": {
107+
"command": "npx",
108+
"args": ["mcp-remote", "https://your-domain.com/_/mcp"],
109+
"env": {
110+
"AUTHORIZATION": "Bearer sk_your_api_key"
111+
}
112+
}
113+
}
114+
}
115+
```
116+
117+
#### Claude Code
118+
119+
Add to `.mcp.json` in your project root:
120+
121+
```json
122+
{
123+
"mcpServers": {
124+
"shrtnr": {
125+
"command": "npx",
126+
"args": ["mcp-remote", "https://your-domain.com/_/mcp"],
127+
"env": {
128+
"AUTHORIZATION": "Bearer sk_your_api_key"
129+
}
130+
}
131+
}
132+
}
133+
```
134+
135+
#### VS Code (GitHub Copilot)
136+
137+
Add to `.vscode/mcp.json`:
138+
139+
```json
140+
{
141+
"servers": {
142+
"shrtnr": {
143+
"type": "http",
144+
"url": "https://your-domain.com/_/mcp",
145+
"headers": {
146+
"Authorization": "Bearer sk_your_api_key"
147+
}
148+
}
149+
}
150+
}
151+
```
152+
153+
#### Cursor / Windsurf
154+
155+
Use the same `mcp-remote` approach as Claude Desktop, or configure via each editor's MCP settings with the endpoint URL `https://your-domain.com/_/mcp` and an `Authorization: Bearer sk_...` header.
156+
157+
#### Any HTTP MCP client
83158

84-
- Package: [`@oddbit/shrtnr-mcp`](https://www.npmjs.com/package/@oddbit/shrtnr-mcp)
85-
- Documentation: [mcp/README.md](mcp/README.md)
159+
Point the client at your shrtnr endpoint:
86160

87-
Both packages cover the same link-management operations. Configuration and usage details are in their respective READMEs.
161+
- **URL:** `https://your-domain.com/_/mcp`
162+
- **Transport:** Streamable HTTP
163+
- **Auth header:** `Authorization: Bearer sk_your_api_key`
164+
165+
Replace `your-domain.com` with your actual short domain and `sk_your_api_key` with a key created from the admin UI.
88166

89167
## API
90168

@@ -106,6 +184,7 @@ Administrative endpoints (settings, preferences, dashboard stats, key management
106184
| `POST` | `/_/api/links/:id/disable` | Disable a link |
107185
| `GET` | `/_/api/links/:id/analytics` | Get click analytics (referrer, country, device, browser) |
108186
| `GET` | `/_/health` | Health check (public) |
187+
| `POST` | `/_/mcp` | MCP endpoint for AI assistants (Streamable HTTP transport) |
109188

110189
## Development
111190

@@ -125,15 +204,6 @@ yarn test
125204
yarn build
126205
```
127206

128-
### MCP server development
129-
130-
```bash
131-
cd mcp
132-
yarn install
133-
yarn test
134-
yarn build
135-
```
136-
137207
## Attribution
138208

139209
shrtnr is built and maintained by **[Oddbit](https://oddbit.id)**, a software development studio in Sweden.

src/pages/settings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export const SettingsPage: FC<Props> = ({ theme, slugLength, lang, t }) => {
153153
</div>
154154
</a>
155155
<a
156-
href="https://www.npmjs.com/package/@oddbit/shrtnr-mcp"
156+
href="https://github.com/oddbit/shrtnr#mcp-server-ai-integration"
157157
target="_blank"
158158
rel="noopener"
159159
class="bento-card"
@@ -172,7 +172,7 @@ export const SettingsPage: FC<Props> = ({ theme, slugLength, lang, t }) => {
172172
<span class="icon" style="font-size:14px">
173173
open_in_new
174174
</span>{" "}
175-
@oddbit/shrtnr-mcp
175+
/_/mcp
176176
</div>
177177
</a>
178178
</div>

0 commit comments

Comments
 (0)