---
title: "Connect OpenCode to 1Post over MCP"
url: "https://get1post.com/assistants/opencode.md"
canonical_url: "https://get1post.com/assistants/opencode"
last_updated: "2026-10-26"
type: "how-to"
summary: "Add the 1Post MCP server to OpenCode: the exact settings, how to sign in or use a key, and a request and reply to check it works."
related: ["https://get1post.com/assistants.md", "https://get1post.com/docs/mcp.md", "https://get1post.com/docs/mcp-oauth.md", "https://get1post.com/docs/api-authentication.md"]
---

# Connect OpenCode to 1Post over MCP

Add the 1Post MCP server to OpenCode: the exact settings, how to sign in or use a key, and a request and reply to check it works.

Connect OpenCode to 1Post by adding the MCP server at https://api.get1post.com/v1/mcp with your API key, or at https://api.get1post.com/v1/mcp/oauth to sign in. OpenCode then lists your accounts, schedules posts and reads results with your role. The steps and the exact OpenCode settings are below; actions that cancel or reply need confirmation.

## Set up OpenCode

1. Open the file. Edit opencode.json in your project or your global OpenCode config.
2. Add the server. Add the remote entry below under mcp. Turn off the automatic sign-in when you use a key.
3. Or sign in. Use the sign-in address with no headers, then run opencode mcp auth 1post.
4. Check the connection. Start OpenCode and ask it to list your 1Post accounts.

## The OpenCode settings

**opencode.json, with a key**

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "1post": {
      "type": "remote",
      "url": "https://api.get1post.com/v1/mcp",
      "enabled": true,
      "oauth": false,
      "headers": {
        "Authorization": "Bearer op_live_YOUR_KEY"
      }
    }
  }
}
```

**opencode.json, with sign-in**

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "1post": {
      "type": "remote",
      "url": "https://api.get1post.com/v1/mcp/oauth",
      "enabled": true
    }
  }
}
```

OpenCode detects a sign-in requirement from a 401 reply and handles it, so the sign-in entry needs no oauth block.

## A request and its reply

Once connected, OpenCode sends tool calls like this one when you ask it to schedule a post. Account ids come from list_accounts.

**Tool call**

```json
{
  "name": "create_post",
  "arguments": {
    "accounts": [
      "ACCOUNT_ID"
    ],
    "text": "Doors open at nine.",
    "schedule_at": "2026-11-02T15:00:00Z"
  }
}
```

**Reply, abridged**

```json
{
  "id": "POST_ID",
  "status": "scheduled",
  "scheduled_at": "2026-11-02T15:00:00.000Z",
  "accounts": [
    {
      "account_id": "ACCOUNT_ID",
      "status": "queued"
    }
  ]
}
```

## What the connection can do

| Tool | What it does | Needs |
| --- | --- | --- |
| list_accounts | Lists connected accounts and their state | Read |
| create_post | Saves, schedules or publishes a post | Write |
| get_post | Reads one post and the result for each account | Read |
| cancel_post | Cancels a post that has not started | Write and confirm: true |

The connection acts with the role of the member who made the key or signed in, so a contributor's posts still go to review. The full tool list is on the [MCP page](https://get1post.com/docs/mcp.md).

## Questions

**Why is oauth set to false in the key example?**

It stops OpenCode from starting a sign-in for a server that already has a key.

**What can OpenCode do once it is connected?**

It can list your accounts, create and update posts, read results and analytics, and cancel or reply when you confirm. It cannot do more than the member behind the key or sign-in.

## Sources

- [OpenCode documentation: MCP servers](https://opencode.ai/docs/mcp-servers/), read 2026-10-26

## Related

- [Connect an assistant to 1Post over MCP](https://get1post.com/assistants.md)
- [The MCP server: 1Post docs](https://get1post.com/docs/mcp.md)
- [MCP sign-in with OAuth: 1Post docs](https://get1post.com/docs/mcp-oauth.md)
- [API authentication and keys: 1Post docs](https://get1post.com/docs/api-authentication.md)
