twitter_api_safe_relay_mcp

twitter_api_safe_relay_mcp

Forwards HTTP requests to a Twitter API safe relay, enabling interaction with Twitter's API through a catalog of request templates.

Category
Visit Server

README

twitter_api_safe_relay_mcp

A simple MCP server that forwards HTTP requests to twitter_api_safe_relay.

GitHub: nakasyou/twitter_api_safe_relay_mcp

Getting started

Start the relay server and set its URL in the environment:

TWITTER_RELAY_BASE_URL=http://localhost:6900 npx twitter_api_safe_relay_mcp

Example MCP client configuration:

{
  "mcpServers": {
    "twitter-api-safe-relay": {
      "command": "npx",
      "args": ["twitter_api_safe_relay_mcp"],
      "env": {
        "TWITTER_RELAY_BASE_URL": "http://localhost:6900"
      }
    }
  }
}

Tools

The server exposes two tools:

  • twitter_request_catalog: Searches the latest request catalog by operation name or path and returns executable templates.
  • twitter_api_request: Sends a request to the relay using a template.

Start by finding an operation in the catalog. The server fetches requests.ndjson on every catalog call, so updated query IDs and feature flags are picked up automatically.

{
  "query": "SearchTimeline",
  "limit": 5
}

Pass the returned request to twitter_api_request, changing only the values needed for your task, such as the search query, username, ID, or result count. Do not change features, fieldToggles, queryId, or operation-specific variable names.

Example twitter_api_request call:

{
  "endpoint": "/i/api/graphql/QUERY_ID/UserByScreenName",
  "method": "GET",
  "params": {
    "variables": {
      "screen_name": "example"
    },
    "features": {}
  }
}
  • endpoint: The path sent to the relay. Absolute URLs are not accepted.
  • method: GET (default), POST, PUT, PATCH, or DELETE.
  • params: URL query parameters. Object values are converted to JSON strings.
  • body: JSON request body.
  • headers: Optional HTTP headers.

The destination host is always restricted to TWITTER_RELAY_BASE_URL.

The /i/api prefix is added automatically to GraphQL catalog paths. It is not added to REST paths under /1.1 or /2. Confirm write operations before running them, then verify the result with a read operation. Note that GraphQL responses may contain errors even when the HTTP status is 200.

To use a different catalog source, set TWITTER_REQUESTS_CATALOG_URL.

Development and publishing

npm install
npm run typecheck
npm test
npm run build
npm publish

Once published, the server can be run on Node.js 18 or later with npx twitter_api_safe_relay_mcp. Bun users can run it with bunx twitter_api_safe_relay_mcp.

Releasing with GitHub Actions

Open the Release workflow in GitHub Actions, select the default branch, and choose patch, minor, or major. The workflow calculates the next version from the latest version on npm, runs the tests and build, publishes the package to npm, and creates a GitHub Release.

Before using the workflow, publish the package to npm once and configure a Trusted Publisher for it. The current workflow calculates the next version from the latest version available on npm, so it cannot perform the initial publication of a new package.

  • Provider: GitHub Actions
  • Organization or user: nakasyou
  • Repository: twitter_api_safe_relay_mcp
  • Workflow filename: release.yml
  • Allowed action: npm publish

No long-lived npm token is required. The workflow uses a GitHub-hosted runner, Node.js 24, and npm OIDC Trusted Publishing.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured