@hasna/mcps 0.0.8 → 0.0.9

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/bin/index.js CHANGED
@@ -18059,7 +18059,7 @@ var init_sources = __esm(() => {
18059
18059
  var require_package = __commonJS((exports, module) => {
18060
18060
  module.exports = {
18061
18061
  name: "@hasna/mcps",
18062
- version: "0.0.8",
18062
+ version: "0.0.9",
18063
18063
  description: "Meta-MCP registry & CLI \u2014 discover, manage, and proxy MCP servers",
18064
18064
  type: "module",
18065
18065
  main: "dist/index.js",
@@ -35876,6 +35876,7 @@ var server = new McpServer({
35876
35876
  name: "mcps",
35877
35877
  version: VERSION
35878
35878
  });
35879
+ var _mcpsAgents = new Map;
35879
35880
  server.tool("list_servers", "List all registered MCP servers", {}, async () => {
35880
35881
  const servers = listServers();
35881
35882
  return {
@@ -36175,6 +36176,44 @@ server.tool("send_feedback", "Send feedback about this service", {
36175
36176
  adapter.run("INSERT INTO feedback (message, email, category, version) VALUES (?, ?, ?, ?)", params.message, params.email || null, params.category || "general", VERSION);
36176
36177
  return { content: [{ type: "text", text: "Feedback saved. Thank you!" }] };
36177
36178
  });
36179
+ server.tool("register_agent", "Register an agent session. Returns agent_id. Auto-triggers a heartbeat.", {
36180
+ name: exports_external2.string(),
36181
+ session_id: exports_external2.string().optional()
36182
+ }, async (params) => {
36183
+ const existing = [..._mcpsAgents.values()].find((a) => a.name === params.name);
36184
+ if (existing) {
36185
+ existing.last_seen_at = new Date().toISOString();
36186
+ if (params.session_id)
36187
+ existing.session_id = params.session_id;
36188
+ return { content: [{ type: "text", text: JSON.stringify(existing) }] };
36189
+ }
36190
+ const id = Math.random().toString(36).slice(2, 10);
36191
+ const ag = { id, name: params.name, session_id: params.session_id, last_seen_at: new Date().toISOString() };
36192
+ _mcpsAgents.set(id, ag);
36193
+ return { content: [{ type: "text", text: JSON.stringify(ag) }] };
36194
+ });
36195
+ server.tool("heartbeat", "Update last_seen_at to signal agent is active.", {
36196
+ agent_id: exports_external2.string()
36197
+ }, async (params) => {
36198
+ const ag = _mcpsAgents.get(params.agent_id);
36199
+ if (!ag)
36200
+ return { content: [{ type: "text", text: `Agent not found: ${params.agent_id}` }], isError: true };
36201
+ ag.last_seen_at = new Date().toISOString();
36202
+ return { content: [{ type: "text", text: JSON.stringify({ agent_id: ag.id, last_seen_at: ag.last_seen_at }) }] };
36203
+ });
36204
+ server.tool("set_focus", "Set active project context for this agent session.", {
36205
+ agent_id: exports_external2.string(),
36206
+ project_id: exports_external2.string().optional()
36207
+ }, async (params) => {
36208
+ const ag = _mcpsAgents.get(params.agent_id);
36209
+ if (!ag)
36210
+ return { content: [{ type: "text", text: `Agent not found: ${params.agent_id}` }], isError: true };
36211
+ ag.project_id = params.project_id;
36212
+ return { content: [{ type: "text", text: JSON.stringify({ agent_id: ag.id, project_id: ag.project_id ?? null }) }] };
36213
+ });
36214
+ server.tool("list_agents", "List all registered agents.", {}, async () => {
36215
+ return { content: [{ type: "text", text: JSON.stringify([..._mcpsAgents.values()]) }] };
36216
+ });
36178
36217
  async function startMcpServer() {
36179
36218
  const transport = new StdioServerTransport;
36180
36219
  await server.connect(transport);
package/bin/mcp.js CHANGED
@@ -32259,6 +32259,7 @@ var server = new McpServer({
32259
32259
  name: "mcps",
32260
32260
  version: VERSION
32261
32261
  });
32262
+ var _mcpsAgents = new Map;
32262
32263
  server.tool("list_servers", "List all registered MCP servers", {}, async () => {
32263
32264
  const servers = listServers();
32264
32265
  return {
@@ -32558,6 +32559,44 @@ server.tool("send_feedback", "Send feedback about this service", {
32558
32559
  adapter.run("INSERT INTO feedback (message, email, category, version) VALUES (?, ?, ?, ?)", params.message, params.email || null, params.category || "general", VERSION);
32559
32560
  return { content: [{ type: "text", text: "Feedback saved. Thank you!" }] };
32560
32561
  });
32562
+ server.tool("register_agent", "Register an agent session. Returns agent_id. Auto-triggers a heartbeat.", {
32563
+ name: exports_external.string(),
32564
+ session_id: exports_external.string().optional()
32565
+ }, async (params) => {
32566
+ const existing = [..._mcpsAgents.values()].find((a) => a.name === params.name);
32567
+ if (existing) {
32568
+ existing.last_seen_at = new Date().toISOString();
32569
+ if (params.session_id)
32570
+ existing.session_id = params.session_id;
32571
+ return { content: [{ type: "text", text: JSON.stringify(existing) }] };
32572
+ }
32573
+ const id = Math.random().toString(36).slice(2, 10);
32574
+ const ag = { id, name: params.name, session_id: params.session_id, last_seen_at: new Date().toISOString() };
32575
+ _mcpsAgents.set(id, ag);
32576
+ return { content: [{ type: "text", text: JSON.stringify(ag) }] };
32577
+ });
32578
+ server.tool("heartbeat", "Update last_seen_at to signal agent is active.", {
32579
+ agent_id: exports_external.string()
32580
+ }, async (params) => {
32581
+ const ag = _mcpsAgents.get(params.agent_id);
32582
+ if (!ag)
32583
+ return { content: [{ type: "text", text: `Agent not found: ${params.agent_id}` }], isError: true };
32584
+ ag.last_seen_at = new Date().toISOString();
32585
+ return { content: [{ type: "text", text: JSON.stringify({ agent_id: ag.id, last_seen_at: ag.last_seen_at }) }] };
32586
+ });
32587
+ server.tool("set_focus", "Set active project context for this agent session.", {
32588
+ agent_id: exports_external.string(),
32589
+ project_id: exports_external.string().optional()
32590
+ }, async (params) => {
32591
+ const ag = _mcpsAgents.get(params.agent_id);
32592
+ if (!ag)
32593
+ return { content: [{ type: "text", text: `Agent not found: ${params.agent_id}` }], isError: true };
32594
+ ag.project_id = params.project_id;
32595
+ return { content: [{ type: "text", text: JSON.stringify({ agent_id: ag.id, project_id: ag.project_id ?? null }) }] };
32596
+ });
32597
+ server.tool("list_agents", "List all registered agents.", {}, async () => {
32598
+ return { content: [{ type: "text", text: JSON.stringify([..._mcpsAgents.values()]) }] };
32599
+ });
32561
32600
  async function startMcpServer() {
32562
32601
  const transport = new StdioServerTransport;
32563
32602
  await server.connect(transport);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * PostgreSQL migrations for open-mcps cloud sync.
3
+ *
4
+ * Equivalent to the SQLite schema in db.ts, translated for PostgreSQL.
5
+ */
6
+ export declare const PG_MIGRATIONS: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/mcps",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Meta-MCP registry & CLI — discover, manage, and proxy MCP servers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",