logos-layer 0.1.0 → 0.1.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 +26 -3
- package/dist/index.js +19 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Add to your MCP client config (Claude Desktop, Claude Code, or any MCP client):
|
|
|
17
17
|
"mcpServers": {
|
|
18
18
|
"logos-layer": {
|
|
19
19
|
"command": "npx",
|
|
20
|
-
"args": ["-y", "logos-layer"],
|
|
20
|
+
"args": ["-y", "logos-layer@0.1.1"],
|
|
21
21
|
"env": {
|
|
22
22
|
"VAULT_ADDRESS": "<your-vault-address>",
|
|
23
23
|
"RPC_URL": "https://rpc.testnet.chain.robinhood.com",
|
|
@@ -34,11 +34,34 @@ Requires Node 20+.
|
|
|
34
34
|
| --- | --- | --- |
|
|
35
35
|
| `VAULT_ADDRESS` | yes | The deployed vault the agent trades inside |
|
|
36
36
|
| `RPC_URL` | yes | Robinhood Chain RPC endpoint |
|
|
37
|
-
| `PRIVATE_KEY` |
|
|
37
|
+
| `PRIVATE_KEY` | one of | The agent wallet key, inline |
|
|
38
|
+
| `PRIVATE_KEY_FILE` | one of | Path to a file containing the key; preferred over inline |
|
|
38
39
|
| `EXPLORER_URL` | no | Explorer base URL for transaction links |
|
|
39
40
|
|
|
41
|
+
## Key handling
|
|
42
|
+
|
|
43
|
+
The key never leaves your machine. This server reads it locally, signs locally, and sends only signed transactions to the RPC; there is no backend and nothing is ever transmitted to anyone else. The AI agent can call the trading tools but can never read the key.
|
|
44
|
+
|
|
45
|
+
Prefer `PRIVATE_KEY_FILE` pointing at a `chmod 600` file over an inline `PRIVATE_KEY`, so the key does not sit inside an MCP config that cloud backups and dotfile syncs pick up:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
printf '%s' '0xYOUR_KEY' > ~/.logos-layer-key && chmod 600 ~/.logos-layer-key
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
"env": {
|
|
53
|
+
"VAULT_ADDRESS": "<your-vault-address>",
|
|
54
|
+
"RPC_URL": "https://rpc.testnet.chain.robinhood.com",
|
|
55
|
+
"PRIVATE_KEY_FILE": "~/.logos-layer-key"
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Note: use an absolute path; `~` is not expanded by all MCP clients.
|
|
60
|
+
|
|
40
61
|
## Safety
|
|
41
62
|
|
|
42
|
-
The agent wallet must be the vault owner to trade, so
|
|
63
|
+
Generate a FRESH burner wallet for the agent and fund it with faucet ETH only. The agent wallet must be the vault owner to trade, so deploy the vault with that same burner. Never use a key that holds real funds. Testnet instruments only; this is a research demo, not investment advice.
|
|
64
|
+
|
|
65
|
+
The version in the config is pinned; review the changelog before moving to a newer release.
|
|
43
66
|
|
|
44
67
|
This package ships as a compiled artifact.
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
+
import { readFileSync } from "fs";
|
|
4
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
6
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
7
|
import {
|
|
@@ -125,8 +126,24 @@ function firstViolation(m, prices, p, o) {
|
|
|
125
126
|
// src/index.ts
|
|
126
127
|
var VAULT = requireEnv("VAULT_ADDRESS");
|
|
127
128
|
var RPC_URL = requireEnv("RPC_URL");
|
|
128
|
-
var PRIVATE_KEY =
|
|
129
|
+
var PRIVATE_KEY = loadPrivateKey();
|
|
129
130
|
var EXPLORER_URL = process.env.EXPLORER_URL;
|
|
131
|
+
function loadPrivateKey() {
|
|
132
|
+
const file = process.env.PRIVATE_KEY_FILE;
|
|
133
|
+
if (file) {
|
|
134
|
+
try {
|
|
135
|
+
const raw = readFileSync(file, "utf8").trim();
|
|
136
|
+
if (raw) return raw;
|
|
137
|
+
console.error(`PRIVATE_KEY_FILE ${file} is empty`);
|
|
138
|
+
} catch (err) {
|
|
139
|
+
console.error(
|
|
140
|
+
`Cannot read PRIVATE_KEY_FILE ${file}: ${err instanceof Error ? err.message : String(err)}`
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
return requireEnv("PRIVATE_KEY");
|
|
146
|
+
}
|
|
130
147
|
function requireEnv(name) {
|
|
131
148
|
const v = process.env[name];
|
|
132
149
|
if (!v) {
|
|
@@ -232,7 +249,7 @@ function describeVerdict(state, asset, side, quantity) {
|
|
|
232
249
|
});
|
|
233
250
|
return { signedQty, verdict: v, ruleLines: lines.join("\n") };
|
|
234
251
|
}
|
|
235
|
-
var server = new McpServer({ name: "logos-layer", version: "0.1.
|
|
252
|
+
var server = new McpServer({ name: "logos-layer", version: "0.1.1" });
|
|
236
253
|
server.tool(
|
|
237
254
|
"get_portfolio",
|
|
238
255
|
"Read the vault's on-chain portfolio: cash, positions, prices, NAV, and the mandate thresholds that every trade must satisfy.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "logos-layer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Logos Layer: an MCP server that lets AI agents trade inside a mandate-guarded vault on Robinhood Chain. Compliant orders execute; violations revert on-chain.",
|
|
6
6
|
"license": "MIT",
|