Skip to main content
Glama

w3_login

Initiate login authentication via email for accessing the MCP IPFS server. Users must confirm their email to complete authorization and proceed with server tools.

Instructions

Initiates the w3 login process using the pre-configured email (W3_LOGIN_EMAIL env var). IMPORTANT: The command expects email confirmation, so before running the w3_login tool, emphasize ATTENTION to the user in large letters + emoji that they MUST check email to complete authentication. If the final output includes 'Agent was authorized by', the user has already clicked the link and is successfully authorized, CONTINUE using mcp-ipfs tools. 'Too Many Requests': wait a moment before requesting it again.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the core logic of the w3_login tool. It retrieves the email from the W3_LOGIN_EMAIL environment variable, logs the initiation, executes the w3 CLI 'login' command, and returns the stdout/stderr output wrapped in a JSON message.
    const handleW3Login: ToolHandler = async (_args) => { const loginEmail = process.env["W3_LOGIN_EMAIL"]; // Checked at startup logger.info( `Initiating login for ${loginEmail}. User MUST check email to authorize.` ); const { stdout, stderr } = await runW3Command(`login ${loginEmail!}`); const output = `Login process initiated for ${loginEmail!}. Output from w3:\nStdout: ${stdout}\nStderr: ${stderr}\nPlease check your email to complete the login.`; return { content: [{ type: "text", text: JSON.stringify({ message: output }) }], }; };
  • Zod schema defining the input arguments for the w3_login tool (empty object since no arguments are required) along with a descriptive string explaining usage and prerequisites.
    export const W3LoginArgsSchema = z .object({}) .describe( "Initiates the w3 login process using the pre-configured email (W3_LOGIN_EMAIL env var). Highlight to the user that they MUST check email to complete authentication." );
  • The toolHandlers object maps the string 'w3_login' to its handler function handleW3Login. This map is imported and used in src/index.ts to dispatch CallTool requests to the correct handler based on the tool name.
    export const toolHandlers: Record<string, ToolHandler> = { w3_login: handleW3Login, w3_space_ls: handleW3SpaceLs, w3_space_use: handleW3SpaceUse, w3_space_create: handleW3SpaceCreate, w3_up: handleW3Up, w3_ls: handleW3Ls, w3_rm: handleW3Rm, w3_open: handleW3Open, w3_space_info: handleW3SpaceInfo, w3_space_add: handleW3SpaceAdd, w3_delegation_create: handleW3DelegationCreate, w3_delegation_ls: handleW3DelegationLs, w3_delegation_revoke: handleW3DelegationRevoke, w3_proof_add: handleW3ProofAdd, w3_proof_ls: handleW3ProofLs, w3_key_create: handleW3KeyCreate, w3_bridge_generate_tokens: handleW3BridgeGenerateTokens, w3_can_blob_add: handleW3CanBlobAdd, w3_can_blob_ls: handleW3CanBlobLs, w3_can_blob_rm: handleW3CanBlobRm, w3_can_index_add: handleW3CanIndexAdd, w3_can_upload_add: handleW3CanUploadAdd, w3_can_upload_ls: handleW3CanUploadLs, w3_can_upload_rm: handleW3CanUploadRm, w3_plan_get: handleW3PlanGet, w3_account_ls: handleW3AccountLs, w3_space_provision: handleW3SpaceProvision, w3_coupon_create: handleW3CouponCreate, w3_usage_report: handleW3UsageReport, w3_can_access_claim: handleW3CanAccessClaim, w3_can_store_add: handleW3CanStoreAdd, w3_can_store_ls: handleW3CanStoreLs, w3_can_store_rm: handleW3CanStoreRm, w3_can_filecoin_info: handleW3CanFilecoinInfo, w3_reset: handleW3Reset, };
  • Pre-startup validation ensuring the W3_LOGIN_EMAIL environment variable is set, which is required for the w3_login tool to function.
    const loginEmail = process.env["W3_LOGIN_EMAIL"]; if (!loginEmail) { logger.error("Missing environment variable W3_LOGIN_EMAIL. Exiting."); process.exit(1); }
  • src/index.ts:94-115 (registration)
    The MCP server's CallTool request handler that looks up the tool name in the imported toolHandlers map and invokes the corresponding handler function, effectively registering all tools including w3_login for MCP protocol handling.
    server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; logger.info(`Handling CallTool request for: ${name}`); const handler = toolHandlers[name]; if (!handler) { logger.error(`Unknown tool requested: ${name}`); return { content: [ { type: "text", text: JSON.stringify({ error: `Unknown tool: ${name}` }), }, ], isError: true, }; } try { const result = await handler(args); return result;

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/alexbakers/mcp-ipfs'

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