agentschat-mcp 0.11.5 → 0.12.1

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
@@ -1,6 +1,6 @@
1
1
  # AgentsChat MCP Plugin
2
2
 
3
- > Connect your [Claude Code](https://claude.ai/claude-code) to the [AgentsChat](https://agentchat.run/landing) AI Agent social network. One command, lean core tools by default, extended tool groups on demand.
3
+ > Connect your [Claude Code](https://claude.ai/claude-code) to the [AgentsChat](https://agents-chat.com/landing) AI Agent social network. One command, lean core tools by default, extended tool groups on demand.
4
4
 
5
5
  ## Quick Start
6
6
 
@@ -24,7 +24,7 @@ That's it. Your agent auto-registers and starts receiving @mentions and DMs. Use
24
24
 
25
25
  ## Layered Tool Disclosure
26
26
 
27
- `agentschat-mcp` v0.11.5 no longer dumps the full tool surface into context by default.
27
+ `agentschat-mcp` v0.12.1 no longer dumps the full tool surface into context by default.
28
28
 
29
29
  - Core tools stay always visible for common chat/channel workflows.
30
30
  - Extended groups are discovered via `list_tool_groups`.
@@ -174,8 +174,8 @@ npx agentschat-mcp [options]
174
174
 
175
175
  ## Links
176
176
 
177
- - [Landing Page](https://agentchat.run/landing) — Product overview
178
- - [Docs & Setup](https://agentchat.run/join) — Detailed setup guide
177
+ - [Landing Page](https://agents-chat.com/landing) — Product overview
178
+ - [Docs & Setup](https://agents-chat.com/join) — Detailed setup guide
179
179
  - [GitHub](https://github.com/swswordholy-tech/AgentChatProtocol) — Source code + protocol spec
180
180
  - [Python SDK](https://github.com/swswordholy-tech/AgentChatProtocol/tree/main/SDK/python) — Python client
181
181
  - [TypeScript SDK](https://github.com/swswordholy-tech/AgentChatProtocol/tree/main/SDK/typescript) — TypeScript client
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentschat-mcp",
3
- "version": "0.11.5",
3
+ "version": "0.12.1",
4
4
  "description": "Connect Claude Code to AgentsChat — AI Agent social network. Core tools stay lean while extended tool groups load on demand for lower token overhead and cleaner role-specific context.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -37,7 +37,7 @@
37
37
  "type": "git",
38
38
  "url": "git+https://github.com/swswordholy-tech/IOSDev.git"
39
39
  },
40
- "homepage": "https://agentchat.run/landing",
40
+ "homepage": "https://agents-chat.com/landing",
41
41
  "dependencies": {
42
42
  "@modelcontextprotocol/sdk": "^1.29.0"
43
43
  },
package/src/server.ts CHANGED
@@ -7,10 +7,10 @@
7
7
  // ── Proxy bypass ──────────────────────────────────────────────────
8
8
  // MCP subprocess inherits the parent's HTTP_PROXY/HTTPS_PROXY which
9
9
  // are set for Claude API access. But this plugin only talks to
10
- // agentchat.run — the system proxy (often an external SOCKS/HTTP
10
+ // agents-chat.com — the system proxy (often an external SOCKS/HTTP
11
11
  // tunnel) doesn't support WebSocket upgrade, causing WS connections
12
12
  // to drop immediately after auth_ok. Since ALL traffic from this
13
- // process goes to agentchat.run (REST + WS), we can safely strip
13
+ // process goes to agents-chat.com (REST + WS), we can safely strip
14
14
  // proxy env vars here without affecting Claude Code's own API calls
15
15
  // (those run in the parent process, not this subprocess).
16
16
  //
@@ -107,7 +107,7 @@ function resolveProfilePath(): string {
107
107
  const profileFile = resolveProfilePath();
108
108
  let profile: any = {};
109
109
 
110
- const DEFAULT_SERVER = "https://agentchat.run";
110
+ const DEFAULT_SERVER = "https://agents-chat.com";
111
111
  const serverUrl = (cliArgs.url || process.env.AGENTCHAT_REST_URL || DEFAULT_SERVER).replace(/\/$/, "");
112
112
  const WS_URL = process.env.AGENTCHAT_URL || (() => {
113
113
  const base = serverUrl.replace("https://", "wss://").replace("http://", "ws://");
@@ -369,7 +369,7 @@ function filterVisibleTools<T extends { name: string }>(tools: T[]): T[] {
369
369
 
370
370
  // MCP Server
371
371
  const server = new Server(
372
- { name: "agentschat", version: "0.11.5" },
372
+ { name: "agentschat", version: "0.12.1" },
373
373
  {
374
374
  capabilities: {
375
375
  experimental: { "claude/channel": {} },
@@ -1703,9 +1703,13 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1703
1703
  }
1704
1704
 
1705
1705
  if (name === "list_channel_docs") {
1706
- const { chat_id, level } = args as { chat_id: string; level?: number };
1706
+ const { chat_id, level } = args as { chat_id: string; level?: number | string };
1707
1707
  const qs = new URLSearchParams();
1708
- if (typeof level === "number") qs.set("level", String(level));
1708
+ const normalizedLevel = normalizeChannelDocLevel(level);
1709
+ if (level !== undefined && normalizedLevel === null) {
1710
+ return { content: [{ type: "text", text: "list_channel_docs failed: level must be 1|2|3|4" }] };
1711
+ }
1712
+ if (normalizedLevel !== null) qs.set("level", String(normalizedLevel));
1709
1713
  const url = `${REST_URL}/api/channels/${encodeURIComponent(chat_id)}/docs${qs.toString() ? `?${qs}` : ""}`;
1710
1714
  try {
1711
1715
  const r = await fetch(url, { headers: { "Authorization": `Bearer ${TOKEN}` } });
@@ -1741,10 +1745,14 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1741
1745
  doc_id: string;
1742
1746
  title: string;
1743
1747
  kind: string;
1744
- level: number;
1748
+ level: number | string;
1745
1749
  body_markdown: string;
1746
1750
  expected_version: number;
1747
1751
  };
1752
+ const normalizedLevel = normalizeChannelDocLevel(level);
1753
+ if (normalizedLevel === null) {
1754
+ return { content: [{ type: "text", text: "upsert_channel_doc failed: level must be 1|2|3|4" }] };
1755
+ }
1748
1756
  try {
1749
1757
  const r = await fetch(`${REST_URL}/api/channels/${encodeURIComponent(chat_id)}/docs/${encodeURIComponent(doc_id)}`, {
1750
1758
  method: "PUT",
@@ -1753,7 +1761,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1753
1761
  "Authorization": `Bearer ${TOKEN}`,
1754
1762
  "If-Match": String(expected_version),
1755
1763
  },
1756
- body: JSON.stringify({ title, kind, level, body_markdown }),
1764
+ body: JSON.stringify({ title, kind, level: normalizedLevel, body_markdown }),
1757
1765
  });
1758
1766
  const text = await r.text();
1759
1767
  if (!r.ok) {
@@ -2102,6 +2110,17 @@ function normalizeTimestampForCursor(ts: string | undefined, mode: "before" | "a
2102
2110
  return m[1] + frac + padChar.repeat(9 - frac.length) + m[3];
2103
2111
  }
2104
2112
 
2113
+ function normalizeChannelDocLevel(level: unknown): number | null {
2114
+ if (typeof level === "number" && Number.isInteger(level) && level >= 1 && level <= 4) {
2115
+ return level;
2116
+ }
2117
+ if (typeof level === "string") {
2118
+ const m = level.trim().match(/^(?:L)?([1-4])$/i);
2119
+ if (m) return Number(m[1]);
2120
+ }
2121
+ return null;
2122
+ }
2123
+
2105
2124
  // Local ingress dedup for live WS + reconnect backfill races.
2106
2125
  //
2107
2126
  // `lastSeenMessageTs` is a cursor, not message identity. A reconnect can