> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postqueen.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> PostQueen's hosted API is https://api.postqueen.ai. The public API base is https://api.postqueen.ai/public/v1 and takes the raw API key in the Authorization header, with no Bearer prefix.
> The MCP server for posting is https://api.postqueen.ai/mcp/YOUR_API_KEY (or /mcp with Authorization: Bearer YOUR_API_KEY). docs.postqueen.ai/mcp only searches these docs and cannot post.
> The API key is under Connections > API Keys in the app, and only workspace admins can see it.

# Muse Code

> Connect Muse Code, Meta's coding agent for the terminal and CI, to PostQueen with one entry in its settings file.

export const AgentStatus = ({status, label, children}) => {
  const look = ({
    tested: {
      color: 'green',
      icon: 'badge-check'
    },
    'partly-tested': {
      color: 'green',
      icon: 'badge-check'
    },
    'vendor-docs': {
      color: 'surface',
      icon: 'book-open'
    },
    'not-possible': {
      color: 'gray',
      icon: 'circle-slash'
    }
  })[status] || ({
    color: 'gray',
    icon: 'circle-question-mark'
  });
  const cut = status === 'partly-tested' ? -1 : (label || '').indexOf(', ');
  const rest = cut > 0 ? label.slice(cut + 2) : '';
  const pill = status === 'partly-tested' ? 'Partly tested' : cut > 0 ? label.slice(0, cut) : label;
  const note = status === 'partly-tested' ? label : cut > 0 ? rest.charAt(0).toUpperCase() + rest.slice(1) + '.' : null;
  return <div className="pq-status not-prose" data-status={status}>
      <Badge color={look.color} shape="pill" size="md" icon={look.icon}>{pill}</Badge>
      {note || children ? <span className="pq-status-note">
          {note}
          {note && children ? ' ' : null}
          {children}
        </span> : null}
    </div>;
};

<AgentStatus status="vendor-docs" label="From the vendor's docs, not tested by PostQueen yet" />

Muse Code is Meta's coding agent for the terminal and CI, built on Muse Spark. Add PostQueen to its settings file and Muse Code can list your channels, draft and schedule posts from your repo, and report how published posts did.

## Before you start

* **Plans:** pay as you go per token, or the Everyday, High and Power subscriptions. You need a Meta account, and availability varies by region.
* **Platforms:** the terminal and CI on macOS, Linux and Windows.
* **A PostQueen API key.** A workspace admin copies it, or the ready-made address, from **Connections**.

<Info>
  **Where the API key is:** in the app, open **Connections > API Keys**. Only a workspace Admin or Super Admin can reveal or rotate it; other members see it masked. A workspace has one key, and each agent card on **Connections** shows your MCP address with the key already filled in.
</Info>

## Connect Muse Code

Muse Code has no `mcp add` command. You add PostQueen by editing its settings file.

<Steps>
  <Step title="Open the settings file">
    Open `~/.config/muse/settings.json`, or create it.
  </Step>

  <Step title="Add PostQueen">
    Add the `postqueen` entry under `mcp_servers`, with your key in place of `YOUR_API_KEY`. Keep `"schema_version": 1` at the top of the file.

    ```json ~/.config/muse/settings.json theme={"system"}
    {
      "schema_version": 1,
      "mcp_servers": {
        "postqueen": {
          "transport": "streamable_http",
          "url": "https://api.postqueen.ai/mcp/YOUR_API_KEY",
          "mode": "optional"
        }
      }
    }
    ```
  </Step>

  <Step title="Restart Muse Code">
    Restart Muse Code, then type `/mcp` to see the PostQueen tools.
  </Step>
</Steps>

## Check that it works

Ask Muse Code: "List my PostQueen channels." It answers with the channels you connected in PostQueen. If `/mcp` does not list PostQueen, check the settings file against the example above.

## Good to know

