npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

sprout-social-mcp

v1.0.0

Published

MCP server for creating draft social media posts in Sprout Social.

Downloads

100

Readme

Sprout Social MCP

An MCP (Model Context Protocol) server for creating and scheduling social media posts through Sprout Social. This server enables AI agents like goose to interact with Sprout Social's Publishing API to create draft posts, schedule posts, and upload media.

Features

  • Draft Posts: Create draft posts for review before publishing
  • Scheduled Posts: Schedule posts for future publication with specific timestamps
  • Media Upload: Upload images and videos from public URLs
  • Multi-Network Support: Post to multiple social networks simultaneously (LinkedIn, Twitter/X, YouTube, Bluesky)
  • Unified Interface: Single tool to handle content with optional media and scheduling

Prerequisites

  • Node.js (version 14 or higher recommended)
  • A Sprout Social account with API access
  • Sprout Social API credentials:
    • API Token
    • Customer ID
    • Group ID
    • Profile IDs for each social network you want to post to

Setup

1. Install Dependencies

npm install

2. Configure Environment Variables

Set the following environment variables with your Sprout Social credentials:

Required:

  • SPROUT_API_TOKEN - Your Sprout Social API token
  • SPROUT_CUSTOMER_ID - Your Sprout Social customer ID
  • SPROUT_GROUP_ID - Your Sprout Social group ID

These will vary based on your workflow:

  • SPROUT_PROFILE_ID_LINKEDIN - LinkedIn profile ID
  • SPROUT_PROFILE_ID_TWITTER - Twitter/X profile ID
  • SPROUT_PROFILE_ID_YOUTUBE - YouTube profile ID
  • SPROUT_PROFILE_ID_BLUESKY - Bluesky profile ID

You can set these in your shell configuration or create a .env file (not tracked in Git).

Getting Your Credentials

If you have your Sprout Social API token but need to find your other IDs, use these curl commands:

Step 1: Get your Customer ID

curl -X GET \
  https://api.sproutsocial.com/v1/metadata/client \
  -H "Authorization: Bearer YOUR_SPROUT_API_TOKEN"

This returns your customer ID and name.

Step 2: Get your Group IDs and Profile IDs

Replace YOUR_CUSTOMER_ID with the customer ID from Step 1:

curl -X GET \
  https://api.sproutsocial.com/v1/YOUR_CUSTOMER_ID/metadata/customer \
  -H "Authorization: Bearer YOUR_SPROUT_API_TOKEN"

This returns all your group IDs and profile IDs for each connected social network.

3. Build the Project

npm run build

Running the MCP Server

This is an MCP server that uses stdio transport and is designed to be registered with goose or other MCP clients.

To start the server directly:

npm start

For development with auto-reload:

npm run dev

Registering with goose

To register this MCP server with goose, add it to your goose configuration. The server uses stdio transport, so it should be configured as a local MCP server in your goose settings.

Available Tools

1. uploadMediaFromUrl

Upload media (images or videos) to Sprout Social from a public URL.

Parameters:

  • media_url (string, required): Public HTTP/HTTPS URL to the media file

Returns:

{
  "success": true,
  "media_id": "string",
  "expiration_time": "ISO8601 timestamp"
}

Example:

await uploadMediaFromUrl({
  media_url: "https://example.com/image.jpg"
});

2. createDraftPost

Create a draft post in Sprout Social (not scheduled, requires manual publishing).

Parameters:

  • text (string, required): The text content of the post
  • customer_profile_ids (number[], required): Array of Sprout profile IDs to post to
  • media (array, optional): Array of media objects with media_id and media_type ("PHOTO" or "VIDEO")

Returns:

{
  "success": true,
  "request": { /* payload sent */ },
  "response": { /* Sprout API response */ }
}

Example:

await createDraftPost({
  text: "Check out our latest update! 🚀",
  customer_profile_ids: [12345, 67890],
  media: [{
    media_id: "media_abc123",
    media_type: "PHOTO"
  }]
});

3. createScheduledPost

Create a draft post scheduled for future publication.

