Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,57 +9,212 @@ license: apache-2.0
|
|
| 9 |
short_description: 'Universal MCP Server(Sandboxed) built on PyFundaments '
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
| 13 |
# Universal MCP Hub (Sandboxed)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
**
|
| 18 |
-
[https://github.com/VolkanSah/Universal-MCP-Hub](https://github.com/VolkanSah/Universal-MCP-Hub)
|
| 19 |
|
| 20 |
---
|
| 21 |
|
| 22 |
-
##
|
| 23 |
|
| 24 |
-
|
|
|
|
|
|
|
| 25 |
|
| 26 |
-
|
| 27 |
|
| 28 |
-
|
| 29 |
-
* No tool β no crash
|
| 30 |
-
* `main.py` = Guardian (controls everything)
|
| 31 |
-
* `app/mcp.py` receives only injected, validated services
|
| 32 |
|
| 33 |
---
|
| 34 |
|
| 35 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
|
| 43 |
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
---
|
| 47 |
|
| 48 |
-
##
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
---
|
| 55 |
|
| 56 |
## License
|
| 57 |
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
|
| 61 |
-
* [Ethical Security Operations License (ESOL v1.1)](ESOL)
|
| 62 |
|
| 63 |
-
The ESOL is a mandatory, non-severable condition of use.
|
| 64 |
-
By using this software, you agree to all ethical constraints defined in the ESOL v1.1.
|
| 65 |
|
|
|
|
| 9 |
short_description: 'Universal MCP Server(Sandboxed) built on PyFundaments '
|
| 10 |
---
|
| 11 |
|
|
|
|
| 12 |
# Universal MCP Hub (Sandboxed)
|
| 13 |
+
The only real (MCP) HUB you need!
|
| 14 |
+
|
| 15 |
+
> running on simpleCity and **paranoidMode** β built on [PyFundaments](PyFundaments.md).
|
| 16 |
+
|
| 17 |
+
... because too many (Hype) MCP servers exist with no sandboxing, hardcoded keys, and zero security thought.
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
#### This one is different.
|
| 21 |
|
| 22 |
+
- **No key β no tool β no crash**
|
| 23 |
+
- `main.py` = Guardian (controls everything, nothing bypasses it)
|
| 24 |
+
- `app/app.py` receives only injected, validated services β never reads `os.environ` directly
|
| 25 |
+
- Every tool is registered dynamically β only if the API key exists
|
| 26 |
|
| 27 |
+
> *"I use AI as a tool, not as a replacement for thinking."* β Volkan KΓΌcΓΌkbudak
|
|
|
|
| 28 |
|
| 29 |
---
|
| 30 |
|
| 31 |
+
## Quick Start
|
| 32 |
|
| 33 |
+
1. **Fork/Clone** this Repo (Space)
|
| 34 |
+
2. Add your API keys as **Space Secrets** (Settings β Variables and secrets)
|
| 35 |
+
3. Space starts automatically β only tools with valid keys are registered
|
| 36 |
|
| 37 |
+
That's it. No config files to edit, no code to touch.
|
| 38 |
|
| 39 |
+
[Demo for `cloning space`](https://huggingface.co/spaces/codey-lab/Universal-MCP-Hub-DEMO) on HF
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
---
|
| 42 |
|
| 43 |
+
## Available Tools
|
| 44 |
+
|
| 45 |
+
Tools are registered automatically based on which keys you configure. No key = tool doesn't exist. No crashes, no errors, no exposed secrets.
|
| 46 |
+
|
| 47 |
+
| Secret | Tool | Description |
|
| 48 |
+
| :--- | :--- | :--- |
|
| 49 |
+
| `ANTHROPIC_API_KEY` | `llm_complete` | Claude Haiku / Sonnet / Opus |
|
| 50 |
+
| `GEMINI_API_KEY` | `llm_complete` | Gemini Flash / Pro |
|
| 51 |
+
| `OPENROUTER_API_KEY` | `llm_complete` | 100+ models via OpenRouter |
|
| 52 |
+
| `HF_TOKEN` | `llm_complete` | HuggingFace Inference API |
|
| 53 |
+
| `BRAVE_API_KEY` | `web_search` | Web Search (independent index) |
|
| 54 |
+
| `TAVILY_API_KEY` | `web_search` | AI-optimized Search |
|
| 55 |
+
| `DATABASE_URL` | `db_query` | Read-only DB access (SELECT only) |
|
| 56 |
+
| *(always active)* | `list_active_tools` | Lists all currently active tools |
|
| 57 |
+
| *(always active)* | `health_check` | System health + uptime |
|
| 58 |
+
|
| 59 |
+
All LLM providers share a single `llm_complete` tool with automatic **fallback chain**: `anthropic β gemini β openrouter β huggingface`
|
| 60 |
+
|
| 61 |
+
---
|
| 62 |
+
|
| 63 |
+
## MCP Client Configuration (SSE)
|
| 64 |
+
|
| 65 |
+
Connect Claude Desktop or any MCP-compatible client:
|
| 66 |
+
|
| 67 |
+
```json
|
| 68 |
+
{
|
| 69 |
+
"mcpServers": {
|
| 70 |
+
"universal-mcp-hub": {
|
| 71 |
+
"url": "https://YOUR_USERNAME-universal-mcp-hub.hf.space/sse"
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
}
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
For private Spaces, add your HF token:
|
| 78 |
+
|
| 79 |
+
```json
|
| 80 |
+
{
|
| 81 |
+
"mcpServers": {
|
| 82 |
+
"universal-mcp-hub": {
|
| 83 |
+
"url": "https://YOUR_USERNAME-universal-mcp-hub.hf.space/sse",
|
| 84 |
+
"headers": {
|
| 85 |
+
"Authorization": "Bearer hf_..."
|
| 86 |
+
}
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
---
|
| 93 |
+
|
| 94 |
+
## Desktop Client
|
| 95 |
+
#### Perfect for non-public spaces
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
- A standalone PySide6 desktop client is included: `hub.py`, with help of ClaudeAi, was to lazy π
|
| 99 |
+
- Features: Chat tab, Tools inspector, Settings (provider/model override, font size), Logs β all saved locally in `~/.mcp_desktop.json`. Token never leaves your machine except to your own Hub.
|
| 100 |
+
- more about the [Desktop Client](DESKTOP_CLIENT/README.md)
|
| 101 |
+
|
| 102 |
+
---
|
| 103 |
|
| 104 |
+
## Architecture
|
| 105 |
+
```
|
| 106 |
+
UMH
|
| 107 |
+
βββ main.py # run main!
|
| 108 |
+
βββ README.md
|
| 109 |
+
βββ ESOL
|
| 110 |
+
βββ LICENSE
|
| 111 |
+
βββ PyFundaments.md
|
| 112 |
+
βββ PyFundaments β Function Overview.md
|
| 113 |
+
βββ SECURITY.md
|
| 114 |
+
βββ requirements.txt
|
| 115 |
+
βββ .gitignore
|
| 116 |
+
βββ example.Dockerfile
|
| 117 |
+
βββ example-mcp___.env
|
| 118 |
+
βββ DESKTOP_CLIENT
|
| 119 |
+
β βββ hub.py β light MCP Desktop client
|
| 120 |
+
βββ app/
|
| 121 |
+
β βββ __init__.py
|
| 122 |
+
β βββ app.py β sandboxed Orchestrator
|
| 123 |
+
β βββ mcp.py β MCP SSE server (FastMCP + Quart)
|
| 124 |
+
β βββ tools.py β Tool registry (from .pyfun)
|
| 125 |
+
β βββ provider.py β LLM + Search execution + fallback
|
| 126 |
+
β βββ models.py β Model limits + costs
|
| 127 |
+
β βββ db_sync.py β Internal SQLite state (IPC)
|
| 128 |
+
β βββ config.py β .pyfun parser (single source of truth)
|
| 129 |
+
β βββ .pyfun β single source of truth
|
| 130 |
+
βββ fundaments/ # do not touch!
|
| 131 |
+
β βββ __init__.py
|
| 132 |
+
β βββ access_control.py
|
| 133 |
+
β βββ config_handler.py
|
| 134 |
+
β βββ encryption.py
|
| 135 |
+
β βββ postgresql.py
|
| 136 |
+
β βββ security.py
|
| 137 |
+
β βββ user_handler.py
|
| 138 |
+
βββ docs/
|
| 139 |
+
βββ access_control.py.md
|
| 140 |
+
βββ encryption.py.md
|
| 141 |
+
βββ postgresql.py.md
|
| 142 |
+
βββ security.py.md
|
| 143 |
+
βββ user_handler.py.md
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
|
| 147 |
+
```
|
| 148 |
+
|
| 149 |
+
**The Guardian pattern:** `app/*` never touches `os.environ`, `.env`, or `fundaments/` directly. Everything is injected by `main.py` as a validated `fundaments` dict. The sandbox is structural β not optional.
|
| 150 |
|
| 151 |
+
---
|
| 152 |
+
|
| 153 |
+
## Configuration (.pyfun)
|
| 154 |
+
|
| 155 |
+
All app behavior is configured via `app/.pyfun` β a structured, human-readable config format:
|
| 156 |
+
|
| 157 |
+
```ini
|
| 158 |
+
[LLM_PROVIDER.anthropic]
|
| 159 |
+
active = "true"
|
| 160 |
+
env_key = "ANTHROPIC_API_KEY"
|
| 161 |
+
default_model = "claude-haiku-4-5-20251001"
|
| 162 |
+
fallback_to = "gemini"
|
| 163 |
+
[LLM_PROVIDER.anthropic_END]
|
| 164 |
+
|
| 165 |
+
[TOOL.llm_complete]
|
| 166 |
+
active = "true"
|
| 167 |
+
provider_type = "llm"
|
| 168 |
+
default_provider = "anthropic"
|
| 169 |
+
timeout_sec = "60"
|
| 170 |
+
[TOOL.llm_complete_END]
|
| 171 |
+
```
|
| 172 |
|
| 173 |
+
Add a new tool/Provider/API_URL or something else just = edit `.pyfun` only. No code changes required.
|
| 174 |
|
| 175 |
+
---
|
| 176 |
+
|
| 177 |
+
## Security Design
|
| 178 |
+
|
| 179 |
+
- All API keys via e.g. HF Space Secrets β never hardcoded, never in `.pyfun`
|
| 180 |
+
- `list_active_tools` returns key **names** only, never values
|
| 181 |
+
- DB tools are `SELECT`-only, enforced at application level
|
| 182 |
+
- Direct execution of `app/*` is blocked by design
|
| 183 |
+
- `app/*` has zero access to `fundaments/` internals
|
| 184 |
+
- Built on [PyFundaments](PyFundaments.md) β security-first Python architecture
|
| 185 |
+
|
| 186 |
+
> PyFundaments is not perfect. But it's more secure than most of what runs in production today!
|
| 187 |
|
| 188 |
---
|
| 189 |
|
| 190 |
+
## Foundation
|
| 191 |
|
| 192 |
+
- [PyFundaments](PyFundaments.md) β Security-first Python boilerplate
|
| 193 |
+
- [PyFundaments Function Overview](Fundaments-β-Function---Overview.md)
|
| 194 |
+
- [PROJECT_STRUCTURE.md](PROJECT_STRUCTURE.md)
|
| 195 |
+
- [SECURITY.md](SECURITY.md)
|
| 196 |
+
|
| 197 |
+
---
|
| 198 |
+
|
| 199 |
+
## History
|
| 200 |
+
|
| 201 |
+
[ShellMaster](https://github.com/VolkanSah/ChatGPT-ShellMaster) (2023, archived, MIT) was the precursor β a browser-accessible shell for ChatGPT with session memory via `/tmp/shellmaster_brain.log`, built before MCP was a word. Universal MCP Hub is its natural evolution.
|
| 202 |
|
| 203 |
---
|
| 204 |
|
| 205 |
## License
|
| 206 |
|
| 207 |
+
Dual-licensed:
|
| 208 |
+
|
| 209 |
+
- [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
| 210 |
+
- [Ethical Security Operations License v1.1 (ESOL)](ESOL) β mandatory, non-severable
|
| 211 |
+
|
| 212 |
+
By using this software you agree to all ethical constraints defined in ESOL v1.1. Misuse may result in automatic license termination and legal liability.
|
| 213 |
+
|
| 214 |
+
---
|
| 215 |
+
|
| 216 |
+
*Architecture, security decisions, and PyFundaments by Volkan KΓΌcΓΌkbudak. Built with Claude (Anthropic) as a typing assistant for docs & some bugs*
|
| 217 |
|
| 218 |
+
> crafted with passion by {Volkan KΓΌcΓΌkbudak](https://github.com/volkansah/) - just want to feel how it works, mean i do not need it, have cli π
|
|
|
|
| 219 |
|
|
|
|
|
|
|
| 220 |
|