@lnkib/mcp 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ Semantic versioning: removing or renaming a tool/field, or making a field required → **major**; adding tools or optional fields → **minor**; fixes → **patch**.
4
+
5
+ ## 0.2.0
6
+ - First public version of `@lnkib/mcp` (binary `lnkib-mcp`, server name `lnkib`).
7
+ - Configuration: `LNKIB_API_KEY` (required) and `LNKIB_API_BASE` (default `https://api.lnkib.com`).
8
+ - Tools for Link-in-Bio (`list_bio_pages`, `create_bio_page` as a private draft only, `update_bio_page`, `append_bio_link`, `set_bio_published`), bookings (`list_booking_profiles`, `list_bookings`, `create_manual_booking`) and Instagram automation (`list_accounts`, `list_media`, `list_rules`, `upsert_rule`, `toggle_rule`, `get_comments`, `draw_comment_raffle`, `get_logs`).
9
+ - Requests send an `X-Lnkib-Client: mcp/<version>` header for diagnostics.
10
+ - Types are generated from the public OpenAPI spec (`openapi/openapi.json`); the package has no lnkib-internal dependencies.
11
+ - Tool contract snapshot test (`src/tools.contract.json`).
12
+ - Built on `@modelcontextprotocol/sdk` 1.32.x and `zod` 4.x.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 lnkib
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,71 @@
1
- # Temporary Holding Version
1
+ # @lnkib/mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [MCP](https://modelcontextprotocol.io) server for [lnkib](https://lnkib.com). Let your own AI assistant (Claude, Cursor, …) build your Link-in-Bio, read your bookings and add manual bookings.
4
+
5
+ - Link-in-Bio and bookings do **not** need an Instagram connection.
6
+ - You pay your AI provider for model usage. lnkib only provides the connection.
7
+ - This server only calls the public lnkib REST API ([OpenAPI spec](https://api.lnkib.com/api/v1/openapi.json)) with the API key you give it.
8
+
9
+ > **Status:** not published to npm yet. Until it is, run it from source (see below) or use the REST API directly.
10
+
11
+ ## Quick start
12
+
13
+ 1. In lnkib, open **Settings → API Keys** and issue a key. Start with the **Read-only** preset. Choose **Read + draft writes** only if you want the AI to create bio drafts and manual bookings. Keep `bio:publish` off until you need it.
14
+ 2. Add the server to your MCP client:
15
+
16
+ ```json
17
+ {
18
+ "mcpServers": {
19
+ "lnkib": {
20
+ "command": "npx",
21
+ "args": ["-y", "@lnkib/mcp"],
22
+ "env": {
23
+ "LNKIB_API_KEY": "iflow_live_...",
24
+ "LNKIB_API_BASE": "https://api.lnkib.com"
25
+ }
26
+ }
27
+ }
28
+ }
29
+ ```
30
+
31
+ `LNKIB_API_BASE` is optional (default `https://api.lnkib.com`).
32
+
33
+ ### Run from source
34
+
35
+ ```bash
36
+ git clone https://github.com/lnkib-org/lnkib-mcp.git
37
+ cd lnkib-mcp
38
+ npm install
39
+ npm run build
40
+ LNKIB_API_KEY=iflow_live_... node dist/index.js
41
+ ```
42
+
43
+ Point your MCP client's `command` at `node` with `args: ["/path/to/lnkib-mcp/dist/index.js"]`.
44
+
45
+ ## Tools
46
+
47
+ | Area | Tools | Needs scope |
48
+ |---|---|---|
49
+ | Bio | `list_bio_pages` | `bio:read` |
50
+ | | `create_bio_page` (always a **private draft**), `update_bio_page`, `append_bio_link` | `bio:write` |
51
+ | | `set_bio_published` | `bio:publish` |
52
+ | Bookings | `list_booking_profiles`, `list_bookings` (contains customer data) | `bookings:read` |
53
+ | | `create_manual_booking` (no message is sent to the customer) | `bookings:write` |
54
+ | Instagram automation | `list_accounts`, `list_media`, `list_rules`, `upsert_rule`, `toggle_rule`, `get_comments`, `draw_comment_raffle`, `get_logs` | see OpenAPI |
55
+
56
+ Permissions come from the API key's scopes, not from this server.
57
+
58
+ ## Safety
59
+
60
+ - Give each AI its own key and revoke it when you stop using it.
61
+ - Bookings contain personal data. Your AI provider sees what it reads. Do not enable `bookings:read` for tools you do not trust.
62
+ - AI-created bio pages are always private drafts. Review them before publishing.
63
+ - `update_bio_page` replaces the whole `links` / `socials` list when you send it. Read the page first.
64
+
65
+ ## Versioning
66
+
67
+ [Semantic versioning](https://semver.org). Tool names and input fields are a public contract, guarded by `src/tools.contract.json` and a test. See [CHANGELOG.md](./CHANGELOG.md) and [CONTRIBUTING.md](./CONTRIBUTING.md).
68
+
69
+ ## License
70
+
71
+ MIT
@@ -0,0 +1 @@
1
+ export {};
package/dist/client.js ADDED
@@ -0,0 +1,129 @@
1
+ export const DEFAULT_API_BASE = 'https://api.lnkib.com';
2
+ export class LnkibApiError extends Error {
3
+ code;
4
+ status;
5
+ constructor(code, message, status) {
6
+ super(`[${code}] ${message}`);
7
+ this.code = code;
8
+ this.status = status;
9
+ this.name = 'LnkibApiError';
10
+ }
11
+ }
12
+ export class LnkibApiClient {
13
+ apiKey;
14
+ fetchImpl;
15
+ clientVersion;
16
+ baseUrl;
17
+ constructor(apiKey, baseUrl = DEFAULT_API_BASE, fetchImpl = fetch, clientVersion = 'dev') {
18
+ this.apiKey = apiKey;
19
+ this.fetchImpl = fetchImpl;
20
+ this.clientVersion = clientVersion;
21
+ if (!apiKey.trim()) {
22
+ throw new Error('LNKIB_API_KEY is required');
23
+ }
24
+ this.baseUrl = baseUrl.replace(/\/+$/, '');
25
+ }
26
+ async request(path, init) {
27
+ const url = `${this.baseUrl}${path}`;
28
+ const res = await this.fetchImpl(url, {
29
+ ...init,
30
+ headers: {
31
+ 'Content-Type': 'application/json',
32
+ 'X-API-Key': this.apiKey,
33
+ // 어떤 버전의 MCP가 호출했는지 서버 로그에서 구분하기 위한 진단용 헤더
34
+ 'X-Lnkib-Client': `mcp/${this.clientVersion}`,
35
+ ...(init?.headers ?? {}),
36
+ },
37
+ });
38
+ const json = (await res.json().catch(() => null));
39
+ if (!json || typeof json !== 'object') {
40
+ throw new LnkibApiError('INVALID_RESPONSE', `Unexpected non-JSON response (HTTP ${res.status})`, res.status);
41
+ }
42
+ if (!json.ok) {
43
+ throw new LnkibApiError(json.error?.code ?? 'API_ERROR', json.error?.message ?? `HTTP ${res.status}`, res.status);
44
+ }
45
+ return json.data;
46
+ }
47
+ listAccounts() {
48
+ return this.request('/api/v1/accounts');
49
+ }
50
+ listMedia(accountId) {
51
+ return this.request(`/api/v1/accounts/${encodeURIComponent(accountId)}/media`);
52
+ }
53
+ listRules(accountId) {
54
+ return this.request(`/api/v1/accounts/${encodeURIComponent(accountId)}/rules`);
55
+ }
56
+ upsertRule(accountId, body) {
57
+ return this.request(`/api/v1/accounts/${encodeURIComponent(accountId)}/rules`, {
58
+ method: 'POST',
59
+ body: JSON.stringify(body),
60
+ });
61
+ }
62
+ toggleRule(ruleId) {
63
+ return this.request(`/api/v1/rules/${encodeURIComponent(ruleId)}/toggle`, { method: 'PATCH' });
64
+ }
65
+ getComments(accountId, options) {
66
+ const params = new URLSearchParams();
67
+ if (options?.mediaId)
68
+ params.set('mediaId', options.mediaId);
69
+ if (options?.refresh)
70
+ params.set('refresh', 'true');
71
+ const qs = params.toString();
72
+ return this.request(`/api/v1/accounts/${encodeURIComponent(accountId)}/comments${qs ? `?${qs}` : ''}`);
73
+ }
74
+ drawCommentRaffle(accountId, body) {
75
+ return this.request(`/api/v1/accounts/${encodeURIComponent(accountId)}/comments/raffle`, {
76
+ method: 'POST',
77
+ body: JSON.stringify(body),
78
+ });
79
+ }
80
+ getLogs(accountId, limit = 20) {
81
+ const params = new URLSearchParams({ limit: String(limit) });
82
+ return this.request(`/api/v1/accounts/${encodeURIComponent(accountId)}/logs?${params.toString()}`);
83
+ }
84
+ listBioPages() {
85
+ return this.request('/api/v1/bio');
86
+ }
87
+ createBioPage(body) {
88
+ return this.request('/api/v1/bio', {
89
+ method: 'POST',
90
+ body: JSON.stringify(body),
91
+ });
92
+ }
93
+ updateBioPage(bioId, body) {
94
+ return this.request(`/api/v1/bio/${encodeURIComponent(bioId)}`, {
95
+ method: 'PUT',
96
+ body: JSON.stringify(body),
97
+ });
98
+ }
99
+ appendBioLink(bioId, body) {
100
+ return this.request(`/api/v1/bio/${encodeURIComponent(bioId)}/links`, {
101
+ method: 'POST',
102
+ body: JSON.stringify(body),
103
+ });
104
+ }
105
+ setBioPublished(bioId, published) {
106
+ return this.request(`/api/v1/bio/${encodeURIComponent(bioId)}/publish`, {
107
+ method: 'POST',
108
+ body: JSON.stringify({ published }),
109
+ });
110
+ }
111
+ listBookingProfiles() {
112
+ return this.request('/api/v1/booking-profiles');
113
+ }
114
+ listBookings(options) {
115
+ const params = new URLSearchParams();
116
+ if (options?.profileId)
117
+ params.set('profileId', options.profileId);
118
+ if (options?.status)
119
+ params.set('status', options.status);
120
+ const qs = params.toString();
121
+ return this.request(`/api/v1/bookings${qs ? `?${qs}` : ''}`);
122
+ }
123
+ createManualBooking(body) {
124
+ return this.request('/api/v1/bookings', {
125
+ method: 'POST',
126
+ body: JSON.stringify(body),
127
+ });
128
+ }
129
+ }
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
+ import { DEFAULT_API_BASE, LnkibApiClient } from './client.js';
5
+ import { createLnkibMcpServer } from './server.js';
6
+ const { version } = createRequire(import.meta.url)('../package.json');
7
+ async function main() {
8
+ const apiKey = process.env.LNKIB_API_KEY?.trim();
9
+ if (!apiKey) {
10
+ console.error('Error: LNKIB_API_KEY environment variable is required.');
11
+ process.exit(1);
12
+ }
13
+ const baseUrl = process.env.LNKIB_API_BASE?.trim() || DEFAULT_API_BASE;
14
+ const client = new LnkibApiClient(apiKey, baseUrl, fetch, version);
15
+ const server = createLnkibMcpServer(client, version);
16
+ const transport = new StdioServerTransport();
17
+ await server.connect(transport);
18
+ }
19
+ main().catch((err) => {
20
+ console.error('lnkib MCP server failed:', err);
21
+ process.exit(1);
22
+ });
package/dist/server.js ADDED
@@ -0,0 +1,251 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ // BioSocialType에 값이 추가되면 이 Record가 컴파일 오류를 내므로 MCP 입력 목록이 항상 타입과 같다.
4
+ const SOCIAL_TYPE_SET = {
5
+ instagram: true,
6
+ facebook: true,
7
+ tiktok: true,
8
+ threads: true,
9
+ x: true,
10
+ youtube: true,
11
+ linkedin: true,
12
+ kakao: true,
13
+ blog: true,
14
+ website: true,
15
+ };
16
+ const SOCIAL_TYPES = Object.keys(SOCIAL_TYPE_SET);
17
+ const socialsSchema = z
18
+ .array(z.object({ type: z.enum(SOCIAL_TYPES), url: z.string().describe('Full https URL of the profile') }))
19
+ .describe('Social channel icons. Each type at most once.');
20
+ const linkSchema = z.object({
21
+ id: z.string().optional().describe('Existing link id from list_bio_pages; keep it to preserve click counts'),
22
+ title: z.string().describe('Button title (max 80 chars)'),
23
+ url: z.string().describe('https URL'),
24
+ subtitle: z.string().optional(),
25
+ badge: z.string().optional().describe('Short badge such as NEW or HOT (max 20 chars)'),
26
+ });
27
+ /** 서버가 id가 없는 링크에는 새 id를 붙이고 활성 상태로 저장한다. 타입을 맞추기 위해 같은 기본값을 채운다. */
28
+ function toLinkBlocks(links) {
29
+ return links?.map((l, i) => ({ id: l.id ?? `link-${i + 1}`, isActive: true, ...l }));
30
+ }
31
+ const bioFields = {
32
+ displayName: z.string().describe('Display name (1-60 chars)'),
33
+ handleLabel: z.string().optional().describe('Handle shown under the name, e.g. mina.bakes'),
34
+ bio: z.string().optional().describe('Short intro text (max 240 chars)'),
35
+ theme: z.enum(['light', 'dark', 'indigo']).optional(),
36
+ avatarUrl: z.string().optional().describe('Public https image URL'),
37
+ socials: socialsSchema.optional(),
38
+ };
39
+ function jsonResult(data) {
40
+ return {
41
+ content: [
42
+ {
43
+ type: 'text',
44
+ text: JSON.stringify(data, null, 2),
45
+ },
46
+ ],
47
+ };
48
+ }
49
+ export function createLnkibMcpServer(client, version = 'dev') {
50
+ const server = new McpServer({
51
+ name: 'lnkib',
52
+ version,
53
+ });
54
+ server.registerTool('list_accounts', {
55
+ title: 'List Instagram Accounts',
56
+ description: 'List connected Instagram professional accounts accessible to this API key. Call this first to discover accountId UUIDs.',
57
+ inputSchema: {},
58
+ annotations: { readOnlyHint: true },
59
+ }, async () => jsonResult(await client.listAccounts()));
60
+ server.registerTool('list_media', {
61
+ title: 'List Account Media',
62
+ description: 'List Instagram posts and reels for an account. Requires accounts:read scope. Call list_accounts first to get accountId.',
63
+ inputSchema: {
64
+ accountId: z.string().describe('Instagram account UUID from list_accounts'),
65
+ },
66
+ annotations: { readOnlyHint: true },
67
+ }, async ({ accountId }) => jsonResult(await client.listMedia(accountId)));
68
+ server.registerTool('list_rules', {
69
+ title: 'List Automation Rules',
70
+ description: 'List comment/DM automation rules for an account (including per-keyword DM variants). Requires rules:read scope.',
71
+ inputSchema: {
72
+ accountId: z.string().describe('Instagram account UUID'),
73
+ },
74
+ annotations: { readOnlyHint: true },
75
+ }, async ({ accountId }) => jsonResult(await client.listRules(accountId)));
76
+ server.registerTool('upsert_rule', {
77
+ title: 'Create or Update Automation Rule',
78
+ description: 'Create or update an Instagram comment/DM automation rule, including per-keyword custom DM messages (keywordDmVariants). Requires rules:write scope.',
79
+ inputSchema: {
80
+ accountId: z.string().describe('Instagram account UUID'),
81
+ id: z.string().optional().describe('Existing rule UUID to update; omit to create'),
82
+ mediaId: z.string().describe('Target Instagram media ID from list_media'),
83
+ name: z.string().describe('Human-readable rule name'),
84
+ triggerType: z.enum(['keywords', 'all']).default('keywords'),
85
+ keywords: z.array(z.string()).default([]).describe('Trigger keywords when triggerType is keywords'),
86
+ enablePublicReply: z.boolean().default(true),
87
+ publicReplies: z.array(z.string()).default([]).describe('Random public reply templates'),
88
+ enableDm: z.boolean().default(true),
89
+ dmMessage: z.string().default('').describe('Default DM body text'),
90
+ dmDelayMinutes: z.number().int().min(0).max(10080).optional().describe('Optional DM delay in minutes (0-10080)'),
91
+ enableFollowNudge: z
92
+ .boolean()
93
+ .optional()
94
+ .describe('If true, send a follow-nudge DM first when the commenter is not a follower'),
95
+ followNudgeMessage: z.string().optional().describe('Optional follow-nudge DM body'),
96
+ ctaLabel: z.string().default('').describe('Optional CTA button label'),
97
+ ctaUrl: z.string().default('').describe('Optional CTA link URL'),
98
+ keywordDmVariants: z
99
+ .array(z.object({
100
+ keyword: z.string(),
101
+ dmMessage: z.string(),
102
+ ctaLabel: z.string().optional(),
103
+ ctaUrl: z.string().optional(),
104
+ }))
105
+ .optional()
106
+ .describe('Optional per-keyword custom DM messages and CTA links'),
107
+ isActive: z.boolean().optional(),
108
+ },
109
+ annotations: { destructiveHint: false },
110
+ }, async ({ accountId, ...ruleBody }) => jsonResult(await client.upsertRule(accountId, ruleBody)));
111
+ server.registerTool('toggle_rule', {
112
+ title: 'Toggle Automation Rule',
113
+ description: 'Enable or pause an automation rule by ID. Requires rules:write scope.',
114
+ inputSchema: {
115
+ ruleId: z.string().describe('Automation rule UUID'),
116
+ },
117
+ annotations: { destructiveHint: false },
118
+ }, async ({ ruleId }) => jsonResult(await client.toggleRule(ruleId)));
119
+ server.registerTool('get_comments', {
120
+ title: 'Get Account Comments',
121
+ description: 'Fetch collected Instagram comments for an account (or specific mediaId). Uses 5-minute cache unless refresh=true. Requires comments:read scope.',
122
+ inputSchema: {
123
+ accountId: z.string().describe('Instagram account UUID'),
124
+ mediaId: z.string().optional().describe('Optional Instagram media ID filter'),
125
+ refresh: z.boolean().optional().describe('Bypass cache (respecting 15s cooldown)'),
126
+ limit: z
127
+ .number()
128
+ .int()
129
+ .min(1)
130
+ .max(200)
131
+ .default(30)
132
+ .describe('Max comments to return in response to keep context concise'),
133
+ },
134
+ annotations: { readOnlyHint: true },
135
+ }, async ({ accountId, mediaId, refresh, limit }) => {
136
+ const comments = await client.getComments(accountId, { mediaId, refresh });
137
+ return jsonResult({
138
+ totalFetched: comments.length,
139
+ returned: Math.min(comments.length, limit),
140
+ comments: comments.slice(0, limit),
141
+ });
142
+ });
143
+ server.registerTool('draw_comment_raffle', {
144
+ title: 'Draw Comment Raffle Winners',
145
+ description: 'Randomly draw fair comment event winners for a post/reel using cryptographic randomness. Requires raffle:run scope.',
146
+ inputSchema: {
147
+ accountId: z.string().describe('Instagram account UUID'),
148
+ mediaId: z.string().describe('Target Instagram media ID'),
149
+ winnerCount: z.number().int().min(1).max(100).describe('Number of winners to draw'),
150
+ dedupeByUser: z.boolean().optional().default(true).describe('Allow max 1 entry per user'),
151
+ excludeSelf: z.boolean().optional().default(true).describe('Exclude own account comments'),
152
+ keywordFilter: z.string().optional().describe('Optional required keyword in comment text'),
153
+ },
154
+ annotations: { destructiveHint: false },
155
+ }, async ({ accountId, ...body }) => jsonResult(await client.drawCommentRaffle(accountId, body)));
156
+ server.registerTool('get_logs', {
157
+ title: 'Get Automation Logs',
158
+ description: 'Fetch recent webhook auto-reply and DM execution logs for an account. Requires logs:read scope.',
159
+ inputSchema: {
160
+ accountId: z.string().describe('Instagram account UUID'),
161
+ limit: z.number().int().min(1).max(100).default(20),
162
+ },
163
+ annotations: { readOnlyHint: true },
164
+ }, async ({ accountId, limit }) => jsonResult(await client.getLogs(accountId, limit)));
165
+ server.registerTool('list_bio_pages', {
166
+ title: 'List Link-in-Bio Pages',
167
+ description: 'List your Link-in-Bio pages (id, slug, links, socials, isPublished). Works without any Instagram connection. Requires bio:read scope.',
168
+ inputSchema: {},
169
+ annotations: { readOnlyHint: true },
170
+ }, async () => jsonResult(await client.listBioPages()));
171
+ server.registerTool('create_bio_page', {
172
+ title: 'Create Link-in-Bio Draft',
173
+ description: 'Create a new Link-in-Bio page as a PRIVATE draft (it is never published by this tool). Show the draft to the user and let them review it; publishing needs set_bio_published and the bio:publish scope. Works without any Instagram connection. Requires bio:write scope.',
174
+ inputSchema: {
175
+ slug: z.string().describe('Public URL slug, 2-40 chars of a-z 0-9 . _ - (shown as /b/<slug>)'),
176
+ ...bioFields,
177
+ links: z.array(linkSchema).max(30).optional().describe('Link buttons, in display order'),
178
+ },
179
+ annotations: { destructiveHint: false },
180
+ }, async ({ links, ...rest }) => jsonResult(await client.createBioPage({ ...rest, links: toLinkBlocks(links) })));
181
+ server.registerTool('update_bio_page', {
182
+ title: 'Update Link-in-Bio Page',
183
+ description: 'Update fields of an existing page. Only the fields you send change; the publish state is never changed here. WARNING: sending `links` or `socials` replaces the whole list, so call list_bio_pages first and send the complete list (use append_bio_link to add a single link). Requires bio:write scope.',
184
+ inputSchema: {
185
+ bioId: z.string().describe('Bio page UUID from list_bio_pages'),
186
+ slug: z.string().optional(),
187
+ displayName: bioFields.displayName.optional(),
188
+ handleLabel: bioFields.handleLabel,
189
+ bio: bioFields.bio,
190
+ theme: bioFields.theme,
191
+ avatarUrl: bioFields.avatarUrl,
192
+ socials: bioFields.socials,
193
+ links: z.array(linkSchema).max(30).optional().describe('Replaces ALL links when provided'),
194
+ },
195
+ annotations: { destructiveHint: true },
196
+ }, async ({ bioId, links, ...rest }) => jsonResult(await client.updateBioPage(bioId, { ...rest, links: toLinkBlocks(links) })));
197
+ server.registerTool('append_bio_link', {
198
+ title: 'Append Bio Link',
199
+ description: 'Add one link button to an existing page without touching the others. Requires bio:write scope.',
200
+ inputSchema: {
201
+ bioId: z.string().describe('Bio page UUID'),
202
+ title: z.string(),
203
+ url: z.string().describe('https URL'),
204
+ subtitle: z.string().optional(),
205
+ badge: z.string().optional(),
206
+ position: z.enum(['top', 'bottom']).optional().default('bottom'),
207
+ },
208
+ annotations: { destructiveHint: false },
209
+ }, async ({ bioId, ...body }) => jsonResult(await client.appendBioLink(bioId, body)));
210
+ server.registerTool('set_bio_published', {
211
+ title: 'Publish or Unpublish Bio Page',
212
+ description: 'Make a page public at /b/<slug> or private again. This exposes content on the internet: only call it after the user explicitly approved publishing. Requires bio:publish scope.',
213
+ inputSchema: {
214
+ bioId: z.string().describe('Bio page UUID'),
215
+ published: z.boolean().describe('true = public, false = private'),
216
+ },
217
+ annotations: { destructiveHint: true },
218
+ }, async ({ bioId, published }) => jsonResult(await client.setBioPublished(bioId, published)));
219
+ server.registerTool('list_booking_profiles', {
220
+ title: 'List Booking Pages',
221
+ description: 'List your booking pages (hours, slot length, capacity). Works without any Instagram connection. Requires bookings:read scope.',
222
+ inputSchema: {},
223
+ annotations: { readOnlyHint: true },
224
+ }, async () => jsonResult(await client.listBookingProfiles()));
225
+ server.registerTool('list_bookings', {
226
+ title: 'List Bookings',
227
+ description: 'List bookings (newest first, max 200). The result contains customer names and contact details: treat it as personal data and do not share it beyond what the user asked. Requires bookings:read scope.',
228
+ inputSchema: {
229
+ profileId: z.string().optional().describe('Booking page UUID from list_booking_profiles'),
230
+ status: z.enum(['PENDING', 'CONFIRMED', 'CANCELLED', 'COMPLETED']).optional(),
231
+ },
232
+ annotations: { readOnlyHint: true },
233
+ }, async ({ profileId, status }) => jsonResult(await client.listBookings({ profileId, status })));
234
+ server.registerTool('create_manual_booking', {
235
+ title: 'Add a Manual Booking',
236
+ description: 'Register a phone or walk-in booking. Hours, open days, capacity and past dates are NOT enforced, and no message is sent to the customer. Defaults to CONFIRMED. Works without a booking page or Instagram connection. Requires bookings:write scope.',
237
+ inputSchema: {
238
+ profileId: z.string().optional().describe('Booking page UUID; omit to use your own default'),
239
+ customerName: z.string().describe('Customer name (required)'),
240
+ customerContact: z.string().optional(),
241
+ customerIgHandle: z.string().optional(),
242
+ bookingDate: z.string().describe('YYYY-MM-DD'),
243
+ startTime: z.string().describe('HH:mm (24h)'),
244
+ durationMinutes: z.number().int().min(5).max(720).optional().describe('Length in minutes; default is the page slot length'),
245
+ status: z.enum(['PENDING', 'CONFIRMED']).optional().default('CONFIRMED'),
246
+ note: z.string().optional(),
247
+ },
248
+ annotations: { destructiveHint: false },
249
+ }, async (body) => jsonResult(await client.createManualBooking(body)));
250
+ return server;
251
+ }
package/package.json CHANGED
@@ -1,6 +1,58 @@
1
1
  {
2
2
  "name": "@lnkib/mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "MCP server for lnkib: Link-in-Bio, bookings and Instagram automation for your own AI assistant.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "bin": {
8
+ "lnkib-mcp": "./dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist/index.js",
12
+ "dist/server.js",
13
+ "dist/client.js",
14
+ "dist/api-types.js",
15
+ "README.md",
16
+ "CHANGELOG.md",
17
+ "LICENSE"
18
+ ],
19
+ "engines": {
20
+ "node": ">=20"
21
+ },
22
+ "keywords": [
23
+ "mcp",
24
+ "model-context-protocol",
25
+ "lnkib",
26
+ "link-in-bio",
27
+ "bookings",
28
+ "instagram"
29
+ ],
30
+ "homepage": "https://lnkib.com/docs",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/lnkib-org/lnkib-mcp.git"
34
+ },
35
+ "bugs": {
36
+ "url": "https://github.com/lnkib-org/lnkib-mcp/issues"
37
+ },
38
+ "scripts": {
39
+ "build": "tsc -p tsconfig.json",
40
+ "typecheck": "tsc --noEmit -p tsconfig.json",
41
+ "test": "tsc -p tsconfig.json && node --test dist/*.spec.js",
42
+ "test:update-contract": "tsc -p tsconfig.json && UPDATE_TOOLS_CONTRACT=1 node --test dist/tools-contract.spec.js",
43
+ "openapi:sync": "node scripts/sync-openapi.mjs",
44
+ "openapi:check": "node scripts/sync-openapi.mjs --check",
45
+ "openapi:types": "openapi-typescript openapi/openapi.json -o src/generated/openapi.d.ts",
46
+ "start": "node dist/index.js",
47
+ "prepublishOnly": "npm run test"
48
+ },
49
+ "dependencies": {
50
+ "@modelcontextprotocol/sdk": "~1.32.2",
51
+ "zod": "^4.6.7"
52
+ },
53
+ "devDependencies": {
54
+ "@types/node": "^22.0.0",
55
+ "openapi-typescript": "7.12.0",
56
+ "typescript": "^5.7.0"
57
+ }
58
+ }