# Connect PubNio MCP to OpenCode

Human page: https://pubnio.com/opencode
Hosted MCP URL: https://pubnio.com/mcp

## Summary

Register PubNio in OpenCode with opencode mcp add pubnio --url https://pubnio.com/mcp and opencode mcp auth pubnio. After browser OAuth completes, OpenCode can use the search and execute tools to inspect workspace accounts, publish from text plus an account or platform, and confirm live social deliveries across 7 platforms.

## Install (Terminal · OpenCode CLI)

```shell
opencode mcp add pubnio --url https://pubnio.com/mcp
opencode mcp auth pubnio
```

## Setup steps

1. **Register the remote MCP server:** Run opencode mcp add pubnio --url https://pubnio.com/mcp to configure PubNio's hosted Streamable HTTP transport.
2. **Authenticate your workspace session:** Run opencode mcp auth pubnio and finish OAuth consent in your browser. OpenCode receives a delegated token scoped to your workspace.
3. **Run end-to-end publishing workflows:** Ask OpenCode to create and publish a post, then read the post to verify each target. Use queues when the workflow needs scheduled slots.

## Example prompt

> List my PubNio accounts, publish a LinkedIn document post from docs/launch-deck.pdf and a matching X thread, then wait for confirmation.

## Expected Code Mode flow

```text
search   -> find post and delivery operations
execute  -> list ready accounts => { accounts: [linkedin: ready, x: ready] }
execute  -> create post { text, media: [{ mediaId: "med_pdf" }], platforms: ["linkedin"] } => { postId: "pst_01j9..." }
execute  -> create post { text, platforms: ["x"] } => { postId: "pst_01j9..." }
execute  -> read posts until settled => linkedin: published, x: published
```

## FAQs

### Does OpenCode use the exact same PubNio contract as the REST API and CLI?

Yes. The hosted MCP server's search and execute tools reach the same HTTP operations and schemas as the pnio CLI, so workspace IDs, post revisions, and error codes match everywhere.

### Which administrative actions stay outside MCP?

Human-only actions stay in the workspace: API keys, workspace settings, account authorization, and destructive admin operations. The server filters search results and rejects execute calls by the same workspace role and token scope as the HTTP API; connecting an account is a browser handoff.
