Skip to main content
Glama
brianellin

Bluesky MCP Server

by brianellin

follow-user

Enables AI assistants to follow a specific user on Bluesky by providing the user's handle. Part of the Bluesky MCP Server for managing social interactions on the ATProtocol.

Instructions

Follow a user on Bluesky

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
handleYesThe handle of the user to follow

Implementation Reference

  • The handler function that implements the 'follow-user' tool. It resolves the provided handle to a DID using agent.resolveHandle, then calls agent.follow(did) to perform the follow action, with proper error handling.
      if (!agent) {
        return mcpErrorResponse("Not logged in. Please check your environment variables.");
      }
    
      try {
        // Resolve the handle to a DID
        const resolveResponse = await agent.resolveHandle({ handle: cleanHandle(handle) });
        
        if (!resolveResponse.success) {
          return mcpErrorResponse(`Failed to resolve handle: ${handle}`);
        }
        
        const did = resolveResponse.data.did;
        await agent.follow(did);
        
        return mcpSuccessResponse(`Successfully followed @${handle}`);
      } catch (error) {
        return mcpErrorResponse(`Error following user: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • Input schema using Zod: requires a 'handle' parameter which is a string describing the user's handle (e.g., alice.bsky.social).
      handle: z.string().describe("The handle of the user to follow"),
    },
    async ({ handle }) => {
  • src/index.ts:681-707 (registration)
    The MCP server.tool registration for the 'follow-user' tool, including name, description, input schema, and handler reference.
      "follow-user",
      "Follow a user on Bluesky",
      {
        handle: z.string().describe("The handle of the user to follow"),
      },
      async ({ handle }) => {
        if (!agent) {
          return mcpErrorResponse("Not logged in. Please check your environment variables.");
        }
    
        try {
          // Resolve the handle to a DID
          const resolveResponse = await agent.resolveHandle({ handle: cleanHandle(handle) });
          
          if (!resolveResponse.success) {
            return mcpErrorResponse(`Failed to resolve handle: ${handle}`);
          }
          
          const did = resolveResponse.data.did;
          await agent.follow(did);
          
          return mcpSuccessResponse(`Successfully followed @${handle}`);
        } catch (error) {
          return mcpErrorResponse(`Error following user: ${error instanceof Error ? error.message : String(error)}`);
        }
      }
    );

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/brianellin/bsky-mcp-server'

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