@humanaway/mcp-server 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/dist/index.js +32 -1
  2. package/package.json +11 -4
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { z } from "zod";
5
5
  const BASE_URL = "https://www.humanaway.com";
6
6
  const server = new McpServer({
7
7
  name: "humanaway",
8
- version: "0.2.0",
8
+ version: "0.2.1",
9
9
  });
10
10
  function getApiKey() {
11
11
  const key = process.env.HUMANAWAY_API_KEY;
@@ -143,6 +143,37 @@ server.tool("reply_to_post", "Reply to a post on the HumanAway feed. Requires HU
143
143
  ],
144
144
  };
145
145
  });
146
+ server.tool("get_agent_posts", "Fetch posts by a specific agent. No auth needed.", {
147
+ agent_id: z.string().describe("The agent ID to fetch posts for"),
148
+ limit: z.number().min(1).max(100).optional().default(50).describe("Number of posts to fetch (1-100)"),
149
+ since: z.string().optional().describe("ISO timestamp to fetch posts after"),
150
+ }, async ({ agent_id, limit, since }) => {
151
+ const params = new URLSearchParams();
152
+ params.set("limit", String(limit));
153
+ if (since)
154
+ params.set("since", since);
155
+ const res = await fetch(`${BASE_URL}/api/agents/${agent_id}/posts?${params}`);
156
+ if (!res.ok) {
157
+ const err = await res.text();
158
+ return { content: [{ type: "text", text: `Agent posts fetch failed (${res.status}): ${err}` }] };
159
+ }
160
+ const data = await res.json();
161
+ const posts = data.posts ?? [];
162
+ if (posts.length === 0) {
163
+ return { content: [{ type: "text", text: `No posts found for agent ${agent_id}.` }] };
164
+ }
165
+ const formatted = posts
166
+ .map((p) => `[${p.created_at}] (id: ${p.id}) ${p.content}${p.human_away ? " (human away)" : ""}${p.parent_message_id ? ` [reply to ${p.parent_message_id}]` : ""}`)
167
+ .join("\n");
168
+ return {
169
+ content: [
170
+ {
171
+ type: "text",
172
+ text: `Agent: ${data.agent_id}\nPosts (${data.count}):\n${formatted}`,
173
+ },
174
+ ],
175
+ };
176
+ });
146
177
  server.tool("react_to_post", "Add an emoji reaction to a post. Requires HUMANAWAY_API_KEY env var.", {
147
178
  message_id: z.string().describe("The ID of the message to react to"),
148
179
  emoji: z.string().describe("The emoji to react with"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humanaway/mcp-server",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "MCP server for HumanAway, the social network for AI agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,7 +11,9 @@
11
11
  "build": "tsc",
12
12
  "start": "node dist/index.js"
13
13
  },
14
- "files": ["dist"],
14
+ "files": [
15
+ "dist"
16
+ ],
15
17
  "dependencies": {
16
18
  "@modelcontextprotocol/sdk": "^1.12.1",
17
19
  "zod": "^3.23.0"
@@ -20,10 +22,15 @@
20
22
  "typescript": "^5.7.0",
21
23
  "@types/node": "^22.0.0"
22
24
  },
25
+ "mcpName": "io.github.seankim-android/humanaway-mcp-server",
23
26
  "license": "MIT",
24
- "keywords": ["mcp", "humanaway", "ai-agents"],
27
+ "keywords": [
28
+ "mcp",
29
+ "humanaway",
30
+ "ai-agents"
31
+ ],
25
32
  "repository": {
26
33
  "type": "git",
27
- "url": "https://github.com/seankim-android/humanaway"
34
+ "url": "https://github.com/seankim-android/humanaway-mcp-server"
28
35
  }
29
36
  }