Alibrown commited on
Commit
be5ee6d
Β·
verified Β·
1 Parent(s): c8c6d85

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +181 -26
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
- #### Universal MCP Server running in **paranoid mode** β€” built on [PyFundaments](PyFundaments.md) and licensed under ESOL.
 
 
 
16
 
17
- **Source:**
18
- [https://github.com/VolkanSah/Universal-MCP-Hub](https://github.com/VolkanSah/Universal-MCP-Hub)
19
 
20
  ---
21
 
22
- ## Overview
23
 
24
- The goal was simple: too many MCP servers out there with no sandboxing, hardcoded keys, and zero security thought.
 
 
25
 
26
- This one is different.
27
 
28
- * No key β†’ no tool
29
- * No tool β†’ no crash
30
- * `main.py` = Guardian (controls everything)
31
- * `app/mcp.py` receives only injected, validated services
32
 
33
  ---
34
 
35
- ## Foundation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
- * Based on:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
- * [PyFundaments](PyFundaments.md)
40
- * [PyFundaments – Function Overview](Fundaments-–-Function---Overview.md)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
- * Project details:
43
 
44
- * [README_MCP_HUB.md](README_MCP_HUB.md)
 
 
 
 
 
 
 
 
 
 
 
45
 
46
  ---
47
 
48
- ## Documentation
49
 
50
- * [PROJECT_STRUCTURE.md](PROJECT_STRUCTURE.md)
51
- * [SECURITY.md](SECURITY.md)
52
- * [CODEY_STAR_REPORT.md](CODEY_STAR_REPORT.md)
 
 
 
 
 
 
 
53
 
54
  ---
55
 
56
  ## License
57
 
58
- This work is dual-licensed under:
 
 
 
 
 
 
 
 
 
59
 
60
- * [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)
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