Skip to main content
Glama

PostgreSQL MCP Server

by gharshit
main.py1.01 kB
# Import mcp from server from server import mcp import sys import os from utils.config import config if __name__ == "__main__": # Check if transport type is specified via environment variable or default to sse for Cloudflare transport_type = config["MCP_TRANSPORT"] or "streamable-http" if transport_type == "streamable-http": # Set uvicorn environment variables for host/port (FastMCP uses uvicorn internally for SSE) port = config["MCP_PORT"] or "8000" host = config["MCP_HOST"] or "127.0.0.1" print(f"Starting MCP server with streamable-http transport on {host}:{port}", file=sys.stderr) print(f"Access the server at: http://{host}:{port}", file=sys.stderr) # Run with standard-http transport for HTTP/network access (Cloudflare tunnel) mcp.run(transport="streamable-http",mount_path="/mcp") else: print(f"Starting MCP server with stdio transport", file=sys.stderr) mcp.run(transport="stdio")

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gharshit/mcpServer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server