Skip to content

Instantly share code, notes, and snippets.

View spdin's full-sized avatar
🏠
Working from home

Saripudin spdin

🏠
Working from home
View GitHub Profile
@spdin
spdin / gist:f30a121ba79e3dfb1f60f44d40469324
Created July 27, 2023 04:36
nginx setup for streamlit
location / {
proxy_pass http://0.0.0.0:8501/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
@spdin
spdin / mcp_hello_world.py
Created June 13, 2025 03:53
MCP Remote Server Example
import asyncio
import json
import logging
from typing import Any, Dict, Optional
import modal
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse, StreamingResponse, Response
from pydantic import BaseModel
# Modal app configuration
import asyncio
import os
import sys
import re
from pathlib import Path
from urllib.parse import urlparse, parse_qs
import aiohttp
import aiofiles
from typing import Any, Sequence
import logging
import base64
import requests
# Set up Datasaur API
API_URL = "https://deployment.datasaur.ai/api/deployment/8/1937/chat/completions"
headers = {
'Authorization': 'Bearer <api-key>',
'Content-Type': 'application/json'
}