felix-mcp 2.0.133 → 2.0.136

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.
@@ -59,11 +59,21 @@ signal to fetch a fresh REST snapshot before making a stateful decision.
59
59
 
60
60
  ## Browser example
61
61
 
62
+ Never put a Felix API key in browser code. Your own backend asks Felix for a
63
+ short-lived stream ticket with the key, and the browser only ever sees the
64
+ ticket.
65
+
62
66
  ~~~javascript
63
- const ticket = await fetch("https://api.felix.trade/v1/stream/tickets", {
64
- method: "POST",
65
- headers: { Authorization: \`Bearer \${apiKey}\` },
66
- }).then((response) => response.json());
67
+ // On your server (Node), where the key lives:
68
+ // const ticket = await fetch("https://api.felix.trade/v1/stream/tickets", {
69
+ // method: "POST",
70
+ // headers: { Authorization: \`Bearer \${process.env.FELIX_API_KEY}\` },
71
+ // }).then((response) => response.json());
72
+ // return ticket to your signed-in user.
73
+
74
+ // In the browser: ask your own backend, never Felix directly.
75
+ const ticket = await fetch("/api/felix-stream-ticket", { method: "POST" })
76
+ .then((response) => response.json());
67
77
 
68
78
  const socket = new WebSocket(ticket.websocket_url, ticket.protocol);
69
79
  socket.onopen = () => socket.send(JSON.stringify({
@@ -3,11 +3,12 @@ import { chmodSync, constants as fsConstants, existsSync, fstatSync, lstatSync,
3
3
  import { homedir } from "node:os";
4
4
  import { dirname, join } from "node:path";
5
5
  import { privateKeyToAccount } from "viem/accounts";
6
+ import { hasPrivateMode, openReadNoFollow } from "./credential-store.js";
6
7
  const PRIVATE_KEY_RE = /^0x[0-9a-f]{64}$/i;
7
8
  function assertPrivateOwnedDirectory(path) {
8
9
  const status = lstatSync(path);
9
10
  if (!status.isDirectory() || status.isSymbolicLink()
10
- || (status.mode & 0o077) !== 0
11
+ || !hasPrivateMode(status.mode)
11
12
  || (typeof process.geteuid === "function" && status.uid !== process.geteuid())) {
12
13
  throw new Error("The Felix local state directory is not private.");
13
14
  }
@@ -22,13 +23,13 @@ function ensurePrivateWorkflowIdentityDirectory(directory) {
22
23
  function isPrivateOwnedFile(path) {
23
24
  let descriptor;
24
25
  try {
25
- descriptor = openSync(path, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW);
26
+ descriptor = openReadNoFollow(path);
26
27
  const status = fstatSync(descriptor);
27
28
  return status.isFile()
28
29
  && !status.isSymbolicLink()
29
30
  && status.size > 0
30
31
  && status.size <= 4096
31
- && (status.mode & 0o077) === 0
32
+ && hasPrivateMode(status.mode)
32
33
  && (typeof process.geteuid !== "function" || status.uid === process.geteuid());
33
34
  }
34
35
  catch {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "felix-mcp",
3
- "version": "2.0.133",
3
+ "version": "2.0.136",
4
4
  "mcpName": "trade.felix/mcp",
5
- "description": "Non-custodial trading infrastructure for AI agents: one wallet, one risk policy, every market.",
5
+ "description": "Agentic trading infrastructure for everyone: crypto perpetuals, prediction markets and options for AI agents.",
6
6
  "homepage": "https://felix.trade/docs",
7
7
  "author": {
8
8
  "name": "Felix Trade",
@@ -134,7 +134,10 @@
134
134
  "agentic-trading",
135
135
  "non-custodial",
136
136
  "options",
137
+ "perpetuals",
137
138
  "prediction-markets",
139
+ "agent-broker",
140
+ "mcp-server",
138
141
  "crypto",
139
142
  "stocks",
140
143
  "ai-agents",
@@ -6,9 +6,17 @@
6
6
  log_user 0
7
7
  set timeout 15
8
8
 
9
- if {$argc != 3} {
9
+ if {$argc != 3 && $argc != 4} {
10
10
  exit 64
11
11
  }
12
+ # Optional 4th argument "create-only": never replace an existing item (owner keys use this).
13
+ set update_flag "-U"
14
+ if {$argc == 4} {
15
+ if {[lindex $argv 3] ne "create-only"} {
16
+ exit 64
17
+ }
18
+ set update_flag ""
19
+ }
12
20
 
13
21
  set account [lindex $argv 0]
14
22
  set service [lindex $argv 1]
@@ -19,9 +27,15 @@ if {[string length $secret] < 1 || [string length $secret] > 4096} {
19
27
  exit 65
20
28
  }
21
29
 
30
+ if {$update_flag eq ""} {
31
+ spawn -noecho /usr/bin/security add-generic-password \
32
+ -a $account -s $service -l $label \
33
+ -j {Felix encrypted local credential; never disclose to an AI agent.} -w
34
+ } else {
22
35
  spawn -noecho /usr/bin/security add-generic-password -U \
23
36
  -a $account -s $service -l $label \
24
37
  -j {Felix encrypted local credential; never disclose to an AI agent.} -w
38
+ }
25
39
 
26
40
  set sent 0
27
41
  expect {
package/server.json CHANGED
@@ -2,8 +2,8 @@
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
3
  "name": "trade.felix/mcp",
4
4
  "title": "Felix MCP",
5
- "description": "Non-custodial trading infrastructure for AI agents across prediction markets, crypto, and options.",
6
- "version": "2.0.133",
5
+ "description": "Agentic trading infrastructure for everyone: crypto perpetuals, prediction markets and options.",
6
+ "version": "2.0.136",
7
7
  "websiteUrl": "https://felix.trade/docs",
8
8
  "icons": [
9
9
  {
@@ -25,7 +25,7 @@
25
25
  {
26
26
  "registryType": "npm",
27
27
  "identifier": "felix-mcp",
28
- "version": "2.0.133",
28
+ "version": "2.0.136",
29
29
  "transport": {
30
30
  "type": "stdio"
31
31
  }