Back to Blog

How to Post to Twitter from VS Code with GitHub Copilot MCP (2026 Guide)

OpenTweet Team10 min read
How to Post to Twitter from VS Code with GitHub Copilot MCP (2026 Guide)

How to Post to Twitter from VS Code with GitHub Copilot MCP (2026 Guide)

VS Code is where you write code, review PRs, and debug production issues. Starting with VS Code 1.99, it's also where you can schedule tweets, create threads, and check your Twitter analytics -- without opening a browser tab.

GitHub Copilot's Agent Mode now supports MCP (Model Context Protocol) servers natively. That means you can connect VS Code to external services like Twitter through a simple config file. Pair that with the OpenTweet MCP server, and you get full Twitter management inside the editor 73% of developers already use.

This guide walks through the complete setup, from config to your first scheduled tweet.

Why Post to Twitter from VS Code?

If you're a developer, indie hacker, or DevRel, you already spend hours in VS Code every day. Context-switching to a browser to tweet about what you just shipped breaks your flow and rarely happens consistently.

With Copilot's Agent Mode and the OpenTweet MCP server, you can:

  • Tweet about your code with zero context switch. You just finished a feature. Tell Copilot to write a tweet about it. It can see the file you're editing.
  • Batch-schedule a week of content in one conversation. Sunday night planning session, right in your editor.
  • Check analytics between coding sessions. "How did my tweets perform this week?" -- without opening another tab.
  • Create technical threads from your actual code. Copilot can reference the file you have open and turn it into a thread explaining the algorithm, pattern, or architecture.

The world's most popular code editor meets the world's biggest developer social platform. No Twitter developer account required.

Prerequisites

Before you start, make sure you have:

  1. VS Code 1.99 or later -- MCP support in Copilot requires this version. Check yours with code --version.
  2. GitHub Copilot extension with an active subscription -- Copilot Free, Pro, or Business all work.
  3. An OpenTweet account with a connected X/Twitter account -- sign up here (7-day free trial, no credit card required).
  4. An OpenTweet API key -- create one from the Developer Dashboard.
  5. Node.js 18+ installed -- run node --version to check.

Step 1: Get Your OpenTweet API Key

If you don't have one yet:

  1. Go to opentweet.io/developer
  2. Click "Create API Key"
  3. Copy the key (it starts with ot_)

Keep this key handy. You'll need it in the next step.

No Twitter developer account or API keys are needed. OpenTweet handles the X API connection for you.

Step 2: Configure MCP in VS Code

This is where VS Code differs from every other MCP client. VS Code uses "servers" as the root key, not "mcpServers". This is the most common mistake people make, and it will silently fail if you get it wrong.

You have two options for configuring the server.

Method A: Workspace Config (Recommended)

This approach stores the config in your project so you can share it with your team. Create a file at .vscode/mcp.json in your project root:

{
  "inputs": [
    {
      "type": "promptString",
      "id": "opentweet-api-key",
      "description": "OpenTweet API Key",
      "password": true
    }
  ],
  "servers": {
    "opentweet": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@opentweet/mcp-server"],
      "env": {
        "OPENTWEET_API_KEY": "${input:opentweet-api-key}"
      }
    }
  }
}

The "inputs" block is what makes this approach secure. Instead of hardcoding your API key, VS Code will prompt you for it the first time you use the server. The "password": true flag masks the input so it doesn't appear on screen.

This means you can commit .vscode/mcp.json to your repo and share it with your team. Each person enters their own API key when prompted -- no secrets in version control.

Method B: User-Level Config

If you want OpenTweet available in every project (not just one workspace):

  1. Open the Command Palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows/Linux)
  2. Search for "MCP: Open User Configuration"
  3. Add the same server config to the file that opens

The user-level config uses the same format. The "inputs" feature works here too, so your API key stays secure regardless of which method you choose.

Common Pitfall: servers vs mcpServers

To be absolutely clear: the root key must be "servers", not "mcpServers". Here's a comparison:

// CORRECT for VS Code
{
  "servers": {
    "opentweet": { ... }
  }
}

// WRONG for VS Code (this is the Claude Desktop format)
{
  "mcpServers": {
    "opentweet": { ... }
  }
}

If you've configured MCP servers in Claude Desktop or Cursor before, muscle memory will get you here. Double-check the key name.

Step 3: Enable Agent Mode

MCP tools only work in Copilot's Agent Mode. This is not the default chat mode, so you need to switch.

  1. Open the Chat panel with Cmd+Shift+I (macOS) or Ctrl+Shift+I (Windows/Linux)
  2. Look at the mode dropdown at the top of the chat panel
  3. Select "Agent" from the dropdown -- not "Edit" and not "Chat"

Once in Agent mode, click the tools icon (it looks like a wrench or plug icon) in the chat input area. You should see the OpenTweet tools listed:

  • opentweet_create_tweet
  • opentweet_create_thread
  • opentweet_list_tweets
  • opentweet_batch_schedule
  • opentweet_get_analytics
  • ...and 13 more

If you see them, you're connected. If you don't, check the troubleshooting section below.

Step 4: Schedule Your First Tweet

With Agent Mode active and the OpenTweet server connected, just type a natural language request in the chat:

"Schedule a tweet saying 'Just set up MCP in VS Code -- I can now tweet without leaving my editor' for tomorrow at 9am"

Copilot will call the opentweet_create_tweet tool, create the tweet as a draft, then schedule it using opentweet_batch_schedule. You'll see the tool calls in the chat output so you know exactly what happened.

Practical Workflows for Developers

Here are five workflows that make the VS Code + Twitter combination practical, not just a novelty.

1. Tweet About the Feature You're Working On

You have a file open. You just finished implementing something. Without switching apps:

"Look at the file I have open and write a tweet about the feature I just implemented. Keep it technical but accessible. Schedule it for tomorrow at 10am."

Copilot reads the active file, understands the code, and writes a tweet grounded in what you actually built. No generic "just shipped a new feature" filler.

2. Create a Thread Explaining Your Code

Threads perform well on developer Twitter, especially when they explain real code.

"Create a 4-tweet thread explaining the caching strategy in this file. Include the problem it solves, the approach, and the performance improvement. Save it as a draft so I can review it."

3. Plan a Week of Content

Sunday evening, 10 minutes, editor open:

"Generate 5 tweets for next week about React Server Components. Mix practical tips, common mistakes, and opinions. Schedule them Monday through Friday at 9am EST."

Copilot creates five tweets with variety in format and angle, then batch-schedules them in one operation.

4. Check Your Analytics

Between coding sessions:

"What's my tweet engagement rate this month? Show me my top 3 performing tweets."

"What are my best posting times based on past performance?"

Copilot pulls your analytics from OpenTweet and summarizes them right in the chat.

5. Build-in-Public Updates

After committing code:

"I just committed changes to the auth module. Write a build-in-public tweet about what I changed and why. Make it sound like a developer talking to other developers, not a press release."

VS Code-Specific Tips

Secure Credential Handling with Inputs

The "inputs" feature is unique to VS Code's MCP configuration. It lets you define variables that are prompted at runtime:

{
  "inputs": [
    {
      "type": "promptString",
      "id": "opentweet-api-key",
      "description": "OpenTweet API Key",
      "password": true
    }
  ]
}

Then reference it in your server config with ${input:opentweet-api-key}. This is the right way to handle API keys -- no plaintext secrets in config files, no environment variable leaks.

Share Config with Your Team

Because .vscode/mcp.json uses input prompts for credentials, you can safely commit it to version control. Every team member gets the same MCP server setup; they just enter their own API key when VS Code asks.

This is especially useful for DevRel teams or marketing teams who all post from different X accounts.

Works Alongside Other Copilot Features

Adding MCP servers doesn't change how Copilot works for code. You still get:

  • Inline code completions
  • Chat mode for code questions
  • Edit mode for refactoring
  • Agent mode for multi-step tasks (now including Twitter)

The MCP tools are only available in Agent mode. The other modes continue working exactly as before.

Multi-Account Support

If you manage multiple X/Twitter accounts through OpenTweet, you can target a specific account by telling Copilot:

"Schedule this tweet to my @companyname account"

Or be explicit:

"List my connected X accounts, then schedule this tweet to the second one"

Copilot will use the x_account_id parameter on the MCP tools to route to the right account. This works on the Pro plan (1 account), Advanced (3 accounts), and Agency (10 accounts).

Troubleshooting

Tools Not Appearing in the Chat Panel

The most common cause: you're not in Agent mode. MCP tools are only available when the mode dropdown says "Agent." Switch from "Chat" or "Edit" to "Agent" and the tools should appear.

Config File Has No Effect

Check the root key. VS Code requires "servers", not "mcpServers". This is different from Claude Desktop, Cursor, and most other MCP clients. If you copied a config from another tool, this is almost certainly the issue.

Wrong Config File Location

The workspace config must be at .vscode/mcp.json -- not .vscode/settings.json, not mcp.json in the project root. The file name and path both matter.

"Cannot find module @opentweet/mcp-server"

Make sure Node.js 18+ is installed. Run node --version to verify. The npx command downloads the package automatically, but it needs a working Node.js installation.

"OPENTWEET_API_KEY is required"

Your API key isn't reaching the server. If you're using the "inputs" approach, make sure the ${input:opentweet-api-key} placeholder exactly matches the "id" in your inputs array. If you're hardcoding the key, double-check the "env" block.

Server Appears but Tools Time Out

If the server connects but tool calls hang, try restarting it. Open the Command Palette, search for "MCP: Restart Server", and select the OpenTweet server. If that doesn't work, check that port 443 (HTTPS) isn't blocked by a firewall or corporate proxy.

Requires VS Code 1.99+

MCP support in Copilot was introduced in VS Code 1.99 (April 2025). If you're on an older version, update VS Code first.

Frequently Asked Questions

Does VS Code need to be open for scheduled tweets to post?

No. When you schedule a tweet, it's saved on OpenTweet's servers. OpenTweet handles the actual publishing at the scheduled time. You can close VS Code, shut down your computer -- the tweets still go out on schedule.

Can I use this without a GitHub Copilot subscription?

You need an active GitHub Copilot subscription for Agent Mode. Copilot Free, Copilot Pro, and Copilot Business all support MCP in Agent Mode. Without Copilot, the MCP configuration won't do anything.

Is this the same MCP server that works with Claude Desktop?

Yes. The @opentweet/mcp-server npm package is the same across all MCP clients -- Claude Desktop, Claude Code, Cursor, Windsurf, Cline, and VS Code with Copilot. The only difference is the config format. VS Code uses "servers" instead of "mcpServers" and supports the "inputs" feature for secure credential handling.

How many tools does the OpenTweet MCP server provide?

18 tools covering the full Twitter workflow: create tweets, create threads, list tweets, get tweet details, update tweets, delete tweets, publish immediately, batch schedule, upload media, get analytics, get account status, list connected X accounts, and 6 evergreen queue tools for automated reposting. Plus 4 resources and 4 built-in prompts.

Get Started

Here's the complete path from zero to tweeting from VS Code:

  1. Sign up for OpenTweet (7-day free trial, no credit card)
  2. Connect your X/Twitter account in the dashboard
  3. Create an API key
  4. Create .vscode/mcp.json with the config above
  5. Open Copilot Chat in Agent mode
  6. Schedule your first tweet

You're already in VS Code building things. Now you can tell people about it without switching apps.


Related guides:

The OpenTweet MCP server is open-source and available on npm. Works with VS Code, Claude Desktop, Claude Code, Cursor, Windsurf, Cline, and any MCP-compatible client. Learn more at opentweet.io/mcp.

Start Scheduling Your X Posts Today

Join hundreds of creators using OpenTweet to stay consistent, save time, and grow their audience.

7-day free trial
Only $11.99/mo
Cancel anytime