Servers
EAIM MCP Server
@OmarNaguib
MCP server for EAIM Technologies API integration with FastAPI and Socket.IO
A Model Context Protocol (MCP) server for integrating with EAIM Technologies API. This server provides tools and resources for querying social media analytics data through natural language processing.
Features
- Socket.IO integration for real-time communication
- Natural language query processing
- MCP tools for accessing EAIM API data
- Dashboard and visualization metadata
Prerequisites
- Python 3.8+
- pip
Installation
-
Clone the repository:
git clone https://github.com/OmarNaguib/eaim-mcp-server.git cd eaim-mcp-server -
Install dependencies:
pip install -r requirements.txt
Usage
Running the server
python main.py
The server will start on http://localhost:8000
Docker
To build and run using Docker:
# Build the Docker image
docker build -t eaim-mcp-server .
# Run the container
docker run -p 8000:8000 eaim-mcp-server
API Endpoints
/- Root endpoint with server information/socket.io- Socket.IO endpoint for real-time communication/mcp- MCP server endpoint for tools and resources
MCP Tools
get_visualization_data
Get data for a specific visualization from EAIM API.
Parameters:
dashboard_id(number, required): Dashboard IDvisualization_id(number, required): Visualization IDbrand(string, required): Brand nameperiod(string, required): Time period (last week, last month, last 3 months)
query_natural_language
Query EAIM API using natural language.
Parameters:
query(string, required): Natural language query
MCP Resources
available_dashboards
List of available dashboards.
available_visualizations
List of available visualizations for a dashboard.
Parameters:
dashboard_id(number, required): Dashboard ID
Socket.IO Events
Client to Server
query_data: Send a natural language query to the serversocket.emit("query_data", { query: "Show me the engagement of Vodafone EG over the last month", });
Server to Client
status: Receive status updates from the serverdata: Receive data from the servererror: Receive error messages from the server
Example Usage
// Connect to the Socket.IO server
const socket = io("http://localhost:8000");
// Listen for status updates
socket.on("status", (data) => {
console.log("Status:", data.message);
});
// Listen for data
socket.on("data", (data) => {
console.log("Received data:", data);
// Process and display the data
});
// Listen for errors
socket.on("error", (data) => {
console.error("Error:", data.message);
});
// Send a query
socket.emit("query_data", {
query: "Show me the engagement of Vodafone EG over the last month",
});
License
MIT