taru-mcp 0.1.3 → 0.1.5

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
@@ -4,55 +4,88 @@ MCP server for [taru](https://taru.arupa.io) — connect Claude Code or Codex to
4
4
 
5
5
  Zero dependencies. Pure Node.js. Works with any MCP client.
6
6
 
7
- ## Install
7
+ ## Quick Setup
8
8
 
9
- ### Claude Code
9
+ ### macOS / Linux
10
10
 
11
11
  ```bash
12
- # 1. Install the package
13
- npm install taru-mcp
12
+ curl -fsSL https://raw.githubusercontent.com/arupa-inc/taru-mcp/main/setup.sh | bash
13
+ ```
14
14
 
15
- # 2. Register MCP server
16
- claude mcp add taru -- npx taru-mcp --token xxv_your_token
15
+ ### Windows (PowerShell)
17
16
 
18
- # 3. Copy agent instructions to your project
19
- cp node_modules/taru-mcp/samples/CLAUDE.md ./CLAUDE.md
17
+ ```powershell
18
+ irm https://raw.githubusercontent.com/arupa-inc/taru-mcp/main/setup.ps1 | iex
20
19
  ```
21
20
 
22
- ### Codex (OpenAI)
21
+ The script will ask you:
22
+ 1. **Project folder name** — creates the workspace directory
23
+ 2. **AI client** — Claude Code, Codex, or both
24
+ 3. **Workspace token** — taru workspace token (`xxv_...`). Can be entered later if you don't have it yet.
25
+
26
+ It handles `npm init`, `taru-mcp` installation, agent file (`CLAUDE.md` / `AGENTS.md`) setup, and MCP registration automatically.
27
+
28
+ Get your workspace token from the taru web console: **Settings > API Key**.
29
+
30
+ ## Manual Setup
31
+
32
+ If the setup script doesn't work, follow these steps:
33
+
34
+ ### 1. Install
23
35
 
24
36
  ```bash
25
- # 1. Install the package
37
+ mkdir my-project && cd my-project
38
+ npm init -y
26
39
  npm install taru-mcp
40
+ ```
27
41
 
28
- # 2. Register MCP server
29
- codex mcp add taru -- npx taru-mcp --token xxv_your_token
42
+ ### 2. Copy agent instructions
30
43
 
31
- # 3. Copy agent instructions to your project
44
+ ```bash
45
+ # For Claude Code
46
+ cp node_modules/taru-mcp/samples/CLAUDE.md ./CLAUDE.md
47
+
48
+ # For Codex
32
49
  cp node_modules/taru-mcp/samples/AGENTS.md ./AGENTS.md
33
50
  ```
34
51
 
35
- ### Agent instructions
36
-
37
- The `samples/` directory contains ready-to-use instruction files:
52
+ ### 3. Register MCP server
38
53
 
39
- | File | For | Description |
40
- |------|-----|-------------|
41
- | `samples/CLAUDE.md` | Claude Code | Drop into your project root |
42
- | `samples/AGENTS.md` | Codex | Drop into your project root |
54
+ ```bash
55
+ # Claude Code
56
+ claude mcp add taru -- npx taru-mcp --url https://taru-api.arupa.io --token xxv_your_token
43
57
 
44
- These files teach the AI how to use taru tools, classify documents vs opinions, handle conflicts, and set confidence scores. **Copy the appropriate file to your project root** after installing.
58
+ # Codex
59
+ codex mcp add taru -- npx taru-mcp --url https://taru-api.arupa.io --token xxv_your_token
60
+ ```
45
61
 
46
- > **No package.json?** You can also copy the CLAUDE.md / AGENTS.md content directly from the [setup guide](https://taru.arupa.io/docs/setup).
62
+ ### 4. Or configure MCP manually
47
63
 
48
- ## Options
64
+ If `claude mcp add` doesn't work, create `.mcp.json` in your project root:
49
65
 
50
- | Flag | Env | Default | Description |
51
- |------|-----|---------|-------------|
52
- | `--workspace-id`, `-w` | `TARU_WORKSPACE_ID` | `00000000-...0001` | Workspace UUID |
53
- | `--token`, `-t` | `TARU_API_TOKEN` | — | API token (`xxv_...`) |
66
+ ```json
67
+ {
68
+ "mcpServers": {
69
+ "taru": {
70
+ "command": "npx",
71
+ "args": ["taru-mcp", "--url", "https://taru-api.arupa.io", "--token", "xxv_your_token"]
72
+ }
73
+ }
74
+ }
75
+ ```
54
76
 
55
- Get your API token from the taru web console: **Workspaces → Members → API Key**.
77
+ For Claude Code global config (`~/.claude.json`):
78
+
79
+ ```json
80
+ {
81
+ "mcpServers": {
82
+ "taru": {
83
+ "command": "npx",
84
+ "args": ["taru-mcp", "--url", "https://taru-api.arupa.io", "--token", "xxv_your_token"]
85
+ }
86
+ }
87
+ }
88
+ ```
56
89
 
57
90
  ## Tools
58
91
 
@@ -65,8 +98,6 @@ Once connected, these MCP tools are available to the AI:
65
98
  | `store_document` | Store a document or opinion with auto-conflict detection |
66
99
  | `list_documents` | List all documents in the workspace |
67
100
  | `list_conflicts` | View pending knowledge conflicts |
68
- | `web_search` | Search the web via DuckDuckGo |
69
- | `web_fetch` | Fetch and extract text from a URL |
70
101
  | `rebalance` | Merge similar keywords, clean up orphan nodes |
71
102
 
72
103
  ## How it works
package/bin/taru-mcp.mjs CHANGED
@@ -39,7 +39,9 @@ Examples:
39
39
  }
40
40
 
41
41
  url = url.replace(/\/+$/, "");
42
- const endpoint = `${url}/mcp/${workspaceId}`;
42
+ // If workspace ID was explicitly provided, use the scoped endpoint; otherwise use token-based auto endpoint
43
+ const hasExplicitWorkspace = args.some(a => a === "--workspace-id" || a === "-w") || env.TARU_WORKSPACE_ID;
44
+ const endpoint = hasExplicitWorkspace ? `${url}/mcp/${workspaceId}` : `${url}/mcp`;
43
45
  const isHttps = endpoint.startsWith("https://");
44
46
 
45
47
  stderr.write(`[taru-mcp] endpoint: ${endpoint}\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taru-mcp",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "MCP server for taru knowledge graph — connect Claude Code or Codex to your team's shared brain",
5
5
  "bin": {
6
6
  "taru-mcp": "./bin/taru-mcp.mjs"
@@ -9,6 +9,7 @@
9
9
  "files": [
10
10
  "bin/",
11
11
  "samples/",
12
+ "setup.sh",
12
13
  "README.md"
13
14
  ],
14
15
  "keywords": [
@@ -21,7 +22,7 @@
21
22
  ],
22
23
  "repository": {
23
24
  "type": "git",
24
- "url": "https://github.com/carl/taru-mcp"
25
+ "url": "https://github.com/arupa-inc/taru-mcp"
25
26
  },
26
27
  "license": "MIT",
27
28
  "engines": {
package/samples/AGENTS.md CHANGED
@@ -9,8 +9,6 @@ You have access to the taru MCP server — a research knowledge graph with tempo
9
9
  - store_document: Store extracted knowledge (handles embedding + graph)
10
10
  - list_documents: List all documents with status and confidence
11
11
  - list_conflicts: View pending knowledge conflicts
12
- - web_search: Search the web (DuckDuckGo)
13
- - web_fetch: Fetch text content from a URL
14
12
  - rebalance: Clean up the knowledge graph (merge keywords, remove orphans)
15
13
 
16
14
  ### Rules
package/samples/CLAUDE.md CHANGED
@@ -9,8 +9,6 @@ You have access to the taru MCP server — a research knowledge graph with tempo
9
9
  - store_document: Store extracted knowledge (handles embedding + graph)
10
10
  - list_documents: List all documents with status and confidence
11
11
  - list_conflicts: View pending knowledge conflicts
12
- - web_search: Search the web (DuckDuckGo)
13
- - web_fetch: Fetch text content from a URL
14
12
  - rebalance: Clean up the knowledge graph (merge keywords, remove orphans)
15
13
 
16
14
  ### Rules
package/setup.sh ADDED
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # taru MCP setup script
5
+ # Usage:
6
+ # curl -fsSL https://raw.githubusercontent.com/arupa-inc/taru-mcp/main/setup.sh | bash
7
+
8
+ URL="https://taru-api.arupa.io"
9
+
10
+ echo ""
11
+ echo " 🌳 taru MCP Setup"
12
+ echo ""
13
+
14
+ # 1. Ask project folder name
15
+ read -rp "Project folder name: " FOLDER </dev/tty
16
+ if [ -z "$FOLDER" ]; then
17
+ echo "Error: folder name is required"
18
+ exit 1
19
+ fi
20
+
21
+ if [ -d "$FOLDER" ]; then
22
+ echo "==> Directory '$FOLDER' already exists, using it."
23
+ else
24
+ mkdir -p "$FOLDER"
25
+ echo "==> Created '$FOLDER'"
26
+ fi
27
+ cd "$FOLDER"
28
+
29
+ # 2. Ask client type
30
+ echo ""
31
+ echo "Which AI client do you use?"
32
+ echo " 1) Claude Code"
33
+ echo " 2) Codex"
34
+ echo " 3) Not sure (copies both CLAUDE.md and AGENTS.md)"
35
+ echo ""
36
+ read -rp "Choose [1/2/3]: " CLIENT_CHOICE </dev/tty
37
+
38
+ case "$CLIENT_CHOICE" in
39
+ 1) CLIENT="claude" ;;
40
+ 2) CLIENT="codex" ;;
41
+ *) CLIENT="both" ;;
42
+ esac
43
+
44
+ # 3. Ask token (skippable)
45
+ echo ""
46
+ read -rp "Workspace token (xxv_..., press Enter to add later): " TOKEN </dev/tty
47
+
48
+ # Check npm
49
+ if ! command -v npm &>/dev/null; then
50
+ echo "Error: 'npm' not found. Install Node.js first."
51
+ exit 1
52
+ fi
53
+
54
+ # Init & install
55
+ if [ ! -f "package.json" ]; then
56
+ echo "==> Initializing package.json..."
57
+ npm init -y --silent > /dev/null 2>&1
58
+ fi
59
+
60
+ echo "==> Installing taru-mcp..."
61
+ npm install taru-mcp --silent
62
+
63
+ # Copy agent files
64
+ copy_agent_file() {
65
+ local file="$1"
66
+ if [ -f "$file" ]; then
67
+ echo "==> $file already exists, appending taru instructions..."
68
+ echo "" >> "$file"
69
+ cat "node_modules/taru-mcp/samples/$file" >> "$file"
70
+ else
71
+ cp "node_modules/taru-mcp/samples/$file" "./$file"
72
+ echo "==> Created $file"
73
+ fi
74
+ }
75
+
76
+ if [ "$CLIENT" = "claude" ]; then
77
+ copy_agent_file "CLAUDE.md"
78
+ elif [ "$CLIENT" = "codex" ]; then
79
+ copy_agent_file "AGENTS.md"
80
+ else
81
+ copy_agent_file "CLAUDE.md"
82
+ copy_agent_file "AGENTS.md"
83
+ fi
84
+
85
+ # Register MCP server
86
+ register_mcp() {
87
+ local cli="$1"
88
+ local token_args=""
89
+ if [ -n "$TOKEN" ]; then
90
+ token_args=" --token $TOKEN"
91
+ fi
92
+
93
+ if command -v "$cli" &>/dev/null; then
94
+ echo "==> Registering MCP server with $cli..."
95
+ $cli mcp add taru -- npx taru-mcp --url "$URL"$token_args
96
+ else
97
+ echo "==> '$cli' not found, skipping MCP registration."
98
+ echo " Run this later: $cli mcp add taru -- npx taru-mcp --url $URL$token_args"
99
+ fi
100
+ }
101
+
102
+ if [ "$CLIENT" = "claude" ]; then
103
+ register_mcp "claude"
104
+ elif [ "$CLIENT" = "codex" ]; then
105
+ register_mcp "codex"
106
+ else
107
+ register_mcp "claude"
108
+ register_mcp "codex"
109
+ fi
110
+
111
+ echo ""
112
+ echo " ✅ Setup complete!"
113
+ echo ""
114
+ echo " Project: $(pwd)"
115
+ [ "$CLIENT" = "claude" ] || [ "$CLIENT" = "both" ] && echo " Agent file: ./CLAUDE.md"
116
+ [ "$CLIENT" = "codex" ] || [ "$CLIENT" = "both" ] && echo " Agent file: ./AGENTS.md"
117
+ [ -n "$TOKEN" ] && echo " Token: configured" || echo " Token: not set yet (add via settings)"
118
+ echo ""
119
+ echo " Open this folder in your AI client to start growing the tree."
120
+ echo ""