Spaces:
Running
Running
| # π A1D MCP Server - Deployment Guide | |
| ## π Quick Deployment to Hugging Face Space | |
| ### Method 1: Using the Push Script (Recommended) | |
| 1. **Run the push script:** | |
| ```bash | |
| ./push_to_space.sh | |
| ``` | |
| 2. **When prompted for credentials:** | |
| - **Username:** `aigchacker` (your Hugging Face username) | |
| - **Password:** Your Hugging Face token (not your account password) | |
| 3. **Get your Hugging Face token:** | |
| - Go to: https://huggingface.co/settings/tokens | |
| - Click "New token" | |
| - Name: `a1d-mcp-server` | |
| - Type: `Write` | |
| - Click "Generate a token" | |
| - Copy the token | |
| ### Method 2: Manual Git Push | |
| ```bash | |
| # Ensure you're in the project directory | |
| cd /path/to/a1d-mcp-server-hf | |
| # Check git status | |
| git status | |
| # Push to Space | |
| git push -u origin main | |
| ``` | |
| ## π§ Post-Deployment Configuration | |
| ### 1. Set Environment Variables in Space | |
| 1. **Go to your Space:** https://huggingface.co/spaces/aigchacker/a1d-mcp-server | |
| 2. **Click "Settings" tab** | |
| 3. **Scroll to "Variables and secrets"** | |
| 4. **Add environment variable:** | |
| - **Name:** `A1D_API_KEY` | |
| - **Value:** Your A1D API key (get from https://a1d.ai/home/api) | |
| - **Type:** Secret (recommended) | |
| 5. **Click "Add variable"** | |
| 6. **Space will automatically restart** | |
| ### 2. Verify Deployment | |
| 1. **Check Space status:** Should show "Running" | |
| 2. **Test web interface:** Click "App" tab to test tools | |
| 3. **Test MCP endpoint:** `https://aigchacker-a1d-mcp-server.hf.space/gradio_api/mcp/sse` | |
| ## π MCP Client Configuration | |
| ### For Claude Desktop (Header-based API Key) | |
| Add to your Claude Desktop config: | |
| ```json | |
| { | |
| "mcpServers": { | |
| "a1d-hosted": { | |
| "command": "npx", | |
| "args": [ | |
| "mcp-remote@latest", | |
| "https://aigchacker-a1d-mcp-server.hf.space/gradio_api/mcp/sse", | |
| "--header", | |
| "API_KEY:${MCP_API_KEY}" | |
| ], | |
| "env": { | |
| "MCP_API_KEY": "your_a1d_api_key_here" | |
| } | |
| } | |
| } | |
| } | |
| ``` | |
| ### For Claude Desktop (Environment Variable) | |
| ```json | |
| { | |
| "mcpServers": { | |
| "a1d-hosted": { | |
| "command": "npx", | |
| "args": [ | |
| "mcp-remote", | |
| "https://aigchacker-a1d-mcp-server.hf.space/gradio_api/mcp/sse" | |
| ] | |
| } | |
| } | |
| } | |
| ``` | |
| ## π Troubleshooting | |
| ### Push Issues | |
| **Problem:** `fatal: unable to access 'https://huggingface.co/spaces/...'` | |
| **Solution:** | |
| - Check your Hugging Face token | |
| - Ensure you have write permissions to the Space | |
| - Try clearing git credentials: `git config --global --unset credential.helper` | |
| **Problem:** `Authentication failed` | |
| **Solution:** | |
| - Use your Hugging Face username and token (not password) | |
| - Generate a new token with write permissions | |
| ### Space Issues | |
| **Problem:** Space shows "Build Error" | |
| **Solution:** | |
| - Check the logs in the Space | |
| - Ensure all files are properly committed | |
| - Verify requirements.txt is correct | |
| **Problem:** "API key not found" error | |
| **Solution:** | |
| - Set A1D_API_KEY environment variable in Space settings | |
| - Restart the Space after adding the variable | |
| ### MCP Client Issues | |
| **Problem:** MCP client can't connect | |
| **Solution:** | |
| - Verify the Space is running | |
| - Check the MCP endpoint URL | |
| - Ensure mcp-remote is installed: `npm install -g mcp-remote` | |
| ## π± Space URLs | |
| - **Space Home:** https://huggingface.co/spaces/aigchacker/a1d-mcp-server | |
| - **Web Interface:** https://aigchacker-a1d-mcp-server.hf.space | |
| - **MCP Endpoint:** https://aigchacker-a1d-mcp-server.hf.space/gradio_api/mcp/sse | |
| ## π― Next Steps | |
| 1. β Deploy to Space | |
| 2. β Set environment variables | |
| 3. β Test web interface | |
| 4. β Configure MCP client | |
| 5. β Test with Claude Desktop | |
| 6. π Start using AI tools! | |
| --- | |
| **Need help?** Check the main README.md or create an issue in the repository. | |