@remnic/replit 1.0.1 → 9.3.515
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 +17 -4
- package/dist/index.d.ts +8 -3
- package/dist/index.js +37 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -33,20 +33,33 @@ console.log(setup.instructions);
|
|
|
33
33
|
// Paste setup.mcpConfig into Replit's Integrations > Add MCP server form.
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
For a cloud Replit workspace, pass the public HTTPS origin for your Remnic server:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
const setup = generateReplitInstructions("YOUR_REMNIC_TOKEN", {
|
|
40
|
+
baseUrl: "https://remnic.example.com",
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The legacy `generateReplitInstructions(token, host?, port?)` form is still supported for
|
|
45
|
+
local or LAN hosts. If `host` already includes a scheme, it is treated as a complete
|
|
46
|
+
origin and the MCP URL is generated with the URL API.
|
|
47
|
+
|
|
48
|
+
`generateReplitInstructions(token, endpoint?, port?)` returns:
|
|
37
49
|
|
|
38
50
|
```ts
|
|
39
51
|
interface ReplitInstallResult {
|
|
40
52
|
token: string;
|
|
41
53
|
instructions: string; // human-readable setup steps
|
|
42
54
|
mcpConfig: {
|
|
43
|
-
url: string; // http://
|
|
55
|
+
url: string; // http://localhost:4318/mcp or https://{origin}/mcp
|
|
44
56
|
headers: Record<string, string>; // Authorization + X-Engram-Client-Id
|
|
45
57
|
};
|
|
46
58
|
}
|
|
47
59
|
```
|
|
48
60
|
|
|
49
|
-
Defaults are `host="localhost"`, `port=4318`.
|
|
61
|
+
Defaults are `host="localhost"`, `port=4318`. Public origins must be an origin only,
|
|
62
|
+
without a path, query string, or hash.
|
|
50
63
|
|
|
51
64
|
## Replit pane setup
|
|
52
65
|
|
|
@@ -68,7 +81,7 @@ A ready-to-paste snippet lives at `setup-snippet.json` in the package.
|
|
|
68
81
|
|
|
69
82
|
## Caveats
|
|
70
83
|
|
|
71
|
-
- For a **cloud** Replit workspace, the Remnic server has to be publicly reachable — via a tunnel (Cloudflare Tunnel, ngrok, Tailscale funnel), a public IP, or a reverse proxy. `localhost` only works for self-hosted Replit-likes.
|
|
84
|
+
- For a **cloud** Replit workspace, the Remnic server has to be publicly reachable — via a tunnel (Cloudflare Tunnel, ngrok, Tailscale funnel), a public IP, or a reverse proxy. Pass that public origin with `baseUrl`, for example `https://remnic.example.com`. `localhost` only works for self-hosted Replit-likes.
|
|
72
85
|
- Replit has **no hook system**, so the agent must explicitly call Remnic MCP tools (`recall`, `observe`, `store`, `search`). Auto-recall before prompts isn't available the way it is on Claude Code, Codex, or OpenClaw. All 44 MCP tools are exposed.
|
|
73
86
|
- The token is a plain bearer token. Don't paste it into a Replit that you share with others unless each collaborator should have the same memory namespace.
|
|
74
87
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Replit connector installer.
|
|
3
3
|
*
|
|
4
|
-
* Since Replit has no plugin system, this
|
|
5
|
-
*
|
|
4
|
+
* Since Replit has no plugin system, this formats a pre-existing Remnic
|
|
5
|
+
* bearer token into setup instructions for the Integrations pane.
|
|
6
6
|
*/
|
|
7
7
|
interface ReplitInstallResult {
|
|
8
8
|
token: string;
|
|
@@ -12,6 +12,11 @@ interface ReplitInstallResult {
|
|
|
12
12
|
headers: Record<string, string>;
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
interface ReplitEndpointOptions {
|
|
16
|
+
host?: string;
|
|
17
|
+
port?: number;
|
|
18
|
+
baseUrl?: string | URL;
|
|
19
|
+
}
|
|
20
|
+
declare function generateReplitInstructions(token: string, hostOrOptions?: string | URL | ReplitEndpointOptions, port?: number): ReplitInstallResult;
|
|
16
21
|
|
|
17
22
|
export { type ReplitInstallResult, generateReplitInstructions };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
// src/installer.ts
|
|
2
|
-
function
|
|
3
|
-
|
|
2
|
+
function assertValidPort(port) {
|
|
3
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535) {
|
|
4
|
+
throw new TypeError("Replit MCP port must be an integer between 1 and 65535");
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
function hasScheme(value) {
|
|
8
|
+
return /^[a-z][a-z0-9+.-]*:\/\//i.test(value);
|
|
9
|
+
}
|
|
10
|
+
function endpointFromHost(host, port) {
|
|
11
|
+
const trimmedHost = host.trim();
|
|
12
|
+
if (trimmedHost.length === 0) {
|
|
13
|
+
throw new TypeError("Replit MCP host must be a non-empty hostname or URL origin");
|
|
14
|
+
}
|
|
15
|
+
if (hasScheme(trimmedHost)) {
|
|
16
|
+
const url = new URL(trimmedHost);
|
|
17
|
+
if (url.pathname !== "/" || url.search !== "" || url.hash !== "") {
|
|
18
|
+
throw new TypeError("Replit MCP base URL must be an origin without a path, query, or hash");
|
|
19
|
+
}
|
|
20
|
+
return url;
|
|
21
|
+
}
|
|
22
|
+
if (/[/?#]/.test(trimmedHost)) {
|
|
23
|
+
throw new TypeError("Replit MCP host must not include a path, query, or hash");
|
|
24
|
+
}
|
|
25
|
+
assertValidPort(port);
|
|
26
|
+
return new URL(`http://${trimmedHost}:${port}`);
|
|
27
|
+
}
|
|
28
|
+
function buildMcpUrl(hostOrOptions = "localhost", port = 4318) {
|
|
29
|
+
const endpoint = hostOrOptions instanceof URL ? endpointFromHost(hostOrOptions.toString(), port) : typeof hostOrOptions === "object" ? hostOrOptions.baseUrl ? endpointFromHost(hostOrOptions.baseUrl.toString(), hostOrOptions.port ?? port) : endpointFromHost(hostOrOptions.host ?? "localhost", hostOrOptions.port ?? port) : endpointFromHost(hostOrOptions, port);
|
|
30
|
+
endpoint.pathname = "/mcp";
|
|
31
|
+
endpoint.search = "";
|
|
32
|
+
endpoint.hash = "";
|
|
33
|
+
return endpoint.toString();
|
|
34
|
+
}
|
|
35
|
+
function generateReplitInstructions(token, hostOrOptions = "localhost", port = 4318) {
|
|
36
|
+
const url = buildMcpUrl(hostOrOptions, port);
|
|
4
37
|
const instructions = `
|
|
5
38
|
Replit Agent MCP Setup
|
|
6
39
|
======================
|
|
@@ -12,11 +45,11 @@ Replit Agent MCP Setup
|
|
|
12
45
|
- X-Engram-Client-Id: replit
|
|
13
46
|
4. Click Test & Save
|
|
14
47
|
|
|
15
|
-
Note: For cloud Replit,
|
|
48
|
+
Note: For cloud Replit, the Remnic MCP endpoint must be publicly reachable (via tunnel, public IP, or reverse proxy).
|
|
16
49
|
|
|
17
50
|
Limitations:
|
|
18
51
|
- Replit has no hook system, so memory recall/observe is manual
|
|
19
|
-
- The agent must explicitly call
|
|
52
|
+
- The agent must explicitly call Remnic MCP tools (recall, observe, store, search)
|
|
20
53
|
- All 44 MCP tools are available
|
|
21
54
|
`.trim();
|
|
22
55
|
return {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/replit",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Remnic MCP connector for Replit Agent — setup instructions
|
|
3
|
+
"version": "9.3.515",
|
|
4
|
+
"description": "Remnic MCP connector for Replit Agent — setup instructions for an existing token",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|