mcp-docs-server / DEPLOYMENT.md
galcan's picture
Inıtial commit
f468451

Deployment Guide for MCP Documentation Server

Prerequisites

  1. Hugging Face Account: Create an account at huggingface.co
  2. Git: Ensure Git is installed on your system
  3. Docker: Required for local testing (optional)

Step 1: Create Hugging Face Space

  1. Go to Hugging Face Spaces
  2. Click "Create new Space"
  3. Fill in the details:
    • Space name: mcp-docs-server (or your preferred name)
    • License: MIT
    • SDK: Docker
    • Hardware: CPU Basic (free tier)
    • Visibility: Public or Private

Step 2: Clone and Setup

# Clone your space (replace with your username)
git clone https://huggingface.co/spaces/YOUR_USERNAME/mcp-docs-server
cd mcp-docs-server

# Copy all files from this directory to the cloned space
# (Copy all files from mcp-docs-hf-space/ to the cloned directory)

Step 3: Test Locally (Optional)

# Install dependencies
pip install -r requirements.txt

# Test the application
python test_app.py

# Run the server locally
python app.py

Step 4: Deploy to Hugging Face

# Add all files to git
git add .

# Commit changes
git commit -m "Initial MCP Documentation Server deployment"

# Push to Hugging Face
git push origin main

Step 5: Verify Deployment

  1. Go to your Space URL: https://huggingface.co/spaces/YOUR_USERNAME/mcp-docs-server
  2. Wait for the build to complete (usually 2-5 minutes)
  3. Test the API endpoints:
    • GET / - Health check
    • POST /search - Search documentation

API Usage Examples

Health Check

curl https://YOUR_SPACE_URL.hf.space/

Search Documentation

curl -X POST "https://YOUR_SPACE_URL.hf.space/search" \
  -H "Content-Type: application/json" \
  -d '{"query": "MCP architecture", "limit": 5}'

Get Specific Chunk

curl "https://YOUR_SPACE_URL.hf.space/chunks/md_architecture_b82bfe7e__0"

Troubleshooting

Build Failures

  • Check the logs in the Hugging Face Space interface
  • Ensure all files are properly committed
  • Verify the Dockerfile syntax

Runtime Errors

  • Check the application logs
  • Verify all data files are present
  • Test locally first

Performance Issues

  • Consider upgrading to a paid tier for better performance
  • Optimize the search algorithm if needed

Next Steps

  1. Integrate with MCP Clients: Use this server as a data source for MCP clients
  2. Add Authentication: Implement API keys or OAuth if needed
  3. Enhance Search: Implement semantic search using the FAISS index
  4. Add More Features: Implement additional endpoints as needed

Support

For issues or questions:

  1. Check the Hugging Face Space logs
  2. Review the application code
  3. Test locally first
  4. Check the Hugging Face Spaces documentation