# How to connect OpenCode to LinkedIn, step by step

Source: https://finchreach.com/guides/opencode
Third-party facts checked on 2026-10-28.

Create an API key at finchreach.com/api-keys, connect LinkedIn at finchreach.com/accounts, then add `https://mcp.finchreach.com/mcp` to OpenCode with the header `Authorization: Bearer lk_…`. Test with a read, and approve the first draft under Approvals.

## What you need

- A Finchreach account (sign in at [finchreach.com](https://finchreach.com/sign-in)) and the LinkedIn account you want OpenCode to work on.
- OpenCode.
- About five minutes.

## Step 1: Create a Finchreach API key

1. Sign in at finchreach.com and open [API keys](https://finchreach.com/api-keys).
2. Create a key and name it after the tool, for example “OpenCode”.
3. Copy it right away: it starts with `lk_` and is shown only once.

## Step 2: Connect your LinkedIn account

1. Open [Accounts](https://finchreach.com/accounts) and click to connect LinkedIn.
2. Follow the steps until the account shows as connected.

Approval mode is on by default: nothing the assistant drafts reaches LinkedIn until you approve it.

## Step 3: Add Finchreach to OpenCode

1. Add the entry below to `opencode.json` (or `opencode.jsonc`) in your project or global config.
2. Set `FINCHREACH_API_KEY=lk_YOUR_KEY` in your environment.
3. Run `opencode mcp list` to see it, and `opencode mcp debug finchreach` if it doesn’t connect.

opencode.json:
```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "finchreach": {
      "type": "remote",
      "url": "https://mcp.finchreach.com/mcp",
      "enabled": true,
      "oauth": false,
      "headers": {
        "Authorization": "Bearer {env:FINCHREACH_API_KEY}"
      }
    }
  }
}
```

Headers are supported, with `{env:VAR}`. Set `"oauth": false`: otherwise a 401 (for example a missing key) starts OAuth discovery instead of reporting the bad key. (Leaving out `headers` and `oauth` to sign in with Finchreach’s OAuth should also work, but we haven’t tested it.)

## Step 4: Test the connection

In OpenCode, start with a read. It runs right away and proves the key and the account work:

> Ask your assistant: “List my connected LinkedIn accounts, then summarize my five latest notifications.”

You should see calls to `linkedin_list_accounts` and `linkedin_get_notifications`. Then try a write, which goes to your approval queue instead of LinkedIn:

> Ask your assistant: “Draft a short LinkedIn post saying I’m trying a new AI assistant workflow. Submit it for my approval.”

## Step 5: Approve or reject it in Finchreach

1. Open [Approvals](https://finchreach.com/approvals). The draft is there with its exact text and the account it would go out from.
2. Approve it to publish, or reject it (reject the test post if you don’t want it live).
3. OpenCode can check the result with `linkedin_get_action`: pending, approved, rejected, executed, failed or expired.

## Troubleshooting

- If OpenCode tries to open a browser to sign in, `"oauth": false` is missing or the key is wrong.
- 401 or “unauthorized”: the key is wrong, revoked or missing its prefix. Finchreach accepts `Authorization: Bearer lk_…` or `X-API-Key: lk_…`; check for a missing `Bearer `, quotes or a trailing space.
- A tool is missing: the key’s permissions don’t include it. Create a key with the permissions you need under [API keys](https://finchreach.com/api-keys).
- “No LinkedIn account”: connect one under [Accounts](https://finchreach.com/accounts), or reconnect it if its session expired.
- A post or message “didn’t go out”: it is probably still waiting under [Approvals](https://finchreach.com/approvals). Writes run only after you approve them.

Still stuck? Compare your setup with [OpenCode’s documentation](https://opencode.ai/docs/mcp-servers/), checked on 2026-10-28; client screens change often.

## What to ask OpenCode next

> Ask your assistant: “Write a LinkedIn post about the open-source tool in this repo, for people who’ve never heard of it.”

> Ask your assistant: “Search LinkedIn for developers who posted about terminal agents and summarize their takes.”

> Ask your assistant: “Draft replies to the LinkedIn comments on my last post.”

More ideas on the [OpenCode integration page](https://finchreach.com/integrations/opencode).

## Questions

### I lost my API key. Can I see it again?

No, a key is shown only once. Create a new one under [API keys](https://finchreach.com/api-keys), put it in your config, and revoke the old one.

### Does OpenCode see my LinkedIn password?

No. OpenCode only gets your Finchreach API key. Your LinkedIn connection stays in Finchreach, and you can revoke the key at any time without touching LinkedIn.

### Can I use the same key in several tools?

Yes, but one key per tool (for example one named “OpenCode”) lets you revoke one without breaking the others.

### How do I disconnect OpenCode?

Revoke its key under [API keys](https://finchreach.com/api-keys); OpenCode gets a 401 from then on. Then remove the server from its config.

## Sources

- [OpenCode docs](https://opencode.ai/docs/mcp-servers/)

## Related

- [What OpenCode can do on LinkedIn](https://finchreach.com/integrations/opencode)
- [Run your LinkedIn job search from the terminal with OpenCode](https://finchreach.com/blog/opencode-linkedin-job-search)
- [Quickstart and tools](https://finchreach.com/docs)
- [All setup guides](https://finchreach.com/guides)
