@ulinkly/mcp-server 0.1.1 → 0.1.2

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/README.md CHANGED
@@ -129,9 +129,9 @@ The following ULink tools are available to the LLM, organized by category.
129
129
 
130
130
  #### Account & Billing
131
131
 
132
- - `get_subscription`: Gets the current subscription plan, status, and renewal date.
133
- - `list_plans`: Lists all available subscription plans with pricing and limits.
134
- - `get_usage`: Gets usage statistics for the current billing period (clicks, links, API calls).
132
+ - `get_subscription`: Gets a project's subscription plan, status, and renewal date. Accepts an optional `projectId`.
133
+ - `list_plans`: Lists all available subscription plans with pricing and limits. Accepts an optional `billingPeriod` (monthly/yearly).
134
+ - `get_usage`: Gets a project's usage statistics for the current billing period (clicks, links, API calls). Accepts an optional `projectId`.
135
135
 
136
136
  ## Environment Variables
137
137
 
@@ -1,3 +1,4 @@
1
+ import { z } from "zod";
1
2
  import { apiRequest } from "../client/ulink-api.js";
2
3
  export function registerAccountTools(server) {
3
4
  // -----------------------------------------------------------------------
@@ -5,11 +6,20 @@ export function registerAccountTools(server) {
5
6
  // -----------------------------------------------------------------------
6
7
  server.registerTool("get_subscription", {
7
8
  title: "Get Subscription",
8
- description: "Retrieve the current user's active subscription details, including plan name, billing period, status, and renewal date.",
9
+ description: "Retrieve the active subscription for a specific project, including plan name, billing period, status, and renewal date. Subscriptions are per-project.",
9
10
  annotations: { readOnlyHint: true },
10
- }, async () => {
11
+ inputSchema: {
12
+ projectId: z
13
+ .string()
14
+ .describe("The project ID to get the subscription for. If omitted, the API returns the subscription for the user's first project.")
15
+ .optional(),
16
+ },
17
+ }, async ({ projectId }) => {
11
18
  try {
12
- const data = await apiRequest("GET", "/subscriptions/current");
19
+ const qs = projectId
20
+ ? `?projectId=${encodeURIComponent(projectId)}`
21
+ : "";
22
+ const data = await apiRequest("GET", `/subscriptions/current${qs}`);
13
23
  return {
14
24
  content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
15
25
  };
@@ -28,9 +38,18 @@ export function registerAccountTools(server) {
28
38
  title: "List Plans",
29
39
  description: "List all available ULink subscription plans with their features, limits, and pricing. Useful for comparing plans or determining upgrade options.",
30
40
  annotations: { readOnlyHint: true },
31
- }, async () => {
41
+ inputSchema: {
42
+ billingPeriod: z
43
+ .enum(["monthly", "yearly"])
44
+ .optional()
45
+ .describe("Billing period to show pricing for (default: monthly)."),
46
+ },
47
+ }, async ({ billingPeriod }) => {
32
48
  try {
33
- const data = await apiRequest("GET", "/subscriptions/plans");
49
+ const qs = billingPeriod
50
+ ? `?billingPeriod=${encodeURIComponent(billingPeriod)}`
51
+ : "";
52
+ const data = await apiRequest("GET", `/subscriptions/plans${qs}`);
34
53
  return {
35
54
  content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
36
55
  };
@@ -47,11 +66,20 @@ export function registerAccountTools(server) {
47
66
  // -----------------------------------------------------------------------
48
67
  server.registerTool("get_usage", {
49
68
  title: "Get Usage",
50
- description: "Retrieve the current user's usage statistics for the active billing period, including link clicks, links created, and API calls against plan limits.",
69
+ description: "Retrieve usage statistics for a specific project's active billing period, including link clicks, links created, and API calls against plan limits. Usage is per-project.",
51
70
  annotations: { readOnlyHint: true },
52
- }, async () => {
71
+ inputSchema: {
72
+ projectId: z
73
+ .string()
74
+ .describe("The project ID to get usage for. If omitted, the API returns usage for the user's first project.")
75
+ .optional(),
76
+ },
77
+ }, async ({ projectId }) => {
53
78
  try {
54
- const data = await apiRequest("GET", "/subscriptions/me/usage");
79
+ const qs = projectId
80
+ ? `?projectId=${encodeURIComponent(projectId)}`
81
+ : "";
82
+ const data = await apiRequest("GET", `/subscriptions/me/usage${qs}`);
55
83
  return {
56
84
  content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
57
85
  };
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/tools/account.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAE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OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aACjE,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAW,GAAW,CAAC,OAAO,EAAE,EAAE,CAAC;gBACnE,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulinkly/mcp-server",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "ULink MCP Server — Model Context Protocol server for the ULink REST API",
5
5
  "type": "module",
6
6
  "bin": {