Docs
Sign In
Grok logo

Grok (xAI)

Developer / CLI

Connect FeedNest to Grok via the xAI API. Developer/API only, not available from the Grok chat UI.

Prerequisites

API/SDK only

Grok does not support connecting to external MCP servers from the grok.com chat interface. Integration is available through the xAI API, xAI SDK, or the OpenAI-compatible SDK.

Option A: cURL

  1. 1

    Get your xAI API key

    Create an API key at console.x.ai.

  2. 2

    Make a request with the MCP tool

    Include FeedNest as an MCP tool in your Responses API request.

curl https://api.x.ai/v1/responses \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-3",
    "tools": [{
      "type": "mcp",
      "server_url": "https://mcp.feednest.com",
      "server_label": "feednest",
      "authorization": "Bearer fn_live_..."
    }],
    "input": "What are my unread articles?"
  }'

Option B: OpenAI SDK

Grok's API is compatible with the OpenAI SDK. Just change the base URL:

Using OpenAI SDK with xAI

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.XAI_API_KEY,
  baseURL: "https://api.x.ai/v1",
});

const response = await client.responses.create({
  model: "grok-3",
  tools: [{
    type: "mcp",
    server_url: "https://mcp.feednest.com",
    server_label: "feednest",
    authorization: "Bearer fn_live_...",
  }],
  input: "Summarize my latest saved articles",
});

Verify your connection

After setup, try one of these prompts to confirm everything is working:

  • What are my unread articles?
  • Summarize my latest saved articles
  • How many feeds am I subscribed to?

Troubleshooting

401 from xAI API

This is an xAI authentication error. Check your XAI_API_KEY is valid.

MCP tool calls failing

Verify your FeedNest API key (fn_live_...) is correct in the 'authorization' field of the tool config.

For more help, see the general setup guide.