@almyty/mcp-server 1.5.1 → 1.5.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.
- package/README.md +32 -17
- package/dist/index.d.ts +18 -5
- package/dist/index.js +215 -135
- package/dist/proxy.d.ts +69 -4
- package/dist/proxy.js +154 -58
- package/dist/registration.d.ts +29 -0
- package/dist/registration.js +83 -0
- package/package.json +4 -4
- package/dist/schema.d.ts +0 -36
- package/dist/schema.js +0 -52
package/README.md
CHANGED
|
@@ -6,14 +6,15 @@ and agents — over stdio, with two tools in context instead of twenty.
|
|
|
6
6
|
## Quick start
|
|
7
7
|
|
|
8
8
|
```bash
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
npm i -g @almyty/cli
|
|
10
|
+
almyty login
|
|
11
|
+
claude mcp add almyty -- almyty mcp
|
|
11
12
|
```
|
|
12
13
|
|
|
13
14
|
Or scope it to one gateway:
|
|
14
15
|
|
|
15
16
|
```bash
|
|
16
|
-
|
|
17
|
+
almyty mcp acme/petstore
|
|
17
18
|
```
|
|
18
19
|
|
|
19
20
|
The positional argument is `orgSlug/gatewaySlug`; with none, the server serves
|
|
@@ -47,7 +48,9 @@ Set `ALMYTY_MODE`:
|
|
|
47
48
|
- **`skill-first`** (default) — the two tools above plus skills as prompts.
|
|
48
49
|
- **`full`** — every gateway tool registered individually, traditional MCP.
|
|
49
50
|
Higher context cost. The list is read once at startup, and the client is
|
|
50
|
-
notified when it arrives.
|
|
51
|
+
notified when it arrives. Each tool keeps its title, full input schema,
|
|
52
|
+
output schema and annotations as the gateway gives them, and a call returns
|
|
53
|
+
the gateway's structured result next to the text.
|
|
51
54
|
|
|
52
55
|
## Management tools
|
|
53
56
|
|
|
@@ -68,8 +71,8 @@ passed as a tool argument would be written into the assistant's transcript and
|
|
|
68
71
|
the host editor's logs, so the key goes through `@almyty/credentials` instead:
|
|
69
72
|
|
|
70
73
|
```bash
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
almyty credentials add openai
|
|
75
|
+
almyty credentials list # -> the id to hand the tool
|
|
73
76
|
```
|
|
74
77
|
|
|
75
78
|
## When almyty is not reachable
|
|
@@ -78,13 +81,23 @@ The server connects its transport before it fetches anything, so the MCP
|
|
|
78
81
|
handshake always completes: an editor never sees the server die during
|
|
79
82
|
startup because the API was down or the token had gone stale. Discovery then
|
|
80
83
|
runs, and a failure is reported on the tool call that needed it, in words that
|
|
81
|
-
name the fix — `run
|
|
84
|
+
name the fix — `run almyty login` for a stale token, `check
|
|
82
85
|
ALMYTY_URL` for an unreachable host. The management tools keep working
|
|
83
86
|
throughout.
|
|
84
87
|
|
|
85
88
|
Every call is bounded: 15 seconds for discovery, 120 for a tool execution.
|
|
86
89
|
A hung backend fails the call rather than hanging your editor.
|
|
87
90
|
|
|
91
|
+
## MCP versions
|
|
92
|
+
|
|
93
|
+
The server speaks MCP 2026-07-28 and the earlier versions (2024-11-05 to
|
|
94
|
+
2025-11-25) alike: the client's first message decides. A client that opens with
|
|
95
|
+
`initialize` (Claude Desktop, Cursor and most editors today) gets the earlier
|
|
96
|
+
protocol, and no notification before it has sent `notifications/initialized`.
|
|
97
|
+
A client that opens with a 2026-07-28 request is served statelessly and hears
|
|
98
|
+
about tool and prompt changes only on a `subscriptions/listen` stream it
|
|
99
|
+
opened.
|
|
100
|
+
|
|
88
101
|
## stdio discipline
|
|
89
102
|
|
|
90
103
|
stdout carries the MCP protocol and nothing else; every diagnostic goes to
|
|
@@ -98,7 +111,7 @@ server when you ask for either.
|
|
|
98
111
|
### Claude Code
|
|
99
112
|
|
|
100
113
|
```bash
|
|
101
|
-
claude mcp add almyty --
|
|
114
|
+
claude mcp add almyty -- almyty mcp
|
|
102
115
|
```
|
|
103
116
|
|
|
104
117
|
### Cursor / Windsurf (`.cursor/mcp.json` or `~/.codeium/windsurf/mcp_config.json`)
|
|
@@ -107,8 +120,8 @@ claude mcp add almyty -- npx -y @almyty/mcp-server
|
|
|
107
120
|
{
|
|
108
121
|
"mcpServers": {
|
|
109
122
|
"almyty": {
|
|
110
|
-
"command": "
|
|
111
|
-
"args": ["
|
|
123
|
+
"command": "almyty",
|
|
124
|
+
"args": ["mcp"]
|
|
112
125
|
}
|
|
113
126
|
}
|
|
114
127
|
}
|
|
@@ -120,8 +133,8 @@ claude mcp add almyty -- npx -y @almyty/mcp-server
|
|
|
120
133
|
{
|
|
121
134
|
"servers": {
|
|
122
135
|
"almyty": {
|
|
123
|
-
"command": "
|
|
124
|
-
"args": ["
|
|
136
|
+
"command": "almyty",
|
|
137
|
+
"args": ["mcp"]
|
|
125
138
|
}
|
|
126
139
|
}
|
|
127
140
|
}
|
|
@@ -131,8 +144,8 @@ claude mcp add almyty -- npx -y @almyty/mcp-server
|
|
|
131
144
|
|
|
132
145
|
```toml
|
|
133
146
|
[mcp_servers.almyty]
|
|
134
|
-
command = "
|
|
135
|
-
args = ["
|
|
147
|
+
command = "almyty"
|
|
148
|
+
args = ["mcp"]
|
|
136
149
|
```
|
|
137
150
|
|
|
138
151
|
### Google Gemini CLI (`~/.gemini/settings.json`)
|
|
@@ -141,8 +154,8 @@ args = ["-y", "@almyty/mcp-server"]
|
|
|
141
154
|
{
|
|
142
155
|
"mcpServers": {
|
|
143
156
|
"almyty": {
|
|
144
|
-
"command": "
|
|
145
|
-
"args": ["
|
|
157
|
+
"command": "almyty",
|
|
158
|
+
"args": ["mcp"]
|
|
146
159
|
}
|
|
147
160
|
}
|
|
148
161
|
}
|
|
@@ -156,10 +169,12 @@ args = ["-y", "@almyty/mcp-server"]
|
|
|
156
169
|
| `ALMYTY_TOKEN` | Token; otherwise read from `~/.almyty/credentials.json` |
|
|
157
170
|
| `ALMYTY_GATEWAY_ID` | Gateway as `orgSlug/gatewaySlug` (alternative to the positional argument) |
|
|
158
171
|
| `ALMYTY_MODE` | `skill-first` (default) or `full` |
|
|
172
|
+
| `ALMYTY_MCP_PROTOCOL` | How this server talks to almyty: `auto` (default: MCP 2026-07-28, falling back to the earlier protocol for an older almyty), `modern` or `legacy` |
|
|
173
|
+
| `ALMYTY_DISCOVERY_WAIT_MS` | How long the client's first message waits for the gateway's tool list, so the first list is complete (default 5000; `0` never waits and announces the tools once they arrive) |
|
|
159
174
|
|
|
160
175
|
## Authentication
|
|
161
176
|
|
|
162
|
-
Run `
|
|
177
|
+
Run `almyty login` once; credentials are read from
|
|
163
178
|
`~/.almyty/credentials.json`. `ALMYTY_TOKEN` overrides the file. The old
|
|
164
179
|
`mcp-server login` / `logout` / `whoami` subcommands now point at
|
|
165
180
|
`@almyty/auth` and exit non-zero.
|
package/dist/index.d.ts
CHANGED
|
@@ -11,15 +11,28 @@
|
|
|
11
11
|
* The model reads a skill to learn a workflow, then calls almyty_execute with
|
|
12
12
|
* a tool name and parameters.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* Rules this file lives by:
|
|
15
15
|
*
|
|
16
16
|
* **stdout is the protocol.** Every diagnostic goes to stderr; one stray
|
|
17
17
|
* console.log on stdout corrupts the JSON-RPC stream and the host editor
|
|
18
18
|
* loses the server with no useful error.
|
|
19
19
|
*
|
|
20
|
-
* **The
|
|
21
|
-
*
|
|
22
|
-
* during the handshake
|
|
23
|
-
*
|
|
20
|
+
* **The handshake never waits for the backend.** Discovery runs in the
|
|
21
|
+
* background, so a backend that is down or a stale token cannot kill the
|
|
22
|
+
* process during the handshake; a discovery failure is reported on the tool
|
|
23
|
+
* call that needed it.
|
|
24
|
+
*
|
|
25
|
+
* **Both protocol eras, from one factory.** `serveStdio` (MCP SDK 2.x) lets
|
|
26
|
+
* the client's first message decide: an `initialize` (MCP 2024-11-05 ..
|
|
27
|
+
* 2025-11-25, what Claude Desktop, Cursor and most editors send today) pins
|
|
28
|
+
* the connection to the earlier protocol; a request carrying `_meta` pins it
|
|
29
|
+
* to MCP 2026-07-28. `buildServer` registers the same tools either way.
|
|
30
|
+
*
|
|
31
|
+
* **No notifications before the client is ready (#875).** What discovery
|
|
32
|
+
* found is registered late, and every late registration makes the SDK send
|
|
33
|
+
* a list_changed notification. On the earlier protocol that is held until
|
|
34
|
+
* the client has sent `notifications/initialized`, as the MCP lifecycle
|
|
35
|
+
* requires. On 2026-07-28 there is no handshake and the SDK sends
|
|
36
|
+
* notifications only on a `subscriptions/listen` stream the client opened.
|
|
24
37
|
*/
|
|
25
38
|
export {};
|