Skip to main content
Glama
SectionScroller.tsx806 B
'use client'; import { useEffect, useState } from 'react'; const scrollToHash = (id: string) => { const element = document.getElementById(id); const offset = 150; const y = (element?.getBoundingClientRect()?.top ?? 0) + window.scrollY - offset; window.scrollTo({ top: y, behavior: 'smooth' }); }; export const SectionScroller = () => { const [hash, setHash] = useState<string>(); const onHashChange = () => { setHash(window.location.hash.slice(1)); }; useEffect(() => { setHash(window.location.hash.slice(1)); window.addEventListener('hashchange', onHashChange, { passive: true }); return () => window.removeEventListener('hashchange', onHashChange); }, []); useEffect(() => { if (hash) { scrollToHash(hash); } }, [hash]); return null; };

Latest Blog Posts

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/aymericzip/intlayer'

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