@bluepages/mcp-server 0.1.1 → 0.1.3

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.
Files changed (2) hide show
  1. package/dist/index.js +43 -3
  2. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@
17
17
  const BLUEPAGES_URL = (process.env.BLUEPAGES_URL || 'https://bluepages.ai').replace(/\/+$/, '');
18
18
  const SERVER_INFO = {
19
19
  name: 'bluepages',
20
- version: '0.1.0',
20
+ version: '0.1.3',
21
21
  };
22
22
  const PROTOCOL_VERSION = '2024-11-05';
23
23
  // ---------------------------------------------------------------------------
@@ -127,6 +127,46 @@ async function fetchSkills(query, category, limit = 50) {
127
127
  return [];
128
128
  }
129
129
  }
130
+ /**
131
+ * Search skills using the capabilities endpoint which supports full-text query.
132
+ * Used by the bluepages_search tool.
133
+ */
134
+ async function searchSkills(query, category, limit = 10) {
135
+ const params = new URLSearchParams();
136
+ if (query)
137
+ params.set('query', query);
138
+ if (category)
139
+ params.set('category', category);
140
+ params.set('limit', String(Math.min(limit, 50)));
141
+ const url = `${BLUEPAGES_URL}/api/v1/capabilities?${params.toString()}`;
142
+ log(`Searching skills: ${url}`);
143
+ try {
144
+ const res = await fetch(url);
145
+ if (!res.ok) {
146
+ log(`Search API error: ${res.status}`);
147
+ return [];
148
+ }
149
+ const data = (await res.json());
150
+ return (data.capabilities || []).map((c) => {
151
+ const pricing = (c.pricing || {});
152
+ return {
153
+ slug: c.slug || '',
154
+ name: c.name || '',
155
+ description: c.description || '',
156
+ inputSchema: c.inputs ? JSON.stringify(c.inputs) : null,
157
+ pricePerCall: pricing.price ?? 0,
158
+ currency: pricing.currency || 'USDC',
159
+ category: c.category || undefined,
160
+ avgRating: c.rating,
161
+ totalCalls: c.totalCalls,
162
+ };
163
+ });
164
+ }
165
+ catch (err) {
166
+ log(`Search error: ${err}`);
167
+ return [];
168
+ }
169
+ }
130
170
  async function invokeSkill(slug, args) {
131
171
  const url = `${BLUEPAGES_URL}/api/v1/invoke/${encodeURIComponent(slug)}`;
132
172
  log(`Invoking skill: ${url}`);
@@ -196,9 +236,9 @@ async function handleToolsCall(params) {
196
236
  if (!name) {
197
237
  throw { code: -32602, message: 'Missing required parameter: name' };
198
238
  }
199
- // Built-in search tool
239
+ // Built-in search tool — uses /api/v1/capabilities which supports full-text query
200
240
  if (name === 'bluepages_search') {
201
- const skills = await fetchSkills(args.query, args.category, Math.min(Number(args.limit) || 10, 50));
241
+ const skills = await searchSkills(args.query, args.category, Math.min(Number(args.limit) || 10, 50));
202
242
  const summary = skills.map((s) => ({
203
243
  name: s.name,
204
244
  slug: s.slug,
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@bluepages/mcp-server",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "BluePages MCP Server - discover and invoke AI agent skills from Claude",
5
5
  "type": "module",
6
6
  "bin": {
7
- "bluepages-mcp": "dist/index.js"
7
+ "bluepages-mcp": "dist/index.js",
8
+ "mcp-server": "dist/index.js"
8
9
  },
9
10
  "main": "dist/index.js",
10
11
  "types": "dist/index.d.ts",