JC321 commited on
Commit
b1136ac
·
verified ·
1 Parent(s): 19e8219

Upload 3 files

Browse files
Files changed (3) hide show
  1. README.md +0 -18
  2. app.py +3 -9
  3. index_simple.html +1 -2
README.md CHANGED
@@ -171,24 +171,6 @@ Use similar command-based configuration with:
171
  - `args`: ["path/to/app.py", "--mcp"]
172
  - `env`: Set FINNHUB_API_KEY
173
 
174
- **For URL-based Access (HF Space or Remote Server):**
175
-
176
- If the server is deployed on Hugging Face Space or a remote server:
177
- ```json
178
- {
179
- "mcpServers": {
180
- "finnhub-remote": {
181
- "url": "https://jc321-marketandstockmcp.hf.space/mcp"
182
- }
183
- }
184
- }
185
- ```
186
-
187
- **Note:**
188
- - URL-based access requires the API key to be configured on the server side (via `FINNHUB_API_KEY` environment variable)
189
- - The `/mcp` endpoint is automatically available when running the Gradio UI (`python app.py`)
190
- - For HF Space deployment, set the API key in Space secrets
191
-
192
  #### 7️⃣ Restart Your MCP Client
193
 
194
  Restart Claude Desktop / Cursor to load the new server configuration.
 
171
  - `args`: ["path/to/app.py", "--mcp"]
172
  - `env`: Set FINNHUB_API_KEY
173
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  #### 7️⃣ Restart Your MCP Client
175
 
176
  Restart Claude Desktop / Cursor to load the new server configuration.
app.py CHANGED
@@ -609,16 +609,10 @@ if __name__ == "__main__":
609
  print("▶️ Starting MCP Server (standalone mode)...")
610
  mcp.run(transport="sse")
611
  else:
612
- # Launch Gradio interface with MCP endpoint mounted
613
- print("▶️ Starting Gradio Interface with MCP endpoint...")
614
-
615
- # Mount MCP server to Gradio app at /mcp path
616
- # This allows both UI and MCP protocol access
617
- mcp_app = mcp.get_asgi_app()
618
- demo.mount_app(path="/mcp", app=mcp_app)
619
-
620
- print("📡 MCP endpoint available at: /mcp")
621
  print("🌐 Gradio UI available at: /")
 
622
 
623
  demo.launch(
624
  server_name=host,
 
609
  print("▶️ Starting MCP Server (standalone mode)...")
610
  mcp.run(transport="sse")
611
  else:
612
+ # Launch Gradio interface
613
+ print("▶️ Starting Gradio Interface...")
 
 
 
 
 
 
 
614
  print("🌐 Gradio UI available at: /")
615
+ print("📡 MCP tools available through Gradio tabs")
616
 
617
  demo.launch(
618
  server_name=host,
index_simple.html CHANGED
@@ -31,8 +31,7 @@ strong { color: #1f2937; }
31
  <h2>How to Use</h2>
32
  <ul>
33
  <li>Configure your Finnhub API key in the <strong>"🔑 API Key Config"</strong> tab</li>
34
- <li><strong>Option 1:</strong> Use tools through your MCP client (e.g., Claude Desktop, Cursor)</li>
35
- <li><strong>Option 2:</strong> Access via URL: <code>https://jc321-marketandstockmcp.hf.space/mcp</code></li>
36
  <li>Check server connectivity in the <strong>"🩺 Health Check"</strong> tab if needed</li>
37
  </ul>
38
  <div class="note">
 
31
  <h2>How to Use</h2>
32
  <ul>
33
  <li>Configure your Finnhub API key in the <strong>"🔑 API Key Config"</strong> tab</li>
34
+ <li>Use tools through your MCP client (e.g., Claude Desktop, Cursor)</li>
 
35
  <li>Check server connectivity in the <strong>"🩺 Health Check"</strong> tab if needed</li>
36
  </ul>
37
  <div class="note">