* **`"schema_version": 1` is required.** Without it every command fails with a malformed settings file error.
* **Keep `"mode": "optional"`.** Servers are required by default, and a required server that fails stops the run.
* **The file holds your key** when you use the key address. Keep it private, or use the header form below.
* **Ask for drafts when you want to check first.** A draft waits on your PostQueen calendar, and nothing publishes until you schedule it.
* **What it cannot do over MCP:** delete a post, or change a post's text or time. Do that on the calendar in the app. [The MCP tools](/mcp/tools) lists what it can do.

## Other ways to connect

| Way                    | Address                                      | Status                            |
| ---------------------- | -------------------------------------------- | --------------------------------- |
| The key in the address | `https://api.postqueen.ai/mcp/YOUR_API_KEY`  | From Meta's docs. The route above |
| The Bearer header      | `https://api.postqueen.ai/mcp`               | From Meta's docs                  |
| Sign in with PostQueen | `https://api.postqueen.ai/mcp-oauth-dynamic` | Not tested yet                    |

<Tabs>
  <Tab title="Bearer header">
    ```json ~/.config/muse/settings.json theme={"system"}
    {
      "schema_version": 1,
      "mcp_servers": {
        "postqueen": {
          "transport": "streamable_http",
          "url": "https://api.postqueen.ai/mcp",
          "headers": { "Authorization": "Bearer YOUR_API_KEY" },
          "mode": "optional"
        }
      }
    }
    ```
  </Tab>

  <Tab title="Sign in (not tested yet)">
    Set `"url"` to `https://api.postqueen.ai/mcp-oauth-dynamic` with no headers, then run:

    ```bash theme={"system"}
    muse mcp login postqueen
    ```

    Muse Code registers itself and opens the PostQueen sign-in, which a workspace admin approves. The sign-in address has 20 tools, all but `ask_postqueen`. Revoke access in PostQueen under **Connections > Approved Apps**.
  </Tab>
</Tabs>

## Try this first

```text wrap theme={"system"}
Read the last five commits and write a short Bluesky post about what changed. Save it in PostQueen as a draft for tomorrow at 10am.
```

The draft appears on your PostQueen calendar, ready for you to check and schedule. [Prompts to try](/mcp/examples) has more.

## Troubleshooting

| Symptom                                                  | Fix                                                                                                 |
| -------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| Every command fails with a malformed settings file error | Add `"schema_version": 1` at the top of `settings.json`.                                            |
| A run stops when PostQueen cannot be reached             | Set `"mode": "optional"` on the `postqueen` entry.                                                  |
| `/mcp` does not list PostQueen                           | Restart Muse Code after saving, and check the JSON is valid.                                        |
| The key is refused                                       | Copy it again from **Connections > API Keys**. Only a workspace Admin or Super Admin can reveal it. |

More fixes are on [Troubleshooting agents](/agents/troubleshooting).

## Is it the same as Muse?

No. Meta ships two agents with the Muse name, and they connect to PostQueen in different ways:

| Product                   | What it is                                                        | How it connects                              |
| ------------------------- | ----------------------------------------------------------------- | -------------------------------------------- |
| **Muse Code** (this page) | Meta's coding agent for the terminal and CI                       | PostQueen's MCP address in its settings file |
| [Muse](/agents/muse)      | Meta's personal agent in the Muse app, on muse.ai and in WhatsApp | Not by address yet                           |

## Next steps

<CardGroup cols={2}>
  <Card title="Every agent" icon="bot" href="/agents/overview">
    Which agents can post to PostQueen, how each one connects, and what PostQueen has tested.
  </Card>

  <Card title="The MCP tools" icon="wrench" href="/mcp/tools">
    What each of the 21 tools does, and what an agent cannot do.
  </Card>

  <Card title="Prompts and tool calls" icon="messages-square" href="/mcp/examples">
    The order an agent calls the tools in, with prompts that work.
  </Card>

  <Card title="Troubleshooting agents" icon="life-buoy" href="/agents/troubleshooting">
    What to do when a connection or a command fails.
  </Card>
</CardGroup>
