Prerequisites
- A Twexapi API key
- n8n Cloud or self-hosted n8n
- A webhook URL for MCP handoff recipes
- Optional Slack, Google Sheets, Airtable, or database credentials
API key credential
Create a reusable n8n credential for Twexapi REST calls:
For MCP-capable AI Agent nodes, configure the MCP Client Tool with
https://api.twexapi.io/mcp and header x-api-key: YOUR_API_KEY.
Pattern
- Create an n8n Webhook trigger.
- Ask an MCP-capable agent to return strict Twexapi handoff JSON.
- POST the JSON to the n8n webhook.
- Use Set, IF, Split Out, and HTTP Request nodes to process rows.
Webhook payload
Suggested n8n nodes
Result handoff
Use an Edit Fields node after each MCP or HTTP Request step when the next node only needs stable fields.Recipe 1: AI agent X research with MCP
1
Add an AI Agent node
Use your preferred chat model.
2
Add an MCP Client Tool
Configure
https://api.twexapi.io/mcp with x-api-key.3
Prompt the agent
Ask it to call
explore, then twexapi_request, and return only JSON.4
Route rows
Split
tweets and write each row to your destination.Recipe 2: Monitor-style Slack alert
Use this when the workflow should alert a Slack channel after receiving a row from an MCP agent or a scheduled REST job.
Slack message template:
Recipe 3: Extraction to Google Sheets
For larger follower or reply exports, let the agent choose the endpoint with MCP, then run the repeated pages through REST.Direct REST continuation
Testing checklist
- Use n8n Test Step on every HTTP Request node.
- Confirm every REST request includes
Authorization: Bearer YOUR_API_KEY. - Confirm every MCP Client Tool request includes
x-api-key. - Confirm webhooks receive JSON, not prose.
- On
429, pause before retrying and preservenext_cursor.