@gotza02/mathinking 3.1.1 → 3.1.3

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.
Files changed (2) hide show
  1. package/README.md +97 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -58,12 +58,39 @@ npx -y @gotza02/mathinking
58
58
 
59
59
  ## ⚙️ Configuration
60
60
 
61
+ ### Environment Variables
62
+
61
63
  Set these environment variables to enable enhanced search capabilities:
62
64
 
63
- | Variable | Description |
64
- |----------|-------------|
65
- | `BRAVE_SEARCH_API_KEY` | For Brave Search |
66
- | `EXA_API_KEY` | For Exa.ai Search |
65
+ | Variable | Required | Description |
66
+ |----------|----------|-------------|
67
+ | `BRAVE_SEARCH_API_KEY` | Optional | For Brave Search (Recommended - Fast & Free tier) |
68
+ | `EXA_API_KEY` | Optional | For Exa.ai Search (AI-Native Search) |
69
+ | `GOOGLE_SEARCH_API_KEY` | Optional | Google Custom Search JSON API |
70
+ | `GOOGLE_SEARCH_CX` | Optional | Google Custom Search Engine ID |
71
+
72
+ **Note:** At least one search provider API key is required for `web_search` to function. The system will try providers in this priority order:
73
+ 1. Brave Search → 2. Exa.ai → 3. Google → 4. Return "Configuration Required" message
74
+
75
+ ### Quick Setup (~/.bashrc)
76
+
77
+ Add these lines to your `~/.bashrc`:
78
+
79
+ ```bash
80
+ # Brave Search (Recommended - Get free key at https://api.search.brave.com/app/keys)
81
+ export BRAVE_SEARCH_API_KEY="your_brave_key_here"
82
+
83
+ # Exa.ai Search (Get key at https://exa.ai)
84
+ export EXA_API_KEY="your_exa_key_here"
85
+
86
+ # Google Custom Search (Get key at https://console.cloud.google.com/apis/credentials)
87
+ export GOOGLE_SEARCH_API_KEY="your_google_key_here"
88
+ export GOOGLE_SEARCH_CX="your_search_engine_id"
89
+ ```
90
+
91
+ Then reload: `source ~/.bashrc`
92
+
93
+ ---
67
94
 
68
95
  ### 1. Gemini CLI
69
96
  Add to your `~/.gemini/settings.json`:
@@ -103,6 +130,59 @@ Add to your `claude_desktop_config.json`:
103
130
 
104
131
  ---
105
132
 
133
+ ## 🔍 Web Search Configuration
134
+
135
+ The `web_search` tool is **automatically registered** and available in `mathinking_body`. However, it requires at least one of the following API keys to function:
136
+
137
+ ### Provider Priority (Fallback Chain)
138
+
139
+ 1. **Brave Search** (Recommended - Fast & Reliable)
140
+ - Set `BRAVE_SEARCH_API_KEY`
141
+ - Get your key at: https://api.search.brave.com/app/keys
142
+ - Free tier available
143
+
144
+ 2. **Exa.ai** (AI-Native Search)
145
+ - Set `EXA_API_KEY`
146
+ - Get your key at: https://exa.ai
147
+ - Excellent for semantic searches
148
+
149
+ 3. **Google Custom Search** (Legacy)
150
+ - Set both `GOOGLE_SEARCH_API_KEY` and `GOOGLE_SEARCH_CX`
151
+ - Get API key at: https://console.cloud.google.com/apis/credentials
152
+ - Create Custom Search Engine at: https://programmablesearchengine.google.com
153
+
154
+ ### Behavior Without API Keys
155
+
156
+ If no API keys are configured, `web_search` will return:
157
+ ```json
158
+ {
159
+ "query": "your search query",
160
+ "source": "System",
161
+ "results": [{
162
+ "title": "Configuration Required",
163
+ "snippet": "Web search requires API keys. Configure BRAVE_SEARCH_API_KEY, EXA_API_KEY, or GOOGLE_SEARCH_API_KEY.",
164
+ "url": "https://github.com/gotza02/mathinking#configuration"
165
+ }]
166
+ }
167
+ ```
168
+
169
+ ### Usage Example
170
+
171
+ ```json
172
+ {
173
+ "id": "search_task",
174
+ "name": "Search for latest news",
175
+ "toolName": "web_search",
176
+ "toolInput": {
177
+ "query": "TypeScript latest features",
178
+ "numResults": 5,
179
+ "freshness": "week"
180
+ }
181
+ }
182
+ ```
183
+
184
+ ---
185
+
106
186
  ## 🤖 การตั้งค่าสำหรับ Claude และ Gemini (Memory/Instructions)
107
187
 
108
188
  เพื่อให้ AI เข้าใจการใช้งาน Mathinking ได้อย่างมีประสิทธิภาพสูงสุด ควรตั้งค่าใน **Custom Instructions** (Claude) หรือ **System Instruction** (Gemini) ดังนี้:
@@ -161,7 +241,19 @@ You can define tasks that only run if a certain condition is met:
161
241
 
162
242
  **Full changelog available in [CHANGELOG.md](CHANGELOG.md)**
163
243
 
164
- ### v3.1.1 (Latest) - 🐛 Bug Fixes
244
+ ### v3.1.3 (Latest) - 📝 Documentation
245
+ - **Added:** Comprehensive "Environment Variables" table with all search provider keys
246
+ - **Added:** "Quick Setup (~/.bashrc)" section with copy-paste ready examples
247
+ - **Clarified:** At least one API key is required for web_search to function
248
+ - **Improved:** Distinguished between global setup (~/.bashrc) and MCP-specific config
249
+
250
+ ### v3.1.2 - 📝 Documentation
251
+ - **Added:** Comprehensive web_search configuration section with provider details
252
+ - **Clarified:** web_search tool registration status and API key requirements
253
+ - **Added:** Provider priority fallback chain documentation (Brave > Exa > Google)
254
+ - **Added:** Usage examples for web_search tool
255
+
256
+ ### v3.1.1 - 🐛 Bug Fixes
165
257
  - **Critical:** Fixed array mutation bug in `evaluateOptions`
166
258
  - **Critical:** Fixed empty array access with validation
167
259
  - **High:** Fixed unsafe type casting with `Array.isArray()` check
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gotza02/mathinking",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "description": "MCP Server with sequential thinking (The Brain) and orchestrator (The Body) capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",