POSLabsinc/eos-ms-mcp-server
If you are the rightful owner of eos-ms-mcp-server 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.
The EOS MCP Server is a comprehensive Model Context Protocol server implementation that integrates with EOS APIs for user management, authentication, and other functionalities.
eos_login
Authenticate user with EOS API
eos_get_current_user
Get current authenticated user profile
eos_get_users
Get all users (admin only)
eos_invite_user
Invite a new user
eos_update_user_status
Update user status
eos_delete_user
Delete a user
eos_health_check
Check EOS API connectivity
EOS MCP Server
A Model Context Protocol (MCP) server implementation that integrates with EOS APIs for user management, authentication, and other functionalities.
Features
- MCP Protocol Support: Full MCP server implementation for AI model integration
- EOS API Integration: Seamless integration with browserapi.eatos.net
- REST API Wrapper: Additional REST API for easier testing and integration
- User Management: Complete user lifecycle management (login, invite, update, delete)
- TypeScript: Full TypeScript support with strict typing
- Error Handling: Comprehensive error handling and logging
Prerequisites
- Node.js 18+
- npm or yarn
- Access to EOS APIs (browserapi.eatos.net)
Installation
- Clone the repository:
git clone <repository-url>
cd eos-ms-mcp-server
- Install dependencies:
npm install
- Set up environment variables:
cp env.example .env
Edit .env
with your configuration:
# EOS API Configuration
EOS_API_BASE_URL=https://browserapi.eatos.net
EOS_API_TIMEOUT=30000
# MCP Server Configuration
MCP_SERVER_PORT=3000
MCP_SERVER_HOST=localhost
# Authentication
JWT_SECRET=your-jwt-secret-here
TOKEN_EXPIRY=24h
# Logging
LOG_LEVEL=info
NODE_ENV=development
Usage
Running as MCP Server
# Build the project
npm run build
# Run as MCP server (default)
npm start
# Or explicitly run as MCP server
npm run start mcp
Running as REST API Server
# Run as REST API server
npm run start rest
# Or run in development mode
npm run dev rest
Development
# Run in development mode with hot reload
npm run dev
# Watch for changes
npm run watch
# Run tests
npm test
API Endpoints
MCP Tools
The MCP server exposes the following tools:
-
eos_login - Authenticate user with EOS API
- Input:
{ username: string, password: string }
- Input:
-
eos_get_current_user - Get current authenticated user profile
- Input:
{}
- Input:
-
eos_get_users - Get all users (admin only)
- Input:
{}
- Input:
-
eos_invite_user - Invite a new user
- Input:
{ email: string, role: string, firstName?: string, lastName?: string }
- Input:
-
eos_update_user_status - Update user status
- Input:
{ userId: string, status: 'active' | 'inactive' }
- Input:
-
eos_delete_user - Delete a user
- Input:
{ userId: string }
- Input:
-
eos_health_check - Check EOS API connectivity
- Input:
{}
- Input:
REST API Endpoints
When running as REST API server:
GET /health
- Health checkPOST /auth/login
- User loginGET /users/current
- Get current userGET /users
- Get all usersPOST /users/invite
- Invite new userPATCH /users/:userId/status
- Update user statusDELETE /users/:userId
- Delete user
Example Usage
MCP Client Integration
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
const client = new Client({
name: 'eos-mcp-client',
version: '1.0.0',
});
await client.connect(new StdioClientTransport());
// List available tools
const tools = await client.listTools();
console.log('Available tools:', tools);
// Login
const loginResult = await client.callTool({
name: 'eos_login',
arguments: {
username: 'mp5@gmail.com',
password: 'Test@05500'
}
});
console.log('Login result:', loginResult);
REST API Usage
# Health check
curl http://localhost:3000/health
# Login
curl -X POST http://localhost:3000/auth/login \
-H "Content-Type: application/json" \
-d '{
"username": "mp5@eigital.com",
"password": "Test@055"
}'
# Get current user (requires auth token)
curl -X GET http://localhost:3000/users/current \
-H "Authorization: Bearer YOUR_TOKEN"
Configuration
Environment Variables
Variable | Description | Default |
---|---|---|
EOS_API_BASE_URL | EOS API base URL | https://browserapi.eatos.net |
EOS_API_TIMEOUT | API request timeout (ms) | 30000 |
MCP_SERVER_PORT | REST API server port | 3000 |
MCP_SERVER_HOST | REST API server host | localhost |
JWT_SECRET | JWT secret for token signing | - |
TOKEN_EXPIRY | Token expiration time | 24h |
LOG_LEVEL | Logging level | info |
NODE_ENV | Environment | development |
Error Handling
The server includes comprehensive error handling:
- EOSApiError: For API communication errors
- MCPError: For MCP protocol errors
- ValidationError: For input validation errors
All errors include appropriate HTTP status codes and detailed error messages.
Security
- CORS protection
- Helmet security headers
- Input validation
- Rate limiting (configurable)
- JWT token management
Development
Project Structure
src/
āāā index.ts # Main entry point
āāā types/ # TypeScript type definitions
ā āāā index.ts
āāā services/ # Business logic services
ā āāā eosApiService.ts # EOS API integration
āāā mcp/ # MCP protocol implementation
ā āāā server.ts # MCP server
ā āāā tools.ts # MCP tools
āāā rest/ # REST API implementation
āāā server.ts # REST API server
Adding New Tools
- Add the tool definition in
src/mcp/tools.ts
- Add corresponding API method in
src/services/eosApiService.ts
- Add REST endpoint in
src/rest/server.ts
(if needed) - Update types in
src/types/index.ts
Testing
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run specific test file
npm test -- --testNamePattern="login"
Troubleshooting
Common Issues
- MCP SDK not found: Ensure you have the latest MCP SDK installed
- API connection failed: Check your network and EOS API availability
- Authentication errors: Verify your credentials and API permissions
- Port conflicts: Change the port in
.env
file
Logs
Enable debug logging by setting LOG_LEVEL=debug
in your .env
file.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
For support and questions:
- Create an issue in the repository
- Contact the development team
- Check the documentation
Changelog
v1.0.0
- Initial release
- MCP server implementation
- REST API wrapper
- User management tools
- Authentication integration