# Building a ChatGPT Plugin for Your Social Hub

> How we connected ChatGPT to social media planning and review with MCP tools, OAuth scopes, Hub roles, and a human decision before publishing.

- Author: Georgii Sh
- Published: 2026-10-14
- Updated: 2026-10-14

---

# Building a ChatGPT Plugin for Your Social Hub

*How we connected an AI assistant to a social media workflow without handing it the publish button.*

“What’s waiting for review?” sounds simple. In a social media platform, the answer may sit across several client workspaces and calendars, behind different permissions, with more results than fit on one API page. “Turn this idea into a draft” adds a state change. “Publish it” is a different decision altogether.

We built the Your Social Hub plugin around those differences. ChatGPT can find plans, help write copy, save Ideas, and move a finished Idea into review. [Your Social Hub](https://www.yoursocialhub.online/) is where the team checks the work, clients approve it, and approved content is published. The engineering challenge was to make the assistant useful without giving a natural-language request more authority than the person who made it.

Here is how the integration maps natural-language requests onto a real product model, and where we put the limits.

## Give the model the right map

The data model has two branches:

![Your Social Hub domain model: calendars contain Ideas and Content, while Social Accounts provide Metrics](/blog-media/1791955458416-ysh-domain-map.svg)

A **Hub** owns the team's work and membership. A **Content Calendar** groups that work. An **Idea** is a planning entry; it cannot be published. **Content** is the publishable unit that goes through review. A **Social Account** belongs to a Hub, so performance data is queried by account rather than by calendar.

To inspect a review queue, the plugin resolves a Hub and Calendar, then lists Content. To analyse performance, it follows Hub → Social Accounts → posts and metrics. IDs come from the service, never from guesses based on names. Every operation checks the owning Hub.

“Find undated ideas and plan next week” works with Ideas; it may update dates after the user chooses a plan. “Send this Idea for review” promotes it into Content with status `in_review`. A generic “create post” tool would erase that distinction.

## Give each tool a recognisable job

The plugin combines an **MCP server** for live data and actions with **skills** for recurring workflows. The server enforces access and domain rules. A skill guides tool selection, pagination, and how to report incomplete results.

The connector exposes tools for finding Hubs and Calendars, reading and writing Ideas and Content, and reading account performance. Read-only `ysh://...` resources provide attachable context; filtered and paginated queries use tools. Skills cover jobs such as auditing a calendar, drafting captions, planning a week, and learning from top posts.

Skills can change as the workflow changes. Authorisation remains on the server. A prompt cannot grant access.

## Keep state changes inside domain operations

`promote_idea_to_content` takes an existing Idea ID and returns the Content item it creates. The model does not assemble that transition from several generic writes.

Here is the guarded path:

![Guarded Idea-to-Content promotion: user intent, OAuth scopes, Hub role, domain state, and human review](/blog-media/1791955504391-ysh-guarded-promotion.svg)

The server finds the record's Hub, checks membership and role, validates its state, then promotes it. Knowing an ID does not grant access to another client's workspace.

The plugin's 17 tools use separate permissions. `list_ideas` needs `ideas:read`; `create_idea` needs `ideas:write`; promotion needs both `ideas:write` and `content:write`. Metrics tools require `metrics:read` **and** the `admin` role in the relevant Hub. When a user has not granted a scope, the corresponding tool may be absent from the available toolset. Another tool must not be used to work around that decision.

## Permission has three layers

The OAuth flow uses protected-resource metadata, authorisation-server discovery, and an authorisation code with PKCE. For every request, the server checks the token's signature, issuer, expiry, intended audience or resource, and scopes. A token forwarded by ChatGPT does not get a free pass.

Access depends on three things: the **OAuth scope** granted to the connection, the user's **role** in the record's Hub, and the **current request**. An agency user can have different roles in different client Hubs. `metrics:read` does not make a `content_creator` an administrator.

### The user chooses the connection's permissions

When connecting Your Social Hub, the user chooses permissions for discovery, reading or writing Ideas and Content, and reading metrics. The scopes are selectable separately. Someone analysing a backlog can grant reads and leave writes unchecked. Without `ideas:write`, the plugin cannot save an Idea; without `content:write`, it cannot create or edit a Content draft. The user can authorise more access later or revoke the connection in Your Social Hub.

![Your Social Hub OAuth consent screen with selectable permissions](https://www.yoursocialhub.online/blog-media/1786877230814-2.png)

*The permission screen from [our Claude integration article](https://www.yoursocialhub.online/blog/generic-ai-knows-marketing-connected-ai-knows-your-marketing). It shows a Claude connection, not a ChatGPT setup screen.*

OAuth sets the connection's ceiling. A Hub role narrows it. The user's request determines the action: “show me a plan” calls for a proposal; “save this plan” calls for a write. We test both requests so a suggestion does not silently become a saved change.

Tool annotations help the client describe an operation, but the server enforces permissions.

## Keep the publish button with people

The connector can capture an Idea, edit eligible records, preview items, and create a Content draft for review. It exposes no tool to approve, reject, schedule, publish, or delete a post. Media uploads stay in the product.

Reviewers approve or request changes in the Review Portal. Promoted Content starts at `in_review`. Approval without a `publicationDate` does not mean it is scheduled. The [idea-to-publication walkthrough](https://www.yoursocialhub.online/blog/chatgpt-to-published-social-post) shows the full path.

People choose the idea, decide whether the copy represents the brand, select the accounts, and approve the final draft. The assistant prepares options and points out gaps. There is no publishing operation in the connector for it to invoke.

## Small API details can cause big mistakes

A conventional UI can hide awkward contracts. An LLM client needs them stated plainly in tool descriptions and checked with real requests.

| Contract | What the assistant must do |
| --- | --- |
| Pagination | `list_content` and `list_content_calendars` return a `total`. Follow the necessary pages before claiming an exhaustive list. |
| Dates | Content filters and `publicationDate` use full ISO-8601 timestamps; Idea date filters use calendar dates. Interpret “next Tuesday” in the user's timezone before converting to UTC. |
| Partial updates | An omitted field remains unchanged; `null` clears it. |
| File order | `fileOrder` is the complete ordered keep-list. Leave it out when editing only text, or existing attachments may leave the active record. |
| Metrics | `null` means unavailable or uncollected, not zero. State the selected `7d`, `30d`, or `90d` window and data availability. |
| Statuses | An Idea marked `sent` has already been promoted. Newly created Content enters `in_review`; approval and publication happen outside the connector. |

`fileOrder` sounds like a sorting hint, but supplying only one file ID changes which attachments remain active. The contract must say exactly what the field means; the assistant should not guess.

## Test the conversation and read back the result

Endpoint tests cover the API. Conversation tests show which tools the model chooses and whether its report matches stored state.

1. Ask for every item awaiting review; check the Hub, Calendar, and pagination.
2. Grant read-only scopes and ask to save a draft; verify that no write occurs. Try a known ID from another Hub.
3. Ask for one carousel Idea without a date or platforms; read it back and check type, format, date, and account IDs.
4. Promote an Idea; verify the created Content has status `in_review`. Repeat the request and check for duplicates.
5. Return an empty list, an uncollected metric, or an instruction-like string in a caption. Check that the answer stays accurate and treats stored copy as data.

MCP Inspector helps inspect individual tools. ChatGPT testing exposes the harder part: how the model chooses tools from a natural-language request and describes what happened. Hosted MCP changes and packaged skill updates can follow different release paths, so check both.

## What this buys the team

An LLM is another client of the service. It must find the right calendar, keep planning separate from publication, report missing data honestly, and act within the user's permissions.

For a social media team, ChatGPT can handle much of the preparation while Ideas and drafts remain visible to colleagues. Clients give feedback in the Review Portal. Your Social Hub publishes approved content and records what happened.

For your own SaaS integration, map entities and state transitions first. Expose domain actions through MCP, enforce OAuth scopes and roles on the server, and test what the assistant says against stored state. If your team plans and approves social content across clients, [see how Your Social Hub handles that workflow](https://www.yoursocialhub.online/).

