Spaces:
Running
Running
Merge with remote repository and resolve conflicts
Browse files- Resolved README.md merge conflicts
- Added deployment documentation and scripts
- Maintained complete A1D MCP Server functionality
- Ready for Hugging Face Space deployment
- .gitattributes +35 -0
- DEPLOYMENT.md +151 -0
- README.md +1 -1
- push_to_space.sh +68 -0
.gitattributes
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
DEPLOYMENT.md
ADDED
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# π A1D MCP Server - Deployment Guide
|
2 |
+
|
3 |
+
## π Quick Deployment to Hugging Face Space
|
4 |
+
|
5 |
+
### Method 1: Using the Push Script (Recommended)
|
6 |
+
|
7 |
+
1. **Run the push script:**
|
8 |
+
```bash
|
9 |
+
./push_to_space.sh
|
10 |
+
```
|
11 |
+
|
12 |
+
2. **When prompted for credentials:**
|
13 |
+
- **Username:** `aigchacker` (your Hugging Face username)
|
14 |
+
- **Password:** Your Hugging Face token (not your account password)
|
15 |
+
|
16 |
+
3. **Get your Hugging Face token:**
|
17 |
+
- Go to: https://huggingface.co/settings/tokens
|
18 |
+
- Click "New token"
|
19 |
+
- Name: `a1d-mcp-server`
|
20 |
+
- Type: `Write`
|
21 |
+
- Click "Generate a token"
|
22 |
+
- Copy the token
|
23 |
+
|
24 |
+
### Method 2: Manual Git Push
|
25 |
+
|
26 |
+
```bash
|
27 |
+
# Ensure you're in the project directory
|
28 |
+
cd /path/to/a1d-mcp-server-hf
|
29 |
+
|
30 |
+
# Check git status
|
31 |
+
git status
|
32 |
+
|
33 |
+
# Push to Space
|
34 |
+
git push -u origin main
|
35 |
+
```
|
36 |
+
|
37 |
+
## π§ Post-Deployment Configuration
|
38 |
+
|
39 |
+
### 1. Set Environment Variables in Space
|
40 |
+
|
41 |
+
1. **Go to your Space:** https://huggingface.co/spaces/aigchacker/a1d-mcp-server
|
42 |
+
2. **Click "Settings" tab**
|
43 |
+
3. **Scroll to "Variables and secrets"**
|
44 |
+
4. **Add environment variable:**
|
45 |
+
- **Name:** `A1D_API_KEY`
|
46 |
+
- **Value:** Your A1D API key (get from https://a1d.ai/home/api)
|
47 |
+
- **Type:** Secret (recommended)
|
48 |
+
5. **Click "Add variable"**
|
49 |
+
6. **Space will automatically restart**
|
50 |
+
|
51 |
+
### 2. Verify Deployment
|
52 |
+
|
53 |
+
1. **Check Space status:** Should show "Running"
|
54 |
+
2. **Test web interface:** Click "App" tab to test tools
|
55 |
+
3. **Test MCP endpoint:** `https://aigchacker-a1d-mcp-server.hf.space/gradio_api/mcp/sse`
|
56 |
+
|
57 |
+
## π MCP Client Configuration
|
58 |
+
|
59 |
+
### For Claude Desktop (Header-based API Key)
|
60 |
+
|
61 |
+
Add to your Claude Desktop config:
|
62 |
+
|
63 |
+
```json
|
64 |
+
{
|
65 |
+
"mcpServers": {
|
66 |
+
"a1d-hosted": {
|
67 |
+
"command": "npx",
|
68 |
+
"args": [
|
69 |
+
"mcp-remote@latest",
|
70 |
+
"https://aigchacker-a1d-mcp-server.hf.space/gradio_api/mcp/sse",
|
71 |
+
"--header",
|
72 |
+
"API_KEY:${MCP_API_KEY}"
|
73 |
+
],
|
74 |
+
"env": {
|
75 |
+
"MCP_API_KEY": "your_a1d_api_key_here"
|
76 |
+
}
|
77 |
+
}
|
78 |
+
}
|
79 |
+
}
|
80 |
+
```
|
81 |
+
|
82 |
+
### For Claude Desktop (Environment Variable)
|
83 |
+
|
84 |
+
```json
|
85 |
+
{
|
86 |
+
"mcpServers": {
|
87 |
+
"a1d-hosted": {
|
88 |
+
"command": "npx",
|
89 |
+
"args": [
|
90 |
+
"mcp-remote",
|
91 |
+
"https://aigchacker-a1d-mcp-server.hf.space/gradio_api/mcp/sse"
|
92 |
+
]
|
93 |
+
}
|
94 |
+
}
|
95 |
+
}
|
96 |
+
```
|
97 |
+
|
98 |
+
## π Troubleshooting
|
99 |
+
|
100 |
+
### Push Issues
|
101 |
+
|
102 |
+
**Problem:** `fatal: unable to access 'https://huggingface.co/spaces/...'`
|
103 |
+
**Solution:**
|
104 |
+
- Check your Hugging Face token
|
105 |
+
- Ensure you have write permissions to the Space
|
106 |
+
- Try clearing git credentials: `git config --global --unset credential.helper`
|
107 |
+
|
108 |
+
**Problem:** `Authentication failed`
|
109 |
+
**Solution:**
|
110 |
+
- Use your Hugging Face username and token (not password)
|
111 |
+
- Generate a new token with write permissions
|
112 |
+
|
113 |
+
### Space Issues
|
114 |
+
|
115 |
+
**Problem:** Space shows "Build Error"
|
116 |
+
**Solution:**
|
117 |
+
- Check the logs in the Space
|
118 |
+
- Ensure all files are properly committed
|
119 |
+
- Verify requirements.txt is correct
|
120 |
+
|
121 |
+
**Problem:** "API key not found" error
|
122 |
+
**Solution:**
|
123 |
+
- Set A1D_API_KEY environment variable in Space settings
|
124 |
+
- Restart the Space after adding the variable
|
125 |
+
|
126 |
+
### MCP Client Issues
|
127 |
+
|
128 |
+
**Problem:** MCP client can't connect
|
129 |
+
**Solution:**
|
130 |
+
- Verify the Space is running
|
131 |
+
- Check the MCP endpoint URL
|
132 |
+
- Ensure mcp-remote is installed: `npm install -g mcp-remote`
|
133 |
+
|
134 |
+
## π± Space URLs
|
135 |
+
|
136 |
+
- **Space Home:** https://huggingface.co/spaces/aigchacker/a1d-mcp-server
|
137 |
+
- **Web Interface:** https://aigchacker-a1d-mcp-server.hf.space
|
138 |
+
- **MCP Endpoint:** https://aigchacker-a1d-mcp-server.hf.space/gradio_api/mcp/sse
|
139 |
+
|
140 |
+
## π― Next Steps
|
141 |
+
|
142 |
+
1. β
Deploy to Space
|
143 |
+
2. β
Set environment variables
|
144 |
+
3. β
Test web interface
|
145 |
+
4. β
Configure MCP client
|
146 |
+
5. β
Test with Claude Desktop
|
147 |
+
6. π Start using AI tools!
|
148 |
+
|
149 |
+
---
|
150 |
+
|
151 |
+
**Need help?** Check the main README.md or create an issue in the repository.
|
README.md
CHANGED
@@ -273,5 +273,5 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
273 |
|
274 |
---
|
275 |
|
276 |
-
**Built with β€οΈ by the A1D Team**
|
277 |
[A1D.ai](https://a1d.ai) β’ [GitHub](https://github.com/AIGC-Hackers) β’ [API Docs](https://a1d.ai/api/quick-start)
|
|
|
273 |
|
274 |
---
|
275 |
|
276 |
+
**Built with β€οΈ by the A1D Team**
|
277 |
[A1D.ai](https://a1d.ai) β’ [GitHub](https://github.com/AIGC-Hackers) β’ [API Docs](https://a1d.ai/api/quick-start)
|
push_to_space.sh
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
# A1D MCP Server - Push to Hugging Face Space
|
4 |
+
# Usage: ./push_to_space.sh
|
5 |
+
|
6 |
+
echo "π A1D MCP Server - Pushing to Hugging Face Space"
|
7 |
+
echo "=================================================="
|
8 |
+
|
9 |
+
# Check if we're in the right directory
|
10 |
+
if [ ! -f "app.py" ]; then
|
11 |
+
echo "β Error: app.py not found. Please run this script from the project root directory."
|
12 |
+
exit 1
|
13 |
+
fi
|
14 |
+
|
15 |
+
# Check if git is initialized
|
16 |
+
if [ ! -d ".git" ]; then
|
17 |
+
echo "β Error: Git repository not initialized. Please run 'git init' first."
|
18 |
+
exit 1
|
19 |
+
fi
|
20 |
+
|
21 |
+
echo "π Current git status:"
|
22 |
+
git status
|
23 |
+
|
24 |
+
echo ""
|
25 |
+
echo "π§ Preparing to push to Hugging Face Space..."
|
26 |
+
echo "Space URL: https://huggingface.co/spaces/aigchacker/a1d-mcp-server"
|
27 |
+
|
28 |
+
# Check if remote is set
|
29 |
+
if ! git remote get-url origin > /dev/null 2>&1; then
|
30 |
+
echo "π‘ Adding remote origin..."
|
31 |
+
git remote add origin https://huggingface.co/spaces/aigchacker/a1d-mcp-server
|
32 |
+
else
|
33 |
+
echo "β
Remote origin already set"
|
34 |
+
fi
|
35 |
+
|
36 |
+
echo ""
|
37 |
+
echo "π Authentication Required:"
|
38 |
+
echo "1. Go to: https://huggingface.co/settings/tokens"
|
39 |
+
echo "2. Create a new token with 'Write' permissions"
|
40 |
+
echo "3. When prompted, enter your Hugging Face username and token as password"
|
41 |
+
|
42 |
+
echo ""
|
43 |
+
echo "π Pushing to Space..."
|
44 |
+
echo "Note: You'll be prompted for your Hugging Face credentials"
|
45 |
+
|
46 |
+
# Push to main branch
|
47 |
+
git push -u origin main
|
48 |
+
|
49 |
+
if [ $? -eq 0 ]; then
|
50 |
+
echo ""
|
51 |
+
echo "π Successfully pushed to Hugging Face Space!"
|
52 |
+
echo "π± Your Space will be available at:"
|
53 |
+
echo " https://huggingface.co/spaces/aigchacker/a1d-mcp-server"
|
54 |
+
echo ""
|
55 |
+
echo "β οΈ Don't forget to set the A1D_API_KEY environment variable in your Space settings!"
|
56 |
+
echo " 1. Go to your Space settings"
|
57 |
+
echo " 2. Add environment variable: A1D_API_KEY = your_api_key"
|
58 |
+
echo " 3. Set it as 'Secret' for security"
|
59 |
+
echo " 4. Restart the Space"
|
60 |
+
else
|
61 |
+
echo ""
|
62 |
+
echo "β Push failed. Please check your credentials and try again."
|
63 |
+
echo ""
|
64 |
+
echo "π§ Troubleshooting:"
|
65 |
+
echo " - Make sure you have a valid Hugging Face token"
|
66 |
+
echo " - Check your internet connection"
|
67 |
+
echo " - Verify the Space URL is correct"
|
68 |
+
fi
|