GITHUB_SETUP.md•5.28 kB
# GitHub Repository Setup Guide
## Step 1: Create Repository on GitHub
1. **Go to GitHub** and sign in
2. **Click the "+" icon** in the top right → "New repository"
3. **Fill in the details:**
- **Repository name**: `fastapi-mcp-math-server` (or your preferred name)
- **Description**:
```
A FastAPI REST API with MCP (Model Context Protocol) server integration for basic math operations. Demonstrates how to expose APIs as tools for AI applications like Claude Desktop.
```
- **Visibility**: Public (recommended) or Private
- **DO NOT initialize with:**
- ❌ README (we already have one)
- ❌ .gitignore (we already have one)
- ❌ License (we already have one)
4. **Click "Create repository"**
---
## Step 2: Initialize Local Git Repository
Open your terminal in the project directory and run:
```bash
cd d:\Projects\MCP
# Initialize git repository
git init
# Add all files to staging
git add .
# Create first commit
git commit -m "Initial commit: FastAPI + MCP server for math operations
- Add FastAPI REST API with add/subtract endpoints
- Add MCP server with stdio transport
- Include comprehensive testing suite
- Add documentation and architecture diagrams"
# Rename default branch to main (if needed)
git branch -M main
```
---
## Step 3: Connect to GitHub and Push
Replace `YOUR_USERNAME` and `YOUR_REPO_NAME` with your actual values:
```bash
# Add remote repository
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
# Push to GitHub
git push -u origin main
```
**Alternative with SSH:**
```bash
git remote add origin git@github.com:YOUR_USERNAME/YOUR_REPO_NAME.git
git push -u origin main
```
---
## Step 4: Add Repository Topics/Tags
On GitHub repository page:
1. Click **"About"** section (gear icon)
2. Add **Topics**:
- `fastapi`
- `mcp`
- `model-context-protocol`
- `ai-tools`
- `python`
- `rest-api`
- `claude`
- `ai-integration`
- `llm-tools`
- `anthropic`
---
## Step 5: Verify Repository
Check that these files are visible on GitHub:
- ✅ README.md (with nice formatting)
- ✅ requirements.txt
- ✅ main.py
- ✅ mcp_server.py
- ✅ test_mcp.py
- ✅ mcp.json
- ✅ architecture_diagram.md
- ✅ api/ folder
- ✅ LICENSE
- ✅ .gitignore
---
## Step 6: Optional Enhancements
### Add GitHub Actions for CI/CD
Create `.github/workflows/test.yml`:
```yaml
name: Test MCP Server
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Run tests
run: |
python test_mcp.py
```
### Add Badges to README
Add at the top of README.md:
```markdown




```
### Create Release
1. Go to **Releases** → **Create a new release**
2. **Tag version**: `v1.0.0`
3. **Release title**: `v1.0.0 - Initial Release`
4. **Description**:
```markdown
## Features
- FastAPI REST API with add/subtract endpoints
- MCP server with stdio transport
- Direct function call integration
- Comprehensive test suite
- Full documentation with architecture diagrams
## What's Included
- 2 REST API endpoints
- 2 MCP tools
- Test suite with 6 test cases
- Example configurations for Claude Desktop, Cline, Continue.dev
```
---
## Step 7: Share Your Repository
After publishing, you can:
1. **Add to your portfolio/resume**
2. **Share on social media**:
```
Just built a FastAPI + MCP server demo! 🚀
Shows how to expose REST APIs as tools for AI applications like Claude Desktop.
Check it out: https://github.com/YOUR_USERNAME/YOUR_REPO_NAME
#Python #FastAPI #MCP #AI #ClaudeAI
```
3. **Submit to awesome lists**:
- Awesome FastAPI
- Awesome MCP
- Awesome AI Tools
---
## Future Updates
To push future changes:
```bash
# Make your changes to files
# Stage changes
git add .
# Commit with descriptive message
git commit -m "Add multiply and divide operations"
# Push to GitHub
git push
```
---
## Troubleshooting
**Problem: Permission denied (publickey)**
```bash
# Use HTTPS instead of SSH
git remote set-url origin https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
```
**Problem: Remote already exists**
```bash
# Remove and re-add
git remote remove origin
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
```
**Problem: Updates were rejected**
```bash
# Pull first, then push
git pull origin main --rebase
git push
```
---
## Quick Command Reference
```bash
# Check status
git status
# View commit history
git log --oneline
# View remote URL
git remote -v
# Create new branch
git checkout -b feature/new-operation
# Switch branches
git checkout main
# Merge branch
git merge feature/new-operation
# Push branch to GitHub
git push -u origin feature/new-operation
```