Parameters:

  • text (string, required): The text content of the post
  • customer_profile_ids (number[], required): Array of Sprout profile IDs to post to
  • scheduled_times (string[], required): Array of ISO8601 UTC timestamps (e.g., "2025-11-20T15:00:00Z")
  • media (array, optional): Array of media objects with media_id and media_type

Returns:

{
  "success": true,
  "request": { /* payload sent */ },
  "response": { /* Sprout API response */ }
}

Example:

await createScheduledPost({
  text: "Scheduled post for tomorrow! 📅",
  customer_profile_ids: [12345],
  scheduled_times: ["2025-11-21T14:00:00Z"],
  media: [{
    media_id: "media_xyz789",
    media_type: "VIDEO"
  }]
});

4. getConfiguredProfiles

Get the configured Sprout Social profile IDs from environment variables.

Parameters: None

Returns:

{
  "linkedin_company": "12345",
  "twitter": "67890",
  "youtube": "11111",
  "bluesky": "22222",
  "group_id": "999",
  "customer_id": "888"
}

Example:

await getConfiguredProfiles();

5. createPostFromContent

Unified tool that handles media upload (if needed) and post creation in one call. This is the recommended tool for most use cases.

Parameters:

  • caption (string, required): The text content of the post
  • customer_profile_ids (number[], required): Array of Sprout profile IDs to post to
  • media_url (string, optional): Public URL to media file
  • media_type (enum, optional): "PHOTO" or "VIDEO" (defaults to "PHOTO")
  • schedule_time (string, optional): ISO8601 UTC timestamp for scheduling

Returns:

{
  "success": true,
  "request_sent": { /* payload sent */ },
  "sprout_response": { /* Sprout API response */ }
}

Example (draft post with media):

await createPostFromContent({
  caption: "New product launch! 🎉",
  customer_profile_ids: [12345, 67890],
  media_url: "https://example.com/product.jpg",
  media_type: "PHOTO"
});

Example (scheduled post):

await createPostFromContent({
  caption: "Tomorrow's announcement 📢",
  customer_profile_ids: [12345],
  schedule_time: "2025-11-21T10:00:00Z"
});

Typical Workflow

Option 1: Using Individual Tools

// 1. Upload media
const upload = await uploadMediaFromUrl({
  media_url: "https://example.com/image.jpg"
});

// 2. Create scheduled post with media
await createScheduledPost({
  text: "Check this out! 🎨",
  customer_profile_ids: [12345, 67890],
  scheduled_times: ["2025-11-21T15:00:00Z"],
  media: [{
    media_id: upload.media_id,
    media_type: "PHOTO"
  }]
});

Option 2: Using the Unified Tool (Recommended)

// Single call handles everything
await createPostFromContent({
  caption: "Check this out! 🎨",
  customer_profile_ids: [12345, 67890],
  media_url: "https://example.com/image.jpg",
  media_type: "PHOTO",
  schedule_time: "2025-11-21T15:00:00Z"
});

Finding Your Profile IDs

To find your Sprout Social profile IDs:

  1. Log in to Sprout Social
  2. Navigate to PublishingCompose
  3. Use your browser's developer tools (Network tab) when selecting profiles
  4. Look for API calls to see the customer_profile_id values
  5. Alternatively, contact Sprout Social support for assistance

Notes

  • All posts are created as drafts by default and require approval in Sprout Social before publishing
  • Media files must be publicly accessible via HTTP/HTTPS URLs
  • Uploaded media has an expiration time (returned in the upload response)
  • Scheduled times must be in ISO8601 UTC format (e.g., "2025-11-20T15:00:00Z")
  • The server uses stdio transport, making it suitable for local MCP integration

Error Handling

All tools return a JSON response with a success field:

  • success: true - Operation completed successfully
  • success: false - Operation failed (includes error field with details)

Security

  • Never commit your .env file or expose your API credentials
  • The .gitignore file is configured to exclude environment files
  • Store credentials securely and rotate them regularly

API Reference

This server uses the Sprout Social Publishing API. For more details on the API capabilities and limitations, refer to the official Sprout Social API documentation.

Future Improvements

  1. Add support for publishing (not just drafts)
  2. Implement post editing and deletion
  3. Add support for post analytics retrieval
  4. Implement bulk operations for multiple posts
  5. Add validation for network-specific content requirements
  6. Support for additional media types and formats