MCP_AI_Server_Agent

Devansh1974/MCP_AI_Server_Agent

3.1

If you are the rightful owner of MCP_AI_Server_Agent and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

MCP TweetBot is a lightweight, Gemini-powered chatbot integrated with Model Context Protocol (MCP) for command-line interaction, allowing users to post tweets and fetch motivational quotes.

MCP TweetBot

A lightweight, Gemini-powered chatbot integrated with Model Context Protocol (MCP) that allows you to call custom tools like tweeting on X (formerly Twitter) via command-line interaction.

This project showcases how AI + Tools can work together using Google Gemini + MCP SDK. Plug in your API keys, run the client, and start chatting, posting tweets, or getting motivational quotes directly through your terminal.


โœจ Features

  • ๐Ÿค– AI chat powered by Gemini
  • ๐Ÿ”ง Supports multiple MCP tools
    • addTwoNumbers: Adds two numbers
    • createPost: Posts a tweet on X (Twitter)
    • getMotivation: Fetches a real-time motivational quote from ZenQuotes API
  • ๐Ÿ“ก Real-time communication using Server-Sent Events (SSE)
  • ๐Ÿ’ฌ CLI-based chatbot with tool execution

๐Ÿ› ๏ธ Setup Instructions

1. Clone the repo

git clone https://github.com/yourusername/mcp-tweetbot.git
cd mcp-tweetbot

2. Install dependencies

npm install

3. Create a .env file in the root

For Client Side - 

GEMINI_API_KEY='Your API Key'


For Server Side - 

TWITTER_API_KEY='Your API key'

TWITTER_API_SECRET='Your API Secret'

TWITTER_ACCESS_TOKEN='Your Token'

TWITTER_ACCESS_TOKEN_SECRET='Your Token Secret'

โš ๏ธ For security reasons, always use your own API keys when forking this project.


๐Ÿ“ฆ Required Dependencies

npm install express zod dotenv readline @google/genai @modelcontextprotocol/sdk twitter-api-v2 axios

4. Run the MCP server

node server/index.js

5. Run the MCP client

node client/index.js

๐Ÿงช Example Usage

You: What is 12 + 34?
AI: calling tool addTwoNumbers
AI: Tool Result: The sum of 12 and 34 is 46

You: Post "Hello world from my bot!" on Twitter
AI: calling tool createPost
AI: Tool Result: Tweeted: Hello world from my bot!

You: I'm feeling low, motivate me
AI: calling tool getMotivation
AI: Tool Result: "Push yourself, because no one else is going to do it for you." โ€” Anonymous

๐Ÿ“ Project Structure

mcp-tweetbot/
โ”œโ”€โ”€ client/
โ”‚   โ””โ”€โ”€ index.js         # CLI interface with Gemini + MCP
โ”œโ”€โ”€ server/
โ”‚   โ””โ”€โ”€ index.js         # Tool registration + MCP server setup
โ”‚   โ””โ”€โ”€ mcp.tool.js      # Tool logic (e.g. createPost, getMotivation)
โ”œโ”€โ”€ .env                 # API keys
โ””โ”€โ”€ README.md

๐Ÿ“Œ Requirements

  • Node.js v18+
  • Twitter Developer account (with Read & Write access)
  • Gemini API key from Google AI Studio
  • Internet connection (for fetching motivational quotes)

๐Ÿง‘โ€๐Ÿ’ป Author

Made with โค๏ธ by Devansh Singh


๐Ÿ“œ License

This project is open-source and free to use under the .