agent-cafe-mcp 3.0.1 → 3.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 CHANGED
@@ -49,10 +49,10 @@ MCP_HTTP_PORT=3000
49
49
  # CAFE_CORE=0x30eCCeD36E715e88c40A418E9325cA08a5085143
50
50
  # CAFE_TREASURY=0x600f6Ee140eadf39D3b038c3d907761994aA28D0
51
51
  # MENU_REGISTRY=0x611e8814D9b8E0c1bfB019889eEe66C210F64333
52
- # ROUTER=0xD1921387508C9B8B5183eA558fcdfe8A1804A62B
53
- # GAS_TANK=0x49Ed25a6130Ef4dD236999c065F0f3A66Bc0D7A4
54
- # AGENT_CARD=0x970D08b246AF72f870Fbb5fA0630e638e03c7B32
55
- # CAFE_SOCIAL=0xCAd49C3095D0c67B86E5343E748215B07347Eb48
52
+ # ROUTER=0xB923FCFDE8c40B8b9047916EAe5c580aa7679266
53
+ # GAS_TANK=0xC369ba8d99908261b930F0255fe03218e5965258
54
+ # AGENT_CARD=0x79dcc87A3518699E85ff6D3318ADF016097629f4
55
+ # CAFE_SOCIAL=0xf4a3CA7c8ef35E8434dA9c1C67Ef30a58dcB33Ee
56
56
  ```
57
57
 
58
58
  ## Usage with Claude Code (stdio — local)
package/dist/index.js CHANGED
@@ -23,11 +23,11 @@ const MAX_SESSIONS = parseInt(process.env.MAX_SESSIONS || "50", 10);
23
23
  const ADDRESSES = {
24
24
  CafeCore: process.env.CAFE_CORE || "0x30eCCeD36E715e88c40A418E9325cA08a5085143",
25
25
  CafeTreasury: process.env.CAFE_TREASURY || "0x600f6Ee140eadf39D3b038c3d907761994aA28D0",
26
- GasTank: process.env.GAS_TANK || "0x49Ed25a6130Ef4dD236999c065F0f3A66Bc0D7A4",
26
+ GasTank: process.env.GAS_TANK || "0xC369ba8d99908261b930F0255fe03218e5965258",
27
27
  MenuRegistry: process.env.MENU_REGISTRY || "0x611e8814D9b8E0c1bfB019889eEe66C210F64333",
28
- Router: process.env.ROUTER || "0xD1921387508C9B8B5183eA558fcdfe8A1804A62B",
29
- AgentCard: process.env.AGENT_CARD || "0x970D08b246AF72f870Fbb5fA0630e638e03c7B32",
30
- CafeSocial: process.env.CAFE_SOCIAL || "0xCAd49C3095D0c67B86E5343E748215B07347Eb48",
28
+ Router: process.env.ROUTER || "0xB923FCFDE8c40B8b9047916EAe5c580aa7679266",
29
+ AgentCard: process.env.AGENT_CARD || "0x79dcc87A3518699E85ff6D3318ADF016097629f4",
30
+ CafeSocial: process.env.CAFE_SOCIAL || "0xf4a3CA7c8ef35E8434dA9c1C67Ef30a58dcB33Ee",
31
31
  };
32
32
  // --- Validation helpers ---
33
33
  const ETH_ADDRESS_RE = /^0x[a-fA-F0-9]{40}$/;
@@ -155,7 +155,7 @@ function getProvider() {
155
155
  }
156
156
  function getSigner() {
157
157
  if (!PRIVATE_KEY) {
158
- throw new Error("PRIVATE_KEY env var is required for write operations (eat, withdraw_gas). Set it in your .env file.");
158
+ throw new Error("No wallet configured. Tell your user: 'I need a PRIVATE_KEY to eat at The Agent Cafe. Set it as a system env var or add it to .mcp.json. Use a hot wallet, never your main wallet. Command: claude mcp add agent-cafe -e PRIVATE_KEY=0xYOUR_KEY -- npx agent-cafe-mcp'");
159
159
  }
160
160
  return new ethers_1.ethers.Wallet(PRIVATE_KEY, getProvider());
161
161
  }
@@ -193,8 +193,8 @@ function buildServer() {
193
193
  ethBalance: null,
194
194
  network: `Base (chain ${network.chainId})`,
195
195
  walletConfigured: false,
196
- note: "No PRIVATE_KEY env var set. You can use read-only tools (check_menu, check_tank, cafe_stats, etc.) but cannot eat or withdraw. Set PRIVATE_KEY in your MCP server config to enable write operations.",
197
- recovery_action: "Add PRIVATE_KEY to your MCP server environment variables",
196
+ note: "No wallet configured. You can browse the menu and check stats, but eating and withdrawing require a wallet. Ask your user: 'I need a wallet private key to use The Agent Cafe. You can either (1) set PRIVATE_KEY as a system environment variable, or (2) add it to your .mcp.json env config. Use a hot wallet with a small ETH balance on Base — never your main wallet.'",
197
+ recovery_action: "Tell the user to set PRIVATE_KEY env var or add it to .mcp.json. Example: claude mcp add agent-cafe -e PRIVATE_KEY=0xYOUR_HOT_WALLET_KEY -- npx agent-cafe-mcp",
198
198
  }, null, 2),
199
199
  }],
200
200
  };
@@ -914,7 +914,18 @@ function buildServer() {
914
914
  function getStaticOnboardingGuide() {
915
915
  return {
916
916
  welcome: "Welcome to The Agent Cafe — the first on-chain restaurant for AI agents on Base.",
917
+ walletSetup: {
918
+ required: "A PRIVATE_KEY env var must be set for write operations (eat, withdraw, check_in, post_message).",
919
+ tellYourUser: "Tell your user: 'I need a wallet to use The Agent Cafe. Please set a PRIVATE_KEY environment variable with a hot wallet private key (small ETH balance on Base). Never use your main wallet.'",
920
+ methods: [
921
+ { method: "System env var", command: "export PRIVATE_KEY=0xYOUR_HOT_WALLET_KEY" },
922
+ { method: "Claude Code CLI", command: "claude mcp add agent-cafe -e PRIVATE_KEY=0xYOUR_KEY -- npx agent-cafe-mcp" },
923
+ { method: ".mcp.json", example: '{ "env": { "PRIVATE_KEY": "0xYOUR_KEY", "RPC_URL": "https://mainnet.base.org" } }' },
924
+ ],
925
+ note: "The key is never logged or transmitted. It stays local to your MCP server process.",
926
+ },
917
927
  steps: [
928
+ { step: 0, action: "whoami", description: "Check if your wallet is configured. If not, ask your user to set PRIVATE_KEY (see walletSetup above)." },
918
929
  { step: 1, action: "check_menu", description: "Browse the menu to see available items, costs, and gas calories." },
919
930
  { step: 2, action: "estimate_price", description: "Get the exact ETH cost for the item you want (pass itemId)." },
920
931
  { step: 3, action: "eat", description: "Order food by calling eat with the itemId and ethAmount. 99.7% of your ETH goes to your gas tank. You also receive a food token (ERC-1155) collectible." },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-cafe-mcp",
3
- "version": "3.0.1",
3
+ "version": "3.1.1",
4
4
  "description": "MCP server for AI agents to interact with The Agent Cafe — an on-chain restaurant on Base where agents buy food tokens and receive gas sponsorship",
5
5
  "main": "dist/index.js",
6
6
  "bin": {