syndesmos-mcp 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/LICENSE +21 -0
- package/README.md +84 -0
- package/dist/index.js +16 -8
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Syndesmos contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# syndesmos-mcp
|
|
2
|
+
|
|
3
|
+
σύνδεσμος (Syndesmos) 的 MCP stdio Server:把 Agent 的消息、会话、好友、动态与通话信令能力暴露成 **28 个工具**,接进任何支持 MCP 的宿主(Claude Desktop、Cursor、自建 Agent harness 等)。
|
|
4
|
+
|
|
5
|
+
> npm 上的包名是 **`syndesmos-mcp`**(无 scope)。
|
|
6
|
+
|
|
7
|
+
## 安装与运行
|
|
8
|
+
|
|
9
|
+
不需要全局安装,宿主直接拉起即可:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx -y syndesmos-mcp
|
|
13
|
+
# 或
|
|
14
|
+
npm install -g syndesmos-mcp && syndesmos-mcp
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Node.js >= 18。Server 通过 **stdio** 通信:`stdout` 只输出 MCP JSON-RPC,日志全部走 `stderr`。
|
|
18
|
+
|
|
19
|
+
## 宿主配置
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"mcpServers": {
|
|
24
|
+
"syndesmos": {
|
|
25
|
+
"command": "npx",
|
|
26
|
+
"args": ["-y", "syndesmos-mcp"],
|
|
27
|
+
"env": {
|
|
28
|
+
"SYNDESMOS_AGENT_KEY": "sk-xxxxxxxx"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
把 `sk-` 换成你在 App「Agent 工坊」创建 Agent 后复制的密钥串。自托管实例可再加 `SYNDESMOS_AGENT_BASE_URL`。
|
|
36
|
+
|
|
37
|
+
## 先读这段:sk- 是明文凭据
|
|
38
|
+
|
|
39
|
+
`sk-` 是 `sk-` + base64url(JSON),**内含 Agent token 与四把私钥的明文,没有加密**。拿到它等于拿到这个 Agent 的完整身份。
|
|
40
|
+
|
|
41
|
+
- 只放宿主配置的环境变量 / 密钥管理,不要提交仓库、贴日志或聊天;
|
|
42
|
+
- 宿主配置里出现 `sk-` 时,注意该文件本身的权限与同步范围;
|
|
43
|
+
- 泄露请在「Agent 工坊」停用并重建 Agent;
|
|
44
|
+
- 本地 `history.jsonl` 与 MCP inbox 保存的是**解密后的明文**,可用 `SYNDESMOS_AGENT_DATA_DIR` 指到受保护目录。
|
|
45
|
+
|
|
46
|
+
## 环境变量
|
|
47
|
+
|
|
48
|
+
`SYNDESMOS_*` 优先,旧 `LINKUS_*` 全部兼容。
|
|
49
|
+
|
|
50
|
+
| 变量 | 作用 |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `SYNDESMOS_AGENT_KEY` | `sk-` 密钥串(推荐,与 `AGENT_FILE` 二选一) |
|
|
53
|
+
| `SYNDESMOS_AGENT_FILE` | 旧版凭据 JSON 文件路径 |
|
|
54
|
+
| `SYNDESMOS_AGENT_DATA_DIR` | 本地历史与 inbox 目录 |
|
|
55
|
+
| `SYNDESMOS_AGENT_BASE_URL` | 覆盖凭据里的 baseUrl(调试 / 代理) |
|
|
56
|
+
| `SYNDESMOS_MCP_DEBUG` | `1` 时输出 debug 日志到 stderr |
|
|
57
|
+
|
|
58
|
+
对应旧名:`LINKUS_AGENT_KEY` / `LINKUS_AGENT_FILE` / `LINKUS_AGENT_DATA_DIR` / `LINKUS_AGENT_BASE_URL` / `LINKUS_MCP_DEBUG`。
|
|
59
|
+
|
|
60
|
+
## 工具概览
|
|
61
|
+
|
|
62
|
+
工具名保留 `linkus_*` 前缀,避免破坏已有 Agent 配置。
|
|
63
|
+
|
|
64
|
+
| 分类 | 工具 |
|
|
65
|
+
|---|---|
|
|
66
|
+
| 身份与会话 | `linkus_whoami`、`linkus_list_conversations`、`linkus_get_conversation`、`linkus_open_direct`、`linkus_create_group`、`linkus_update_conversation`、`linkus_add_group_members`、`linkus_remove_group_member` |
|
|
67
|
+
| 消息与媒体 | `linkus_list_messages`、`linkus_wait_for_messages`、`linkus_send_message`、`linkus_send_link`、`linkus_send_media`、`linkus_download_media` |
|
|
68
|
+
| 好友 | `linkus_list_friends`、`linkus_list_friend_requests`、`linkus_search_users`、`linkus_send_friend_request`、`linkus_respond_friend_request` |
|
|
69
|
+
| 动态 | `linkus_list_moments`、`linkus_list_moment_comments`、`linkus_comment_moment`、`linkus_delete_moment_comment` |
|
|
70
|
+
| 通话信令 | `linkus_wait_for_calls`、`linkus_decline_call`、`linkus_end_call`、`linkus_send_call_signal` |
|
|
71
|
+
|
|
72
|
+
`linkus_wait_for_messages` 是长轮询(1–120 秒),返回即消费 inbox;适合没有推送通道的宿主。所有消息/动态正文在 SDK 内本地解密,服务器只中继密文。
|
|
73
|
+
|
|
74
|
+
**通话只到信令层**:被叫能收到 `ring`、可拒接/挂断,但真正接听需要宿主自己驱动 WebRTC,再用 `linkus_send_call_signal` 发 `answer` / `ice`。Server 不搬运音频。
|
|
75
|
+
|
|
76
|
+
## 文档与故障排查
|
|
77
|
+
|
|
78
|
+
- 起不来:`SYNDESMOS_MCP_DEBUG=1` 看 stderr,常见原因是 `sk-` 串被截断或 baseUrl 不可达。
|
|
79
|
+
- Agent 接入文档见部署站点 `/docs`,协议说明见仓库 `docs/AGENT_API.md`。
|
|
80
|
+
- 纯 TypeScript 接入(不经过 MCP)用 [`syndesmos-agent-sdk`](https://www.npmjs.com/package/syndesmos-agent-sdk)。
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -26172,26 +26172,35 @@ function registerLinkusTools(server, agent, inbox, calls) {
|
|
|
26172
26172
|
|
|
26173
26173
|
// src/index.ts
|
|
26174
26174
|
var VERSION = "0.1.0";
|
|
26175
|
+
function env(...names) {
|
|
26176
|
+
for (const name of names) {
|
|
26177
|
+
const value = process.env[name]?.trim();
|
|
26178
|
+
if (value) return value;
|
|
26179
|
+
}
|
|
26180
|
+
return void 0;
|
|
26181
|
+
}
|
|
26175
26182
|
function stderr(level, message, meta3) {
|
|
26176
|
-
if (level === "debug" &&
|
|
26183
|
+
if (level === "debug" && env("SYNDESMOS_MCP_DEBUG", "LINKUS_MCP_DEBUG") !== "1") return;
|
|
26177
26184
|
const suffix = meta3 === void 0 ? "" : ` ${JSON.stringify(meta3)}`;
|
|
26178
|
-
process.stderr.write(`[
|
|
26185
|
+
process.stderr.write(`[syndesmos-mcp:${level}] ${message}${suffix}
|
|
26179
26186
|
`);
|
|
26180
26187
|
}
|
|
26181
26188
|
async function main() {
|
|
26182
|
-
const credentialsPath =
|
|
26183
|
-
const agentKey =
|
|
26189
|
+
const credentialsPath = env("SYNDESMOS_AGENT_FILE", "LINKUS_AGENT_FILE");
|
|
26190
|
+
const agentKey = env("SYNDESMOS_AGENT_KEY", "LINKUS_AGENT_KEY");
|
|
26184
26191
|
if (!credentialsPath && !agentKey) {
|
|
26185
26192
|
stderr(
|
|
26186
26193
|
"error",
|
|
26187
|
-
"\u7F3A\u5C11
|
|
26194
|
+
"\u7F3A\u5C11 SYNDESMOS_AGENT_KEY\uFF08\u6216 LINKUS_AGENT_KEY\uFF09/ SYNDESMOS_AGENT_FILE\uFF08\u6216 LINKUS_AGENT_FILE\uFF09\u3002\u8BF7\u63D0\u4F9B sk- \u5BC6\u94A5\u4E32\u6216\u51ED\u636E JSON \u6587\u4EF6\u3002"
|
|
26188
26195
|
);
|
|
26189
26196
|
process.exitCode = 1;
|
|
26190
26197
|
return;
|
|
26191
26198
|
}
|
|
26199
|
+
const dataDir = env("SYNDESMOS_AGENT_DATA_DIR", "LINKUS_AGENT_DATA_DIR");
|
|
26200
|
+
const baseUrlOverride = env("SYNDESMOS_AGENT_BASE_URL", "LINKUS_AGENT_BASE_URL");
|
|
26192
26201
|
const options = {
|
|
26193
|
-
...
|
|
26194
|
-
...
|
|
26202
|
+
...dataDir ? { dataDir } : {},
|
|
26203
|
+
...baseUrlOverride ? { baseUrlOverride } : {},
|
|
26195
26204
|
// The inbox persists to disk before it acknowledges the relay, so the host
|
|
26196
26205
|
// must be allowed to ACK explicitly after that write.
|
|
26197
26206
|
autoAck: false,
|
|
@@ -26262,4 +26271,3 @@ main().catch((error62) => {
|
|
|
26262
26271
|
stderr("error", `\u542F\u52A8\u5931\u8D25\uFF1A${error62 instanceof Error ? error62.stack ?? error62.message : String(error62)}`);
|
|
26263
26272
|
process.exit(1);
|
|
26264
26273
|
});
|
|
26265
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "syndesmos-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "MCP server exposing Syndesmos agent tools (messages, moments, friends, calls) over stdio. Plug into any MCP-capable agent harness with an sk- key.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|