@mastra/mcp-docs-server 1.1.48 → 1.1.49-alpha.0
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/.docs/docs/mastra-platform/server.md +70 -0
- package/CHANGELOG.md +10 -0
- package/package.json +5 -5
|
@@ -58,6 +58,76 @@ You get a stable API endpoint, environment variable management, custom domain su
|
|
|
58
58
|
|
|
59
59
|
A deploy transitions through **queued → uploading → building → deploying → running** (or **failed**, **cancelled**, **crashed**, or **stopped**). Only one build runs per project at a time. If multiple deploys queue up, only the latest proceeds and the rest are cancelled. Builds running longer than 15 minutes are automatically failed. The first deploy provisions Railway infrastructure and seeds environment variables from your local `.env`. Your server URL remains stable across deploys.
|
|
60
60
|
|
|
61
|
+
## Idle behavior
|
|
62
|
+
|
|
63
|
+
Server on Mastra platform runs on Railway, which can sleep a service after a period of inactivity to save resources. Railway measures inactivity by outbound network traffic. A service is considered idle only after roughly 10 minutes with no outbound packets. Any recurring outbound traffic resets this timer and keeps the service awake.
|
|
64
|
+
|
|
65
|
+
A server that never sleeps usually has a background task or a long-lived connection sending traffic on a timer. Check for the following common causes.
|
|
66
|
+
|
|
67
|
+
### Persistent database connections
|
|
68
|
+
|
|
69
|
+
A database client that stays open keeps the connection alive even when the server is idle. Many drivers also run a background health check that pings the database on an interval, which counts as outbound traffic. For example, a MongoDB client that's never closed keeps a monitoring socket open and sends a heartbeat about every 10 seconds.
|
|
70
|
+
|
|
71
|
+
Connection pool settings that drain idle connections aren't enough on their own, because the driver's monitoring connection stays open and keeps pinging. To let the server sleep, close the client after a period of inactivity and reconnect on the next request.
|
|
72
|
+
|
|
73
|
+
> **Note:** Closing the client adds a short reconnect delay to the first request after the server wakes. If your workload can't tolerate that delay, keep the connection open and don't rely on idle sleep.
|
|
74
|
+
|
|
75
|
+
### Scheduled tasks and timers
|
|
76
|
+
|
|
77
|
+
A `setInterval`, cron job, or polling loop that makes network calls keeps the server awake. If you need scheduled work, run it as a separate service or use an external scheduler that wakes the server with a request.
|
|
78
|
+
|
|
79
|
+
### External pings and keep-alive checks
|
|
80
|
+
|
|
81
|
+
An uptime monitor, health check, or keep-alive ping that hits the server on an interval resets the idle timer. Remove these checks or increase their interval beyond the idle window if you want the server to sleep.
|
|
82
|
+
|
|
83
|
+
### Observability exporters
|
|
84
|
+
|
|
85
|
+
An exporter that streams traces, logs, or metrics to a remote endpoint sends outbound traffic. Confirm the exporter batches and stops sending when the server is idle, rather than flushing on a fixed interval.
|
|
86
|
+
|
|
87
|
+
### Long-lived streams
|
|
88
|
+
|
|
89
|
+
An open server-sent events (SSE) stream, WebSocket, or other long-lived connection holds traffic open until it closes. A streaming response that stays subscribed in the background keeps the connection active. Confirm streams close when the client disconnects and that no stream stays open while the server is otherwise idle.
|
|
90
|
+
|
|
91
|
+
### Chat integrations
|
|
92
|
+
|
|
93
|
+
Some chat integrations hold a persistent connection and send a regular heartbeat, which keeps the server awake. For example, a Slack app in Socket Mode opens a WebSocket and pings about every 30 seconds, and a Discord bot keeps its gateway WebSocket open with a heartbeat on a timer. Both the open socket and the heartbeat prevent idle.
|
|
94
|
+
|
|
95
|
+
If you want the server to sleep, receive events over HTTP webhooks instead of a persistent connection where the integration supports it. Slack apps, for example, can use the Events API with a request URL instead of Socket Mode. If your app needs a persistent connection, keep the service running with the **Persistent Server add-on** described below.
|
|
96
|
+
|
|
97
|
+
### Inspect active connections
|
|
98
|
+
|
|
99
|
+
To find what keeps the server awake, inspect the process's active handles during idle periods. A handle that remains after all requests finish is the cause to investigate. Open sockets point to a persistent connection that needs to close, and active timers point to a `setInterval` or self-rescheduling `setTimeout`.
|
|
100
|
+
|
|
101
|
+
Drop the following helper into your app, then watch the log after traffic stops. Anything still listed once the server is idle is keeping it awake:
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
export function logActiveHandles() {
|
|
105
|
+
// process._getActiveHandles is undocumented but useful for diagnosis.
|
|
106
|
+
const handles = (process as any)._getActiveHandles() as Array<any>
|
|
107
|
+
|
|
108
|
+
const summary = handles.map(handle => {
|
|
109
|
+
const type = handle?.constructor?.name ?? typeof handle
|
|
110
|
+
if (type === 'Socket') {
|
|
111
|
+
return `Socket -> ${handle.remoteAddress}:${handle.remotePort}`
|
|
112
|
+
}
|
|
113
|
+
return type
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
console.log(`[idle] ${handles.length} active handles:`, summary)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Log every 30 seconds so you can see what persists while the server is idle.
|
|
120
|
+
setInterval(logActiveHandles, 30_000).unref()
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Call `unref()` on the diagnostic interval so the helper itself doesn't keep the server awake.
|
|
124
|
+
|
|
125
|
+
### Keep a service running
|
|
126
|
+
|
|
127
|
+
Some applications genuinely need the connections or tasks described above, such as a persistent database connection for low first-request latency, a background scheduler, or a long-lived stream. If your app requires any of these, don't force the service to sleep. Use the **Persistent Server add-on** to keep the service running continuously instead.
|
|
128
|
+
|
|
129
|
+
With the **Persistent Server add-on** enabled, the service stays awake even with no traffic, so persistent connections, scheduled tasks, and open streams keep working without being interrupted by idle sleep.
|
|
130
|
+
|
|
61
131
|
## CI/CD
|
|
62
132
|
|
|
63
133
|
Automate deployments from GitHub Actions, GitLab CI, or any CI provider. After your first interactive deploy, CI/CD needs two things: an API token and the `.mastra-project.json` file committed to your repository.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.1.49-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Security remediation for the 2026-06-17 "easy-day-js" supply-chain incident. Patch bump to publish clean versions and move the `latest` dist-tag forward, superseding the compromised versions that declared the malicious `easy-day-js` dependency. ([#18056](https://github.com/mastra-ai/mastra/pull/18056))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`77a2351`](https://github.com/mastra-ai/mastra/commit/77a2351ee79296e360bce822cb3391f7cfd6489d)]:
|
|
10
|
+
- @mastra/core@1.43.1-alpha.0
|
|
11
|
+
- @mastra/mcp@1.10.1-alpha.0
|
|
12
|
+
|
|
3
13
|
## 1.1.47
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.49-alpha.0",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"jsdom": "^26.1.0",
|
|
29
29
|
"local-pkg": "^1.1.2",
|
|
30
30
|
"zod": "^4.4.3",
|
|
31
|
-
"@mastra/core": "1.43.0",
|
|
32
|
-
"@mastra/mcp": "^1.10.0"
|
|
31
|
+
"@mastra/core": "1.43.1-alpha.0",
|
|
32
|
+
"@mastra/mcp": "^1.10.1-alpha.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@hono/node-server": "^1.19.11",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"typescript": "^6.0.3",
|
|
47
47
|
"vitest": "4.1.8",
|
|
48
48
|
"@internal/types-builder": "0.0.80",
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
49
|
+
"@mastra/core": "1.43.1-alpha.0",
|
|
50
|
+
"@internal/lint": "0.0.105"
|
|
51
51
|
},
|
|
52
52
|
"homepage": "https://mastra.ai",
|
|
53
53
|
"repository": {
|