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 install2. Configure Environment Variables
Set the following environment variables with your Sprout Social credentials:
Required:
SPROUT_API_TOKEN- Your Sprout Social API tokenSPROUT_CUSTOMER_ID- Your Sprout Social customer IDSPROUT_GROUP_ID- Your Sprout Social group ID
These will vary based on your workflow:
SPROUT_PROFILE_ID_LINKEDIN- LinkedIn profile IDSPROUT_PROFILE_ID_TWITTER- Twitter/X profile IDSPROUT_PROFILE_ID_YOUTUBE- YouTube profile IDSPROUT_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 buildRunning 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 startFor development with auto-reload:
npm run devRegistering 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 postcustomer_profile_ids(number[], required): Array of Sprout profile IDs to post tomedia(array, optional): Array of media objects withmedia_idandmedia_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 postcustomer_profile_ids(number[], required): Array of Sprout profile IDs to post toscheduled_times(string[], required): Array of ISO8601 UTC timestamps (e.g., "2025-11-20T15:00:00Z")media(array, optional): Array of media objects withmedia_idandmedia_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 postcustomer_profile_ids(number[], required): Array of Sprout profile IDs to post tomedia_url(string, optional): Public URL to media filemedia_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:
- Log in to Sprout Social
- Navigate to Publishing → Compose
- Use your browser's developer tools (Network tab) when selecting profiles
- Look for API calls to see the
customer_profile_idvalues - 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 successfullysuccess: false- Operation failed (includeserrorfield with details)
Security
- Never commit your
.envfile or expose your API credentials - The
.gitignorefile 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
- Add support for publishing (not just drafts)
- Implement post editing and deletion
- Add support for post analytics retrieval
- Implement bulk operations for multiple posts
- Add validation for network-specific content requirements
- Support for additional media types and formats
