What is MCP?
MCP (Model Context Protocol) is a standard protocol for AI applications to connect with external tools and services. An MCP server exposes tools via HTTP endpoints, allowing EigenData-CLI to:- Discover available tools and their specifications
- Execute tools with parameters
- Access environment state and user data
- Manage sessions and state persistence
How MCP Servers Work
An MCP server acts as a bridge between EigenData-CLI and your domain environment. The typical workflow is:- Discovery - EigenData-CLI queries the
/toolsendpoint to get available tools - Environment Access - CLI calls
get_environment_stats()andget_user_data()to understand the domain state - Tool Execution - During data generation, the CLI executes domain-specific tools via POST requests
- State Management - The server maintains environment state across conversations
Configuring MCP Server
You can configure your MCP server URL at any time using/configure:
Required MCP Tools
All MCP servers must implement these four essential tools to work with EigenData-CLI:1. get_user_data
Retrieves user data from the environment, with optional filtering for related records. Parameters:user_id(optional) - User ID to look up. IfNone, samples a random userinclude_related(optional, default:true) - Whether to include related data from other database tables
- User profile information
- Related data organized by table name (if
include_related=true)
2. get_environment_stats
Returns statistics about the current environment state, including database table counts and system status. Parameters: None Returns: Dictionary containing:action_count- Number of actions performedlast_action- Most recent action nameinitialized- Whether environment is initialized- Database statistics with table counts
3. save_environment_state
Saves the current environment state to a file for persistence. Parameters:path(optional) - File path to save state. IfNone, uses default path
path- Path where state was savedstatus- Success/failure status
4. reset_environment
Resets the environment to its initial state, clearing all accumulated data. Parameters: None Returns: Dictionary containing:status- Success/failure statusmessage- Confirmation message
Optional MCP Tools
These tools enhance session management capabilities:Session Management
create_session(session_id)- Create a new isolated sessiondelete_session(session_id)- Delete an existing sessionlist_sessions()- List all active sessions
MCP Server Endpoints
Tool Listing
Endpoint:GET /tools
Returns all available tools with their specifications:
Tool Execution
Endpoint:POST /mcp/tools/{tool_name}
Executes a tool with the provided parameters: