Skip to content

[Integration] feat(tools): add X (Twitter) integration tool#2918

Closed
sashankthapa wants to merge 0 commit intoadenhq:mainfrom
sashankthapa:feature/twitter-x-mcp-tool
Closed

[Integration] feat(tools): add X (Twitter) integration tool#2918
sashankthapa wants to merge 0 commit intoadenhq:mainfrom
sashankthapa:feature/twitter-x-mcp-tool

Conversation

@sashankthapa
Copy link
Contributor

Description

Adds a new X (Twitter) integration tool for Hive, enabling agents to interact directly with the X API v2.

This allows agents to automate social workflows such as posting tweets, replying to users, searching recent tweets, and monitoring mentions without external scripts or manual steps.

The implementations follows the same architecture and conventions as other tools:

  • httpx-based client
  • internal client wrapper
  • register_tools(mcp, credentials)
  • CredentialStoreAdapter support
  • environment variable fallback
  • unit tests and documentation

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

Related Issues

Refs #2598
parent issue #2805

New files

tools/src/aden_tools/tools/x_tool/x_tool.py

  • Internal _XClient using httpx
  • MCP tools:
    • x_post_tweet
    • x_reply_tweet
    • x_delete_tweet
    • x_search_tweets
    • x_get_mentions

tools/src/aden_tools/tools/x_tool/__init__.py

  • Exposes register_tools

tools/src/aden_tools/tools/x_tool/README.md

  • Setup instructions
  • Authentication guide
  • Usage examples

tools/tests/tools/test_x_tool.py

  • Unit tests with mocked httpx requests
  • Client + tool behavior coverage

Modified files

tools/src/aden_tools/tools/__init__.py

  • Imported register_x
  • Added register_x(mcp, credentials)
  • Added X tools to returned tool list

tools/src/aden_tools/credentials/integrations.py

  • Added CredentialSpec for "x"
  • Supports credential store + env var fallback
  • Added health check endpoint

Testing

  • All tests pass locally with pytest
  • MCP server confirms registration of tools
  • Manual testing performed for search and post endpoints

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Environment Variables

X_BEARER_TOKEN
Required
X (Twitter) API v2 Bearer Token

Screenshots (if applicable)

N/A

Copy link
Contributor

@Amdev-5 Amdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update .claude/skills/building-agents-construction/SKILL.md with the new tool

@sashankthapa sashankthapa reopened this Feb 2, 2026
@sashankthapa sashankthapa requested a review from Amdev-5 February 2, 2026 00:46
Copy link
Contributor

@Amdev-5 Amdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mcp__agent-builder__list_mcp_tools() calls the MCP server which loads tools via register_all_tools() → which now includes register_apollo().

Conclusion: Tools are auto-discovered. No manual SKILL.md update required.

@sashankthapa
Copy link
Contributor Author

fixes #2598

Copy link
Collaborator

@bryanadenhq bryanadenhq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, it seems like the X_BEARER_TOKEN does not have the ability to post, reply, or delete tweets, those require Oauth2.0. Could you please clarify that with the tools with a label, such as oauth_required = True, we will provide the oauth on our app. Additionally, could you create a test file with pytests for these tools and add a tool to dm a user? Thanks for your contribution!

@Amdev-5
Copy link
Contributor

Amdev-5 commented Feb 6, 2026

hi @bryanadenhq
Can you assign me this issue, i have addressed your comment's concern and also have done testing locally with keys for all the tools, have added logs as well
Amdev-5#2

@sashankthapa
Copy link
Contributor Author

Hi, it seems like the X_BEARER_TOKEN does not have the ability to post, reply, or delete tweets, those require Oauth2.0. Could you please clarify that with the tools with a label, such as oauth_required = True, we will provide the oauth on our app. Additionally, could you create a test file with pytests for these tools and add a tool to dm a user? Thanks for your contribution!

Acknowledged! I'll update the tools to clearly mark Oauth required actions and write pytests for these tools

@sashankthapa sashankthapa force-pushed the feature/twitter-x-mcp-tool branch from 1c2295b to 5179677 Compare February 6, 2026 14:06
@RichardTang-Aden
Copy link
Collaborator

Thank you guys for the contribution. I will review the other PR instead and make sure your contribution history all be recorded well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments