VS Code MCP Server Setup: Add X (Twitter) Data
Add an X (Twitter) data server to VS Code with mcp.json: the settings, OAuth sign-in, an API key input, the Agent tool picker and a real run's cost.
Tarun Khatri
Published · Updated · 7 min read
To set up an MCP server in VS Code for X (Twitter) data, add Weir's URL to mcp.json and sign in when VS Code asks.
Copilot's Agent can then search X, read threads and pull public profiles while you code. It only reads, so it never posts as you. We run Weir.
Paste this into .vscode/mcp.json, or your user mcp.json:
{
"servers": {
"weir": { "type": "http", "url": "https://api.weirapp.io/mcp" }
}
}
VS Code MCP setup: add Weir as an HTTP server
You need VS Code 1.99 or later, Copilot access in VS Code and a free Weir account.
- Add the serverRun MCP: Add Server from the Command Palette and choose HTTP.
- Paste the URLEnter https://api.weirapp.io/mcp, then the ID weir.
- Pick a fileChoose workspace or user mcp.json, the route Weir's docs cover. More on this below.
- Trust and sign inApprove any trust prompt, then sign in to Weir in the browser that opens.
- Ask the free questionIn Agent, ask "What's my Weir usage?" It calls get_usage, which is free.
Which file? VS Code's own format sits in .vscode/mcp.json or your user mcp.json, under servers. VS Code's MCP guide now marks those choices deprecated in the Add Server flow, but says they "remain available for compatibility".
The newer Copilot Global choice writes ~/.copilot/mcp-config.json, which uses an mcpServers key instead. Weir's docs cover the mcp.json route, and we haven't tried sign-in from the Copilot file yet.
From a terminal, one command adds Weir to your user profile:
code --add-mcp '{"name":"weir","type":"http","url":"https://api.weirapp.io/mcp"}'
The workspace file is safe to commit. It holds only the URL, and each teammate signs in to their own Weir account.
How does VS Code sign in to a remote MCP server?
VS Code handles OAuth for you. Its guide for server authors says it first tries dynamic client registration, a way for VS Code to sign itself up with the server. Weir supports it, so there's no client ID to paste.
- The browser opens once. Approve on Weir's consent screen, and VS Code keeps the token.
- Check it later in VS Code's Accounts menu.
- Start over with "Authentication: Remove Dynamic Authentication Providers" in the Command Palette.
- Cut it off from Weir's side under API keys in your dashboard, where the connection is listed.
Rather use a key? Weir's docs show an input variable. VS Code asks for the key the first time the server starts, so it never sits in the file:
{
"inputs": [
{
"type": "promptString",
"id": "weir-api-key",
"description": "Weir API key",
"password": true
}
],
"servers": {
"weir": {
"type": "http",
"url": "https://api.weirapp.io/mcp",
"headers": { "Authorization": "Bearer ${input:weir-api-key}" }
}
}
}
Use the tool picker in Agent mode, then run a task
GitHub's guide has you pick Agent in the chat before you use MCP tools. A chat can run as a Local session inside the editor or as a Copilot session, picked in the chat input. The tool picker differs:
- In a Local session, pick Agent, then click Configure Tools in the chat box. Weir shows as a group you can untick whole or tool by tool.
- In a Copilot session, run Chat: Open Customizations and open the Tools tab.
- To point at a tool, type
#in the chat box and pick it.
Mind the 128-tool cap. VS Code allows at most 128 tools per request. Weir lists 44 on a default sign-in, Reddit included, so untick the Reddit ones if you only need X.
Now a real task. You ask Agent:
Use Weir to find @code's latest release thread on X. Read the whole
thread and list every change that touches MCP or chat in
docs/vscode-update.md, with a link to each post.
Agent calls search_x with fromUsers: ["code"] to find a recent post. Then it calls get_x_thread on that post, which returns the author's whole thread. When an approval prompt appears, expand it to check the arguments, then select Allow.
We ran that first call through Weir's MCP server on 22 October 2026:
→ search_x {"fromUsers": ["code"], "since": "2026-10-14T00:00:00Z", "limit": 2}
← 2 posts · 3 credits (1 + 2 × 1) · nextCursor set
Oct 21 @code Explore everything that's new in the full release notes...
Oct 21 @code Jump between changed files without scrolling through every diff...
Both posts were replies inside one release thread, and they share a conversationId. So Agent's next step is get_x_thread with either post's id.
Our first try searched @code's posts for "MCP" since 1 October and found nothing, for 1 credit. Release threads don't repeat a keyword in every post, so reading the thread beats a keyword search here. For more on threads, see our Twitter thread API guide.
What does an X task in VS Code cost?
Weir bills 1 credit per call plus 1 per X post, and failed calls are free.
Say the release thread runs to 15 posts. Then the whole task costs 19 credits. The free credits cover about 260 runs like it.
Paid packs start at $5 and never expire, as of October 2026. Every rate is on our pricing page. Copilot's own usage counts against your GitHub plan, which Weir doesn't touch.
If it doesn't work
- No sign-in prompt. Run MCP: List Servers, pick weir and choose Show Output to read the error.
- Agent never calls Weir. Check that Weir is ticked in the tool picker, or start with "Use Weir to…".
- "Cannot have more than 128 tools per request." Untick tools or whole servers you don't need.
- Weir's tools are missing in a Copilot session. A server with an input variable isn't passed on, so switch it to sign-in.
- Your company blocks it. GitHub's "MCP servers in Copilot" policy is off by default on Business and Enterprise, so ask an admin.
- Weir returns
402. Your credits ran out, and retrying won't help. Add credits or wait for next month's grant.
When not to use Weir
- Agent has to post, reply or DM. Weir is read-only. X's own API can post with your developer app, at $0.015 a post as of October 2026.
- You want your own private data. Weir reads public posts, not your bookmarks, DMs or home timeline.
- Price per post matters most. TwitterAPI.io lists $0.15 per 1,000 tweets as of October 2026, less than our $5 pack.
- You need a guarantee. Weir isn't licensed by X or affiliated with it, so access can change.
FAQ
How do I add an MCP server in VS Code?
Run MCP: Add Server from the Command Palette, choose HTTP for a remote server and paste its URL. Or add it to .vscode/mcp.json under servers, with "type": "http" and the url. Then approve any trust prompt and sign in.
Do I need a GitHub Copilot plan for MCP in VS Code?
You need Copilot access, and the free plan counts. GitHub's plan list includes Agent mode and MCP on Copilot Free. On Copilot Business and Enterprise, an admin must turn on the MCP policy first.
Where are VS Code MCP settings stored?
In .vscode/mcp.json for one workspace, or in the mcp.json of your user profile. MCP: Open User Configuration opens that one. The Copilot Global choice writes ~/.copilot/mcp-config.json instead.
Can Copilot post to X through Weir?
No. Weir only reads public X data, so nothing can post, like or follow through it. To post, Agent needs a server with write access to your X account.
Sources
- VS Code, MCP configuration reference (updated 21 October 2026, checked 22 October 2026): https://code.visualstudio.com/docs/agents/reference/mcp-configuration
- VS Code, add and manage MCP servers (checked 22 October 2026): https://code.visualstudio.com/docs/agent-customization/mcp-servers
- VS Code, manage tools (checked 22 October 2026): https://code.visualstudio.com/docs/agent-customization/tools
- VS Code, manage and troubleshoot MCP servers (checked 22 October 2026): https://code.visualstudio.com/docs/agents/run/manage-mcp-servers
- VS Code, MCP developer guide, authorization (checked 22 October 2026): https://code.visualstudio.com/api/extension-guides/ai/mcp
- GitHub, extend Copilot Chat with MCP (checked 22 October 2026): https://docs.github.com/en/copilot/how-tos/provide-context/use-mcp/extend-copilot-chat-with-mcp
- GitHub, Copilot plans (checked 22 October 2026): https://docs.github.com/en/copilot/get-started/plans
- X API pricing (checked 22 October 2026): https://docs.x.com/x-api/getting-started/pricing
- TwitterAPI.io pricing (checked 22 October 2026): https://twitterapi.io/pricing
- Weir docs, coding agents: https://docs.weirapp.io/mcp-coding-agents
- Weir docs, MCP: https://docs.weirapp.io/mcp
- Weir billing: https://docs.weirapp.io/billing
- Weir search_x calls, run 22 October 2026 (requests cd42e282-ab29-41cc-ae63-66d97d63b3ae and a380991e-1b6c-4db7-82cb-99c4aa0bbd4b)