Skip to main content
Glama

repost

Share another user's post on Bluesky Social by providing its URI and CID. Simplifies reposting content while maintaining original attribution.

Instructions

Repost another user's post.

Args: ctx: MCP context uri: URI of the post to repost cid: CID of the post to repost Returns: Status of the repost operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cidYes
uriYes

Implementation Reference

  • The repost tool handler: decorated with @mcp.tool(), performs the repost operation using the Bluesky client and returns the result.
    @mcp.tool() def repost( ctx: Context, uri: str, cid: str, ) -> Dict: """Repost another user's post. Args: ctx: MCP context uri: URI of the post to repost cid: CID of the post to repost Returns: Status of the repost operation """ try: bluesky_client = get_authenticated_client(ctx) repost_response = bluesky_client.repost(uri, cid) return { "status": "success", "message": "Post reposted successfully", "repost_uri": repost_response.uri, "repost_cid": repost_response.cid, } except Exception as e: error_msg = f"Failed to repost: {str(e)}" return {"status": "error", "message": error_msg}
  • server.py:353-353 (registration)
    The @mcp.tool() decorator registers the repost function as an MCP tool.
    @mcp.tool()
  • Helper function to get the authenticated Bluesky client, used by the repost handler.
    def get_authenticated_client(ctx: Context) -> Client: """Get an authenticated client, creating it lazily if needed. Args: ctx: MCP context Returns: Authenticated Client instance Raises: ValueError: If credentials are not available """ app_context = ctx.request_context.lifespan_context # If we already have a client, return it if app_context.bluesky_client is not None: return app_context.bluesky_client # Try to create a new client by calling login again client = login() if client is None: raise ValueError( "Authentication required but credentials not available. " "Please set BLUESKY_IDENTIFIER and BLUESKY_APP_PASSWORD environment variables." ) # Store it in the context for future use app_context.bluesky_client = client return client

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/gwbischof/bluesky-social-mcp'

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