Skip to main content
Glama
monostate

100ms Raydium Sniper MCP

by monostate
auth.ts2 kB
import { OAuthClientProvider } from "@modelcontextprotocol/sdk/client/auth.js"; import { OAuthClientInformationSchema, OAuthClientInformation, OAuthTokens, OAuthTokensSchema, } from "@modelcontextprotocol/sdk/shared/auth.js"; import { SESSION_KEYS } from "./constants"; class InspectorOAuthClientProvider implements OAuthClientProvider { get redirectUrl() { return window.location.origin + "/oauth/callback"; } get clientMetadata() { return { redirect_uris: [this.redirectUrl], token_endpoint_auth_method: "none", grant_types: ["authorization_code", "refresh_token"], response_types: ["code"], client_name: "MCP Inspector", client_uri: "https://github.com/modelcontextprotocol/inspector", }; } async clientInformation() { const value = sessionStorage.getItem(SESSION_KEYS.CLIENT_INFORMATION); if (!value) { return undefined; } return await OAuthClientInformationSchema.parseAsync(JSON.parse(value)); } saveClientInformation(clientInformation: OAuthClientInformation) { sessionStorage.setItem( SESSION_KEYS.CLIENT_INFORMATION, JSON.stringify(clientInformation), ); } async tokens() { const tokens = sessionStorage.getItem(SESSION_KEYS.TOKENS); if (!tokens) { return undefined; } return await OAuthTokensSchema.parseAsync(JSON.parse(tokens)); } saveTokens(tokens: OAuthTokens) { sessionStorage.setItem(SESSION_KEYS.TOKENS, JSON.stringify(tokens)); } redirectToAuthorization(authorizationUrl: URL) { window.location.href = authorizationUrl.href; } saveCodeVerifier(codeVerifier: string) { sessionStorage.setItem(SESSION_KEYS.CODE_VERIFIER, codeVerifier); } codeVerifier() { const verifier = sessionStorage.getItem(SESSION_KEYS.CODE_VERIFIER); if (!verifier) { throw new Error("No code verifier saved for session"); } return verifier; } } export const authProvider = new InspectorOAuthClientProvider();

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/monostate/100ms-SPL-Token-Sniper-MCP'

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