Skip to main content
Glama
Context API MCP Server

Context API MCP Server

Context API MCP Server

MCP (Model Context Protocol) server to access the doppelgangers.ai Social Media Context API.

This MCP server provides access to contextualized renderings (XML descriptions) of Twitter/X posts. The contextualization allows for:

  • More high-quality retrieval of relevant information from the posts,

  • More high-quality analysis of insights, trends, topics, etc. from the posts

The contextualization is achieved by adding the following information to the XML description of each post:

  • Descriptions of referenced posts and images

  • When the post is a reply in a conversation, the conversation or a summary of the conversation.

  • Metadata about the post (e.g., creation data, post ID, etc.)

Note that no descriptions are added yet related to referenced videos or links (external sites).

The XML structure helps to describe the relationship between posts and their context.

Using the available tools has a cost associated with it, with each call the credit balance is updated.

Features

  • search_relevant_posts: Semantic search of contextualized post renderings of a certain Twitter/X user, based on a natural language queries like "What does @visionscaper think about the future of AI?".

  • get_all_user_posts: Retrieve all contextualized post renderings of a specific Twitter/X user. This is useful to analyse the posts for insights, trends and topics over all posts.

  • check_credits: View your API credit balance and usage.

Related MCP server: x-search-mcp

Installation

1. Get your API Key

Request an API key at dev.doppelgangers.ai:3003 or via the API:

curl -X POST https://dev.doppelgangers.ai:3003/auth/request-key \
  -H "Content-Type: application/json" \
  -d '{"email": "your@email.com", "name": "Your Name"}'

2. Configure Your Client

Add the following config to your MCP client:

{
  "mcpServers": {
    "context-api": {
      "command": "npx",
      "args": ["-y", "context-api-mcp"],
      "env": {
        "CONTEXT_API_KEY": "your-api-key-here"
      }
    }
  }
}

MCP Client configuration

Follow Amp's MCP guide and use the config provided above. You can also install the Context API MCP server using the CLI:

amp mcp add context-api -- npx context-api-mcp

To use the Context API MCP server follow the instructions from Antigravity's docs to install a custom MCP server. Add the following config to the MCP servers config:

{
  "mcpServers": {
    "context-api": {
      "command": "npx",
      "args": ["-y", "context-api-mcp"],
      "env": {
        "CONTEXT_API_KEY": "your-api-key-here"
      }
    }
  }
}

Note: If you encounter an "EOF" error, try using the absolute path to npx (e.g., /usr/local/bin/npx) or invoke the CLI script directly via node.

Use the Claude Code CLI to add the Context API MCP server (guide):

claude mcp add context-api npx context-api-mcp

Edit your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the Context API MCP server:

{
  "mcpServers": {
    "context-api": {
      "command": "npx",
      "args": ["-y", "context-api-mcp"],
      "env": {
        "CONTEXT_API_KEY": "your-api-key-here"
      }
    }
  }
}

After updating the configuration, restart Claude Desktop for changes to take effect.

Follow Cline's MCP guide and use the config provided above.

Follow the configure MCP guide using the standard config from above. You can also install the Context API MCP server using the Codex CLI:

codex mcp add context-api -- npx context-api-mcp

Start Copilot CLI:

copilot

Start the dialog to add a new MCP server by running:

/mcp add

Configure the following fields and press CTRL+S to save the configuration:

  • Server name: context-api

  • Server Type: [1] Local

  • Command: npx -y context-api-mcp

Follow the MCP install guide, with the standard config from above. You can also install the Context API MCP server using the VS Code CLI:

code --add-mcp '{"name":"context-api","command":"npx","args":["-y","context-api-mcp"],"env":{"CONTEXT_API_KEY":"your-api-key-here"}}'
  1. Open Cursor Settings

  2. Go to Features > MCP

  3. Click + Add New MCP Server

  4. Enter the following details:

    • Name: Context API

    • Type: command

    • Command: npx -y context-api-mcp

  5. Add your API key in the environment variables section if supported, or ensure it's set in your system environment.

Use the Factory CLI to add the Context API MCP server (guide):

droid mcp add context-api "npx -y context-api-mcp"

Install the Context API MCP server using the Gemini CLI.

Project wide:

gemini mcp add context-api npx context-api-mcp

Globally:

gemini mcp add -s user context-api npx context-api-mcp

Alternatively, follow the MCP guide and use the standard config from above.

Follow the configure MCP guide using the standard config from above.

Go to Settings | Tools | AI Assistant | Model Context Protocol (MCP) -> Add. Use the config provided above. The same way context-api-mcp can be configured for JetBrains Junie in Settings | Tools | Junie | MCP Settings -> Add. Use the config provided above.

In Kiro Settings, go to Configure MCP > Open Workspace or User MCP Config > Use the configuration snippet provided above.

Or, from the IDE Activity Bar > Kiro > MCP Servers > Click Open MCP Config. Use the configuration snippet provided above.

