Nymbo commited on
Commit
2add32c
·
verified ·
1 Parent(s): e2ab7ba

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +203 -1
README.md CHANGED
@@ -11,4 +11,206 @@ license: apache-2.0
11
  short_description: All-in-one hub of general purpose tools useful for any agent
12
  ---
13
 
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  short_description: All-in-one hub of general purpose tools useful for any agent
12
  ---
13
 
14
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
15
+
16
+ ## Nymbo-Tools MCP Server
17
+
18
+ All-in-one hub of general-purpose tools useful for any agent. Run it as a Gradio web app, or connect to it remotely as a Model Context Protocol (MCP) server to call its tools programmatically.
19
+
20
+ Live Space: https://huggingface.co/spaces/Nymbo/Tools
21
+
22
+ ### What’s inside
23
+
24
+ - Web Fetch: Turn any webpage into clean Markdown with optional link-only scraping, CSS selector stripping, length limits, and pagination via cursor offset.
25
+ - Web Search: DuckDuckGo-backed search across text, news, images, videos, and books with readable, paginated output.
26
+ - Code Interpreter: Execute small Python snippets and capture stdout.
27
+ - Memory Manager: Lightweight JSON-based memory store with save/list/search/delete and tag filters.
28
+ - Generate Speech: Kokoro‑82M TTS with 54 voices and adjustable speed (CPU or CUDA if available).
29
+ - Generate Image: Text-to-image via Hugging Face serverless inference (choose model, steps, CFG, size, seed).
30
+ - Generate Video: Text-to-video via Hugging Face serverless inference (model, steps, guidance, size, fps, duration, seed).
31
+ - Deep Research: Multi-query web research pipeline (DDG search + parallel fetch + LLM report synthesis) with downloadable report.
32
+ - File System: Safe, sandboxed filesystem operations under a tool root.
33
+ - Shell Exec: Run shell commands inside the same safe root as File System.
34
+
35
+ ## Quick start
36
+
37
+ Run the following commands in sequence to run the server locally:
38
+
39
+ ```shell
40
+ git clone https://huggingface.co/spaces/Nymbo/Tools
41
+ cd Tools
42
+ python -m venv env
43
+ source env/bin/activate
44
+ pip install -r requirements.txt
45
+ python app.py
46
+ ```
47
+
48
+ Defaults:
49
+ - The Gradio UI typically serves on http://127.0.0.1:7860
50
+ - The MCP endpoint is available at http://127.0.0.1:7860/gradio_api/mcp/
51
+
52
+ ## Using it as an MCP server
53
+
54
+ Remote MCP (hosted):
55
+ - Base URL: https://mcp.nymbo.net/gradio_api/mcp/
56
+ - SSE endpoint (for clients that need it): https://mcp.nymbo.net/gradio_api/mcp/sse
57
+
58
+ Local MCP (when you run app.py):
59
+ - Base URL: http://127.0.0.1:7860/gradio_api/mcp/
60
+ - SSE endpoint: http://127.0.0.1:7860/gradio_api/mcp/sse
61
+
62
+ Example client config (JSON):
63
+
64
+ ```json
65
+ {
66
+ "mcpServers": {
67
+ "nymbo-tools": {
68
+ "url": "https://mcp.nymbo.net/gradio_api/mcp/"
69
+ }
70
+ }
71
+ }
72
+ ```
73
+
74
+ ## Environment variables (optional but recommended)
75
+
76
+ - HF_READ_TOKEN: Enables Image Generation, Video Generation, and Deep Research (Hugging Face serverless inference). Required for those tools to appear as MCP tools.
77
+ - HF_TOKEN: Alternative token fallback used by some providers (also enables Deep Research/Video).
78
+ - NYMBO_TOOLS_ROOT: Overrides the File System/Shell working root. Defaults to Nymbo-Tools/Filesystem.
79
+ - UNSAFE_ALLOW_ABS_PATHS=1: Allow absolute paths in File System and Shell Exec (off by default for safety).
80
+
81
+ Notes:
82
+ - Without a HF API key, you can still use Web Fetch, Web Search, Code Interpreter, Memory Manager, File System, Shell Exec, and Generate Speech.
83
+ - Generate Speech requires the kokoro package and its dependencies; it works on CPU and uses CUDA if available. Doesn't require an API key because it's computed on the server itself.
84
+
85
+ ## Persistence and privacy
86
+
87
+ - Memory Manager stores entries in `memories.json` at the Nymbo-Tools folder root when running locally.
88
+ - File System defaults to the `Filesystem/` directory under Nymbo-Tools.
89
+ - In the public demo Space, storage is ephemeral and visible to anyone using the Space; avoid personal or sensitive data.
90
+
91
+ ## Tool reference (signatures and behavior)
92
+
93
+ Below are the MCP tool parameters summarized by inputs, outputs, and notable behaviors.
94
+
95
+ ### Web_Fetch (Webpages, converted to Markdown)
96
+ Inputs:
97
+ - url (str): Absolute URL to fetch (must return HTML).
98
+ - max_chars (int, default 3000): 0 = full page; otherwise truncates with a next_cursor notice.
99
+ - strip_selectors (str): Comma-separated CSS selectors to remove (e.g., .header, .footer, nav).
100
+ - url_scraper (bool): If true, return only a list of links from the page.
101
+ - offset (int): Character offset for pagination; pass the previous next_cursor to continue.
102
+
103
+ Output: Markdown string. If truncated, includes a next_cursor to continue.
104
+
105
+ ### Web_Search (DuckDuckGo backend)
106
+ Inputs:
107
+ - query (str): DuckDuckGo query (supports site:, quotes, OR).
108
+ - max_results (int 1–20, default 5)
109
+ - page (int, default 1) or offset (int) for precise continuation
110
+ - search_type (str): "text" | "news" | "images" | "videos" | "books"
111
+
112
+ Output: Readable text with pagination hints and next_offset.
113
+
114
+ ### Code_Interpreter (Python)
115
+ Inputs:
116
+ - code (str): Python source; stdout is captured.
117
+
118
+ Output: Captured stdout or the exception text.
119
+
120
+ ### Memory_Manager (Simple JSON store)
121
+ Inputs:
122
+ - action: "save" | "list" | "search" | "delete"
123
+ - text (save only), tags (save only)
124
+ - query (search only): supports tag:name terms and AND/OR
125
+ - limit (list/search): default 20
126
+ - memory_id (delete): full UUID or unique prefix
127
+ - include_tags (bool): include tags when listing/searching
128
+
129
+ Output: Confirmation string, listing, search matches, or structured error text.
130
+
131
+ ### Generate_Speech (Kokoro-82M)
132
+ Inputs:
133
+ - text (str)
134
+ - speed (float 0.5–2.0, default 1.25)
135
+ - voice (str): One of 54 voices (e.g., af_heart, am_liam, bf_alice, zf_xiaoyi…)
136
+
137
+ Output: (sample_rate:int, waveform:np.ndarray) – rendered as downloadable WAV in the UI.
138
+
139
+ ### Generate_Image (HF inference)
140
+ Requires: HF_READ_TOKEN
141
+
142
+ Inputs:
143
+ - prompt (str)
144
+ - model_id (str): e.g., black-forest-labs/FLUX.1-Krea-dev
145
+ - negative_prompt (str)
146
+ - steps (1–100), cfg_scale (1–20), sampler (UI label), seed (-1=random), width/height
147
+
148
+ Output: PIL.Image. In UI, displayed and downloadable. Errors guide you to provide a token or fix model id.
149
+
150
+ ### Generate_Video (HF inference)
151
+ Requires: HF_READ_TOKEN or HF_TOKEN
152
+
153
+ Inputs:
154
+ - prompt (str)
155
+ - model_id (str): default Wan-AI/Wan2.2-T2V-A14B
156
+ - negative_prompt (str)
157
+ - steps (1–100), cfg_scale, seed, width/height, fps, duration (s)
158
+
159
+ Output: Temporary MP4 file path; UI shows a playable/downloadable video.
160
+
161
+ ### Deep_Research (HF inference)
162
+ Requires: HF_READ_TOKEN or HF_TOKEN
163
+
164
+ Inputs:
165
+ - summary (str): One or more sentences describing the research task.
166
+ - query1..query5 (str) with max1..max5 (1–50). Total requested results across queries are capped at 50.
167
+
168
+ Behavior:
169
+ - Parallel DDG searches → fetch pages in budget → filter candidate sources with an LLM → synthesize a long, well-structured Markdown report and list of sources.
170
+
171
+ Output: (report_md, fetched_links_text, report_file_path)
172
+
173
+ ### File_System (safe root)
174
+ Root:
175
+ - Defaults to `Nymbo-Tools/Filesystem` (or NYMBO_TOOLS_ROOT). Absolute paths disabled unless UNSAFE_ALLOW_ABS_PATHS=1.
176
+
177
+ Actions:
178
+ - list, read, write, append, mkdir, move, copy, delete, info, help
179
+
180
+ Key fields:
181
+ - path, content (write/append), dest_path (move/copy), recursive, show_hidden, max_entries, offset, max_chars, create_dirs, overwrite
182
+
183
+ Output:
184
+ - Human-readable listings or JSON-like error strings with code/message/hint.
185
+
186
+ ### Shell_Exec (same safe root)
187
+ Inputs:
188
+ - command (str): Single-string shell command (pipelines supported by the host shell).
189
+ - workdir (str): Relative to the root.
190
+ - timeout (s)
191
+
192
+ Output:
193
+ - Combined header + STDOUT/STDERR. Absolute paths disabled by default. Shell is detected automatically (PowerShell on Windows when available; bash/sh on POSIX).
194
+
195
+ ## Running on Hugging Face Spaces
196
+
197
+ 1) Duplicate the Space at https://huggingface.co/spaces/Nymbo/Tools.
198
+ 2) In Space Settings → Secrets, add HF_READ_TOKEN (and/or HF_TOKEN) for model access.
199
+ 3) The UI will show all tools; as an MCP server, only authenticated tools are exposed (to keep tool lists tidy).
200
+
201
+ ## Troubleshooting
202
+
203
+ - Image/Video/Deep Research tools hidden as MCP tools:
204
+ - Provide HF_READ_TOKEN (and optionally HF_TOKEN). Restart the app/Space.
205
+ - 401/403 when calling generation tools:
206
+ - Token missing/insufficient permissions. Ensure your token can read the chosen model.
207
+ - Kokoro not found:
208
+ - Install kokoro>=0.9.4. CPU works; CUDA used if available. Torch may be skipped on Apple Silicon by design.
209
+ - Windows PowerShell activation policy blocks venv activation:
210
+ - Run PowerShell as Admin and set a suitable execution policy for the current user (e.g., RemoteSigned), or manually run `python app.py` after installing dependencies.
211
+ - File System or Shell path errors:
212
+ - Paths are relative to the tool root. Set NYMBO_TOOLS_ROOT to customize. Set UNSAFE_ALLOW_ABS_PATHS=1 only if you fully trust the environment.
213
+
214
+ ## License
215
+
216
+ Apache-2.0 (see Space metadata). If you duplicate the Space or use these tools, ensure your usage complies with the licenses and terms of the underlying models and providers.