In Qoder Settings, go to MCP Server > + Add > Use the configuration snippet provided above.

Alternatively, follow the MCP guide and use the standard config from above.

Install the Context API MCP server using the Qoder CLI (guide):

Project wide:

qodercli mcp add context-api -- npx context-api-mcp

Globally:

qodercli mcp add -s user context-api -- npx context-api-mcp

Follow the Visual Studio MCP documentation to add the server using the standard config from above.

Go to Settings | AI | Manage MCP Servers -> + Add to add an MCP Server. Use the config provided above.

Follow the configure MCP guide using the standard config from above.

Edit your Zed settings file (settings.json):

{
  "mcp": {
    "servers": {
      "context-api": {
        "command": "npx",
        "args": ["-y", "context-api-mcp"],
        "env": {
          "CONTEXT_API_KEY": "your-api-key-here"
        }
      }
    }
  }
}

Usage Examples

Once configured, you can use the tools in your MCP client:

Search Relevant Posts

Semantic search of contextualized post renderings of a certain Twitter/X user, based on a natural language query.

What does @elonmusk think about AI regulation?

Get All User Posts

Retrieve all contextualized post renderings of a specific Twitter/X user. This tool is useful when you need to analyse posts for insights, trends and topics over all posts.

What has recently been the mood of @elonmusk?

Check Credits

Check your Context API credit balance and usage statistics.

How many API credits do I have left?

Tool Reference

search_relevant_posts

search_relevant_posts

Semantic search of contextualized post renderings of a certain Twitter/X user, based on a natural language query. Use this tool to find specific posts, relevant to the query.

Parameter

Type

Required

Description

query

string

Yes

Natural language search query

username

string

Yes

Twitter/X username (without @)

platform

string

No

Platform (default: "X")

get_all_user_posts

Retrieve all contextualized post renderings of a specific Twitter/X user. This tool is useful when you need to analyse posts for insights, trends and topics over all posts.

Parameter

Type

Required

Description

username

string

Yes

Twitter/X username (without @)

platform

string

No

Platform (default: "X")

simple

boolean

No

If true, returns simplified post renderings without metadata

limit

number

No

Max results to return (default: all)

offset

number

No

Pagination offset (default: 0)

check_credits

Check your Context API credit balance and usage statistics. No parameters required.

Environment Variables

Variable

Required

Default

Description

CONTEXT_API_KEY

Yes

-

Your Context API key

CONTEXT_API_URL

No

https://dev.doppelgangers.ai:3003

API base URL (optional)

Troubleshooting

Server not showing in Client

  1. Ensure you have Node.js 18+ installed

  2. Check that CONTEXT_API_KEY is set correctly

  3. Restart your client completely

API errors

Check the client logs for detailed error messages. The server outputs to stderr to avoid interfering with the MCP protocol.

Test the server manually

CONTEXT_API_KEY=your-key npx context-api-mcp

Development

To run the server from source:

  1. Clone the repository

  2. Install dependencies:

    npm install
  3. Build the project:

    npm run build
  4. Run the server:

    node dist/index.js

Available Tools

3 tools
check_creditsA

Check your Context API credit balance and usage statistics.

Inputs: no named parameters.

get_all_user_postsA

Retrieve all contextualized post renderings of a specific Twitter/X user. This tool is useful when you need to analyse posts for insights, trends and topics over all posts. For instance, to answer queries such as:

  • "What topics does @elonmusk tweet most about?"

  • "What has recently been the mood of @elonmusk?"

Inputs: username (required), platform, simple, limit, +1 more.

search_relevant_postsA

Semantic search of contextualized post renderings of a certain Twitter/X user, based on a natural language query. Twitter/X username and platform (= X) must be provided. Use this tool to find specific posts, relevant to the query.

Inputs: query (required), username (required), platform.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clear, non-overlapping purpose: credits check, full post retrieval, and semantic search. No ambiguity.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case (check_credits, get_all_user_posts, search_relevant_posts).

    Tool Count4/5

    Three tools is slightly minimal but well-scoped for the server's focused purpose of analyzing Twitter/X user posts. The count is not excessive or too thin.

    Completeness4/5

    Covers the core operations for the domain: account status, exhaustive post retrieval, and semantic search. Minor gaps like single post or user profile are not critical for the intended analysis tasks.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables searching X (formerly Twitter) using xAI's Responses API with support for filtering by handles, date ranges, and media understanding, returning structured results with citations.
      1
      10 npm
      1
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables real-time search of X (Twitter) posts, user timelines, and trends using either xAI's Responses API or the official X API v2.
      4
      -
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to read, post, search, and engage with Twitter/X content, including AI-powered reply drafting and analytics.
      17
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      X and Twitter MCP by SocialDataX for public post search and details, comments and replies, user profiles, and user post lists with pagination.
      MIT