### Install Node.js using Homebrew Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This bash command installs Node.js on macOS using the Homebrew package manager. Node.js is required for Claude Desktop to use the mcp-remote proxy. ```bash # macOS brew install node # Or download from https://nodejs.org/ ``` -------------------------------- ### Start DataRobot Agent Application Local Development Environment Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/README.md This command initiates an interactive wizard to guide the user through configuring the DataRobot Agent Application. It clones the repository and creates a .env file with specified environment variables. The wizard provides context for each step, and detailed walkthroughs are available. ```shell dr start ``` -------------------------------- ### Client-Specific Verification Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md Perform verification steps for different clients (Cursor, VSCode, Claude Desktop) to ensure successful MCP connection and tool availability. ```APIDOC ### Client-specific verification #### Cursor verification 1. **Open Cursor** 2. **Open Command Palette**: `Cmd+Shift+P` (macOS) or `Ctrl+Shift+P` (Windows/Linux) 3. **Type "MCP"** - you should see MCP-related commands 4. **Test with AI**: Ask "What MCP tools are available?" or "List all available tools" 5. **Expected result**: AI should list DataRobot tools ✅ **Cursor MCP connection working** #### VSCode verification 1. **Open VSCode** 2. **Open Output Panel**: `View → Output` 3. **Select "MCP" from dropdown** (if available) 4. **Look for connection messages**: Should show successful MCP server connection 5. **Test with AI**: Use AI features and ask about available tools ✅ **VSCode MCP connection working** #### Claude Desktop verification 1. **Open Claude Desktop** 2. **Check logs**: `~/Library/Logs/Claude/mcp*.log` (macOS) or equivalent on your OS 3. **Look for**: "Connected to MCP server" or similar success messages 4. **Test with Claude**: Ask "What tools do you have access to?" 5. **Expected result**: Claude should mention DataRobot tools ✅ **Claude Desktop MCP connection working** ``` -------------------------------- ### Install Project Dependencies (Shell) Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/README.md Run this command to install all necessary project dependencies, which is often required to resolve service startup issues. ```shell dr task run install ``` -------------------------------- ### Troubleshooting Failed Connections Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md Provides guidance on troubleshooting common connection issues for the DataRobot Agent Application, including server and client-side problems. ```APIDOC ## Troubleshooting failed connections **If verification fails:** 3. **Check Client Logs**: - **Cursor**: View → Output → Select "MCP Logs" - **Claude Desktop**: Check `~/Library/Logs/Claude/mcp*.log` - **VSCode**: View → Output → Select MCP-related output ## Troubleshooting decision tree Use this decision tree to quickly diagnose and fix common issues: ### Server issues **Server won't start?** ``` ├── Port 8080 in use? │ ├── Yes → Kill process: `lsof -i :8080 | xargs kill -9` │ └── No → Check dependencies: `task install` ├── Missing dependencies? │ ├── Yes → Run: `task install` │ └── No → Check environment variables └── Invalid API token? ├── Yes → Verify token in DataRobot UI → Account Settings → API Tokens └── No → Check .env file format ``` **Server starts but returns errors?** ``` ├── Check server logs for specific error messages ├── Verify DATAROBOT_API_TOKEN is valid ├── Check DATAROBOT_ENDPOINT URL format └── Ensure required environment variables are set ``` ### Client connection issues **Client can't connect to server?** ``` ├── Server running? │ ├── No → Start server: `task dev` │ └── Yes → Check URL in client config ├── Wrong URL in config? │ ├── Local: Should be `http://localhost:8080/mcp/` │ └── Remote: Should be `https://app.datarobot.com/deployments//directAccess/mcp/` ├── Firewall blocking? │ ├── Check local firewall settings │ └── Check corporate network restrictions └── Client needs restart? ├── Cursor: Completely quit and restart ├── VSCode: Reload window (Cmd+Shift+P → "Developer: Reload Window") └── Claude Desktop: Completely quit and restart ``` **Tools not showing up in client?** ``` ├── Server logs show tool registration errors? │ ├── Yes → Check tool docstrings and type hints │ └── No → Check client configuration ├── Client needs restart after server changes? │ ├── Yes → Restart client application │ └── No → Check MCP endpoint URL └── Wrong endpoint URL? ├── Verify URL format and deployment ID └── Test endpoint directly: `curl ` ``` ### Authentication issues (remote) **Authentication errors with remote server?** ``` ├── API token valid? │ ├── No → Generate new token in DataRobot UI │ └── Yes → Check token format ├── Correct Bearer format? │ ├── Should be: `Authorization: Bearer YOUR_API_TOKEN` │ └── No spaces or extra characters ├── Token expired? │ ├── Yes → Generate new token │ └── No → Check permissions └── Have deployment access? ├── Check DataRobot permissions └── Verify deployment ID is correct ``` ``` -------------------------------- ### Verify Prerequisites Installation (Shell) Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/README.md Check if essential development tools and DataRobot CLI are installed and accessible in your environment. This is a crucial step for troubleshooting service startup issues. ```shell dr --version git --version uv --version pulumi version task --version node --version ``` -------------------------------- ### Install MCP Application and Infrastructure Dependencies Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/README.md Installs all required dependencies for both the MCP application and its associated infrastructure components. This command should be run after cloning the repository. ```bash task install ``` -------------------------------- ### Enable Dynamic Prompt Registration Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This environment variable enables the MCP server to automatically discover and register DataRobot prompts upon startup. ```bash MCP_SERVER_REGISTER_DYNAMIC_PROMPTS_ON_STARTUP=true ``` -------------------------------- ### Multiple MCP Server Configuration Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md Configure multiple MCP servers (e.g., local, staging, production) within a single client configuration for flexible testing and deployment. ```APIDOC ## Multiple environments (optional) You can configure multiple MCP servers (e.g., local, staging, production) in the same client configuration. This is useful for testing changes locally before deploying. *Example for Cursor*: ```json { "mcpServers": { "local": { "url": "http://localhost:8080/mcp/" }, "production": { "url": "https://[YOUR_DATA_ROBOT_ENDPOINT]/deployments/[YOUR_DEPLOYMENT_ID]/directAccess/mcp/", "headers": { "Authorization": "Bearer [YOUR_DATA_ROBOT_API_KEY]" } } } } ``` Your client will connect to all configured servers and make their tools available. ``` -------------------------------- ### Install macOS Prerequisites with Homebrew Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/README.md Installs Homebrew if not present, then installs essential tools for DataRobot Agent Application development on macOS. Dependencies include curl and bash for the Homebrew installation script. Outputs are the installed CLI tools. ```shell /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # If homebrew is not already installed brew install datarobot-oss/taps/dr-cli uv pulumi/tap/pulumi go-task node git ``` -------------------------------- ### Dynamic Tool Registration - Quick Start Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/dynamic_tool_registration.md Quick start guide to register DataRobot deployments as LLM tools. Deploy your model, tag it with 'tool', and it's ready. ```APIDOC ## Dynamic Tool Registration - Quick Start 1. Deploy your model/service to DataRobot. 2. Tag the deployment with `tool` (both name and value). 3. **Done!** (DataRobot native models and DRUM work with zero configuration). **Enable auto-discovery on startup (optional):** ```bash MCP_SERVER_REGISTER_DYNAMIC_TOOLS_ON_STARTUP=true ``` ``` -------------------------------- ### Install Linux Prerequisites with Package Managers Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/README.md Installs prerequisite tools for DataRobot Agent Application on Linux (Debian/Ubuntu/DataRobot codespace) using curl, apt-get, and sh. This includes dr-cli, python3, pip, venv, git, uv, pulumi, go-task, nodejs, and npm. Requires sudo privileges for apt-get commands. ```shell curl https://cli.datarobot.com/install | sh sudo apt-get update sudo apt-get install -y python3 python3-pip python3-venv sudo apt-get install -y git curl -LsSf https://astral.sh/uv/install.sh | sh curl -fsSL https://get.pulumi.com | sh sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d sudo apt-get install -y nodejs npm ``` -------------------------------- ### Run Development Server with FastAPI Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/fastapi_server/README.md Starts the FastAPI development server with hot-reloading enabled. This command is used for local development to quickly see changes reflected. ```bash uv run fastapi_server run --reload ``` -------------------------------- ### Implement User Configuration in Python Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/README.md This Python code demonstrates how to update parameter handling in `user_config.py` by defining a `UserAppConfig` class that inherits from `BaseSettings`. It includes an example of adding a 'user_name' configuration with environment variable aliasing. ```python class UserAppConfig(BaseSettings): """User-specific application configuration.""" # Example of adding user-specific configuration user_name: str = Field( default="default-user", validation_alias=AliasChoices( RUNTIME_PARAM_ENV_VAR_NAME_PREFIX + "USER_NAME", "USER_NAME", ), description="Name of the user account in use." ) ``` -------------------------------- ### Troubleshoot Claude Desktop 'Command Not Found' Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This diagnostic tree helps resolve 'command not found' errors for Claude Desktop. It checks for Node.js installation and ensures npm global binaries are in the system's PATH. The final step tests the 'mcp-remote' package. ```bash ├── Node.js installed? │ ├── No → Install: `brew install node` (macOS) or download from nodejs.org │ └── Yes → Check version: `node --version` ├── npm global binaries in PATH? │ ├── No → Add to PATH or use full path to npx │ └── Yes → Test: `npx mcp-remote@latest --version` └── mcp-remote package available? ├── Test: `npx mcp-remote@latest --version` └── Should return version information ``` -------------------------------- ### Configure OpenTelemetry Tracing Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md These environment variables enable and configure OpenTelemetry tracing for the DataRobot agent application, allowing for distributed tracing and monitoring. ```bash OTEL_ENABLED=true OTEL_COLLECTOR_BASE_URL=https://your-otel-endpoint OTEL_ENTITY_ID=your-entity-id ``` -------------------------------- ### Install Agent Dependencies Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/agent/AGENTS.md Installs necessary dependencies for agent development. This command should be executed after any modifications to the agent's code. ```shell dr task run agent:install ``` -------------------------------- ### Server Verification Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md Verify that the MCP server is running and accessible by checking its status and MCP endpoint. ```APIDOC ## Verifying the connection After configuring your client, use these interactive tests to verify everything works: ### Server verification 1. **Verify that the server is running**: ```bash curl http://localhost:8080/ ``` Expected output: `{"status": "healthy", "message": "DataRobot MCP Server is running"}` 2. **Check MCP Endpoint**: ```bash curl http://localhost:8080/mcp/ ``` Expected output: MCP protocol information (JSON response) ``` -------------------------------- ### Configure VSCode for Local MCP Server Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This JSON configuration sets up VSCode to connect to a local MCP server. It specifies the server's URL and type as 'http'. ```json { "mcp": { "servers": { "datarobot-local": { "url": "http://localhost:8080/mcp/", "type": "http" } } } } ``` -------------------------------- ### Run Datarobot MCP Server Locally Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/README.md Starts the MCP server locally from the `/mcp_server/` directory using the `task dev` command. The server will be accessible at `http://localhost:8080`. ```bash task dev ``` -------------------------------- ### Start and Execute in Dev Container Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/README.md Launches and executes commands within a pre-configured development container environment for DataRobot Agent Application. This command assumes the Dev Container CLI is installed and the workspace folder is the current directory. It's an experimental feature. ```shell devcontainer up --workspace-folder . && devcontainer exec --workspace-folder . /bin/sh ``` -------------------------------- ### Run Linting and Formatting Checks (Bash) Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/dev.md Command to install dependencies and run code quality checks including linting and formatting. This ensures code adheres to project standards for import sorting and general formatting. ```bash # Install dependencies and run linting/formatting uv sync --all-extras && uv run ruff check --select I --fix && uv run ruff format ``` -------------------------------- ### Remove .env File (Shell) Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/README.md In cases where the `dr start` wizard encounters issues due to existing configuration, removing the `.env` file (after backing it up) and restarting the wizard can resolve the problem. ```shell # Backup first if needed cp .env .env.backup rm .env dr start ``` -------------------------------- ### Check Node.js Version Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/README.md Displays the currently installed Node.js version. Ensures that the Node.js version meets the project's requirements (>= 24). ```sh node --version ``` -------------------------------- ### Run Interactive Tool Testing for MCP Server Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/README.md Initiates an interactive testing mode for the MCP server. This command starts the server (if not running), connects a local AI agent, and provides a chat interface for testing tools with real-time debug output. ```bash task test-interactive ``` -------------------------------- ### Configure Multiple MCP Servers (JSON) Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This JSON configuration allows specifying multiple Machine Communication Protocol (MCP) servers, such as local development and production environments. It includes the URL for each server and optional headers like authorization tokens for remote access. ```json { "mcpServers": { "local": { "url": "http://localhost:8080/mcp/" }, "production": { "url": "https://[YOUR_DATA_ROBOT_ENDPOINT]/deployments/[YOUR_DEPLOYMENT_ID]/directAccess/mcp/", "headers": { "Authorization": "Bearer [YOUR_DATA_ROBOT_API_KEY]" } } } } ``` -------------------------------- ### Verify Pulumi Configuration Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/README.md Checks if Pulumi is configured and logged in. If not, it guides the user to log in locally or create a Pulumi account. ```sh pulumi whoami ``` -------------------------------- ### OAuth Authentication Endpoints (curl) Source: https://context7.com/datarobot-community/datarobot-agent-application/llms.txt Examples of using curl to interact with OAuth authentication endpoints, including listing providers, initiating authorization, getting user info, obtaining tokens, validating tokens, and logging out. Requires session or API keys. ```bash # List available OAuth providers curl -X GET "http://localhost:8080/api/v1/oauth/" # Start OAuth authorization flow curl -X POST "http://localhost:8080/api/v1/oauth/authorize/?provider_id=google&redirect_uri=http://localhost:8080/callback" # Get current user information curl -X GET "http://localhost:8080/api/v1/user/" \ -H "Authorization: Bearer $SESSION_TOKEN" # Get OAuth token for identity curl -X POST "http://localhost:8080/api/v1/oauth/token/" \ -H "Authorization: Bearer $DR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"identity_id": 1, "scope": null}' # Validate OAuth tokens for all connected identities curl -X POST "http://localhost:8080/api/v1/oauth/validate/" \ -H "Authorization: Bearer $SESSION_TOKEN" # Logout user curl -X POST "http://localhost:8080/api/v1/logout/" ``` -------------------------------- ### Pulumi Infrastructure Deployment (Bash) Source: https://context7.com/datarobot-community/datarobot-agent-application/llms.txt Provides bash commands for managing the DataRobot application stack deployment using Pulumi. It covers dependency installation, local development startup, and deploying to DataRobot environments (production and development). ```bash # Install all dependencies task install # Run local development (all services) task dev # Deploy to DataRobot task deploy # or dr task run deploy # Deploy to development environment task deploy-dev ``` -------------------------------- ### FastAPI Custom Server Implementation (Python) Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/dynamic_tool_registration.md An example of a custom server using FastAPI that exposes the required `/info/` endpoint for dynamic tool registration. It defines request models using Pydantic and returns the necessary metadata, including the input schema. ```python from fastapi import FastAPI from pydantic import BaseModel, Field app = FastAPI() class WeatherRequest(BaseModel): class PathParams(BaseModel): city: str = Field(description="City name") class QueryParams(BaseModel): units: str = Field(default="metric", description="metric or imperial") path_params: PathParams query_params: QueryParams | None = None @app.get("/info/") async def metadata(): return { # Note: custom model deployments expose custom server endpoints behind 'directAccess/' "endpoint": "directAccess/weather/{city}", "method": "GET", "input_schema": WeatherRequest.model_json_schema() } @app.get("/weather/{city}") async def get_weather(city: str, units: str = "metric"): return {"city": city, "temp": 22, "units": units} ``` -------------------------------- ### Common Development Tasks with Taskfile Source: https://context7.com/datarobot-community/datarobot-agent-application/llms.txt This Bash snippet lists common commands for managing the DataRobot Agent Application development workflow using the Taskfile. It includes tasks for starting the environment, running services, testing, linting, and deployment. ```bash # Show all available tasks task # Prepare local development environment task start # Run all services together (frontend, backend, agent, MCP) task dev # Run tests across all components task test # Run linters task lint # Install all dependencies task install # Deploy to DataRobot task deploy # Check authentication task auth-check # Component-specific tasks task agent:dev # Run agent only task agent:test # Test agent task mcp_server:dev # Run MCP server only task frontend_web:dev # Run frontend only task fastapi_server:dev # Run backend only ``` -------------------------------- ### Check MCP Endpoint (Bash) Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This bash command verifies the availability and responsiveness of the MCP endpoint on the DataRobot server. It sends a GET request to the `/mcp/` path and expects MCP protocol information in the JSON response. ```bash curl http://localhost:8080/mcp/ ``` -------------------------------- ### Verify Server Health (Bash) Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This bash command uses `curl` to check if the DataRobot MCP server is running and responsive. It sends a GET request to the root endpoint and expects a JSON response indicating the server's status. ```bash curl http://localhost:8080/ ``` -------------------------------- ### Run Test Suite (Bash) Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/dev.md Commands for executing the project's test suite. Includes options for running all tests, tests with coverage, specific test files, and verbose output. ```bash # Install dependencies and run tests uv sync --all-extras && uv run pytest # Run tests with coverage uv run pytest --cov # Run specific test file uv run pytest tests/unit/test_user_tools.py # Run tests with verbose output uv run pytest -v ``` -------------------------------- ### Initialize Pulumi Local Backend Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/README.md This command initializes Pulumi and sets the local directory as the backend for storing application state. This is a simple option for local development, but DataRobot recommends using a shared backend for production environments. ```bash pulumi login --local ``` -------------------------------- ### Initialize Environment Variables and Include Assets (Jinja2) Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/fastapi_server/templates/index.html This snippet demonstrates how to initialize environment variables and dynamically include CSS and JavaScript files within a Jinja2 template. It iterates through provided lists of CSS and JS files to ensure all necessary assets are loaded for the application. ```jinja2 window.ENV = {{ env | tojson }}; {% for css in css_files %} {% endfor %} {% for js in js_files %} {% endfor %} ``` -------------------------------- ### LLM Configuration Options (Bash) Source: https://context7.com/datarobot-community/datarobot-agent-application/llms.txt Demonstrates how to configure different Large Language Model (LLM) backends using environment variables or symbolic links. Options include direct gateway connection, existing DataRobot LLM deployments, and external Azure OpenAI services. This allows flexibility in choosing the LLM provider. ```bash # Option 1: LLM Gateway Direct (default) export INFRA_ENABLE_LLM=gateway_direct.py # Option 2: Existing DataRobot LLM Deployment export TEXTGEN_DEPLOYMENT_ID=your_deployment_id export INFRA_ENABLE_LLM=deployed_llm.py # Option 3: External Azure OpenAI export INFRA_ENABLE_LLM=blueprint_with_external_llm.py export LLM_DEFAULT_MODEL="azure/gpt-5-mini-2025-08-07" export OPENAI_API_VERSION='2024-08-01-preview' export OPENAI_API_BASE='https://your-endpoint.openai.azure.com' export OPENAI_API_DEPLOYMENT_ID='your_deployment_id' export OPENAI_API_KEY='your_api_key' ``` ```bash # Manual configuration symlink (recommended) cd infra/infra ln -sf ../configurations/llm/gateway_direct.py llm.py ``` -------------------------------- ### Configure Cursor for Local MCP Server Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This JSON configuration sets up the Cursor editor to connect to a local MCP server. It defines a server named 'datarobot-local' with its URL. ```json { "mcpServers": { "datarobot-local": { "url": "http://localhost:8080/mcp/" } } } ``` -------------------------------- ### Deploy Project Infrastructure with Shell Command Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/AGENTS.md Initiates the deployment of the project's infrastructure using a predefined task. This command typically sets up all necessary cloud resources and services required for the application to run. ```shell dr task run infra:up-yes ``` -------------------------------- ### Check Port Availability Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This command checks if a specific port (e.g., 8080) is currently in use by any process. It should return empty output if the port is free or list the process using it. ```bash lsof -i :8080 # Expected: Empty output or process you can kill ``` -------------------------------- ### Configure Dynamic Tool Registration (Bash) Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/dev.md Configuration settings for enabling and customizing dynamic tool registration. These environment variables control whether the server automatically registers DataRobot deployments as MCP tools, allows tools with empty schemas, and how duplicate tools are handled. ```bash # Enable/disable Dynamic Tool Registration on startup (default: false) MCP_SERVER_REGISTER_DYNAMIC_TOOLS_ON_STARTUP=true # Allow tools with empty schemas (default: false) MCP_SERVER_TOOL_REGISTRATION_ALLOW_EMPTY_SCHEMA=true # Behavior when duplicate tools are found: 'error', 'warn', or 'ignore' (default: 'warn') MCP_SERVER_TOOL_REGISTRATION_DUPLICATE_BEHAVIOR=warn ``` -------------------------------- ### Define Feature Flags for Deployment Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This YAML configuration specifies required DataRobot features that must be enabled for a successful deployment. The deployment will fail early if these features are not present on the DataRobot instance. ```yaml # infra/feature_flags/mcp_features.yaml --- ENABLE_MLOPS: true ENABLE_PUBLIC_NETWORK_ACCESS_FOR_ALL_CUSTOM_MODELS: true ``` -------------------------------- ### Test DataRobot API Token and Endpoint Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This command verifies your DataRobot API token and endpoint by making a request to list projects. It expects a JSON response containing a 'count' field. ```bash curl -H "Authorization: Bearer $DATAROBOT_API_TOKEN" $DATAROBOT_ENDPOINT/api/v2/projects/ | head -1 # Expected: {"count": ...} or similar JSON response ``` -------------------------------- ### Configure VSCode for DataRobot Deployed MCP Server Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This JSON configuration allows VSCode to connect to an MCP server deployed on DataRobot. It includes the endpoint, deployment ID, and an Authorization header with an API key. ```json { "mcp": { "servers": { "datarobot-production": { "url": "https://[YOUR_DATA_ROBOT_ENDPOINT]/deployments/[YOUR_DEPLOYMENT_ID]/directAccess/mcp/", "type": "http", "headers": { "Authorization": "Bearer [YOUR_DATA_ROBOT_API_KEY]" } } } } } ``` -------------------------------- ### Configure Dynamic Prompt Registration (Bash) Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/dev.md Configuration settings for enabling and customizing dynamic prompt registration. These environment variables control whether the server automatically registers DataRobot prompts as MCP prompts and how duplicate prompts are handled. ```bash # Enable/disable Dynamic Prompt Registration on startup (default: false) MCP_SERVER_REGISTER_DYNAMIC_PROMPTS_ON_STARTUP=true # Behavior when duplicate prompts are found: 'error', 'warn', or 'ignore' (default: 'warn') MCP_SERVER_PROMPT_REGISTRATION_DUPLICATE_BEHAVIOR=warn ``` -------------------------------- ### Configure Cursor for DataRobot Deployed MCP Server Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This JSON configuration enables Cursor to connect to an MCP server deployed on DataRobot. It includes the DataRobot endpoint, deployment ID, and an Authorization header with an API key. ```json { "mcpServers": { "datarobot-production": { "url": "https://[YOUR_DATA_ROBOT_ENDPOINT]/deployments/[YOUR_DEPLOYMENT_ID]/directAccess/mcp/", "headers": { "Authorization": "Bearer [YOUR_DATA_ROBOT_API_KEY]" } } } } ``` -------------------------------- ### Configure Claude Desktop for DataRobot Deployed MCP Server Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This JSON configuration enables Claude Desktop to connect to an MCP server deployed on DataRobot. It uses 'mcp-remote' with the DataRobot endpoint, deployment ID, and an environment variable for the Authorization header. ```json { "mcpServers": { "datarobot-production": { "command": "npx", "args": [ "-y", "mcp-remote@latest", "https://[YOUR_DATA_ROBOT_ENDPOINT]/deployments/[YOUR_DEPLOYMENT_ID]/directAccess/mcp/", "--header", "Authorization: ${AUTH_HEADER}", "--transport", "http" ], "env": { "AUTH_HEADER": "Bearer [YOUR_DATA_ROBOT_API_KEY]" } } } } ``` -------------------------------- ### Configure Claude Desktop for Local MCP Server Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This JSON configuration sets up Claude Desktop to connect to a local MCP server using 'mcp-remote'. It specifies the command to run and its arguments, including the local server URL and transport type. ```json { "mcpServers": { "datarobot-local": { "command": "npx", "args": [ "-y", "mcp-remote@latest", "http://localhost:8080/mcp/", "--transport", "http" ] } } } ``` -------------------------------- ### Run Tests with Coverage Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/fastapi_server/README.md Executes tests using pytest and generates code coverage reports. This command is essential for ensuring the application's quality and identifying areas for improvement. ```bash uv run pytest --cov --cov-report term --cov-report html ``` -------------------------------- ### Kill Process on Port (Bash) Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This bash command identifies and terminates any process currently using port 8080. It uses `lsof` to list processes associated with the port and `xargs kill -9` to forcefully terminate them, useful for resolving port conflicts. ```bash lsof -i :8080 | xargs kill -9 ``` -------------------------------- ### VSCode Reload Window (Command Palette) Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/mcp_client_setup.md This command palette action in VSCode reloads the entire window, which can resolve issues related to extensions or configuration changes. It's accessed by opening the command palette (`Cmd+Shift+P` or `Ctrl+Shift+P`) and typing 'Developer: Reload Window'. ```plaintext Developer: Reload Window ``` -------------------------------- ### Environment Configuration for Local Development and Deployment Source: https://context7.com/datarobot-community/datarobot-agent-application/llms.txt This Bash snippet shows a template `.env` file for configuring DataRobot API credentials, agent settings, Pulumi deployment parameters, and other essential environment variables for local development and production deployments. ```bash # DataRobot credentials DATAROBOT_API_TOKEN=your_api_token DATAROBOT_ENDPOINT=https://app.datarobot.com/api/v2 # Agent configuration AGENT_PORT=8842 # Pulumi settings PULUMI_STACK_NAME=agent-application-dev PULUMI_CONFIG_PASSPHRASE=your_passphrase PULUMI_SKIP_UPDATE_CHECK=1 # DataRobot defaults DATAROBOT_DEFAULT_USE_CASE= DATAROBOT_DEFAULT_EXECUTION_ENVIRONMENT="[DataRobot] Python 3.11 GenAI Agents" # Session security (generate with: python -c "import os, binascii; print(binascii.hexlify(os.urandom(64)).decode('utf-8'))") SESSION_SECRET_KEY=your_secret_key # OAuth providers (optional) GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret # Database DATABASE_URI=sqlite+aiosqlite:///.data/database.sqlite # MCP Server MCP_SERVER_PORT=9000 MCP_SERVER_REGISTER_DYNAMIC_TOOLS_ON_STARTUP=false ``` -------------------------------- ### Enable Dynamic Tool Registration on Startup (Bash) Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/dynamic_tool_registration.md This environment variable enables the dynamic registration of tools on the MCP server startup. Set this to 'true' to activate the feature. ```bash MCP_SERVER_REGISTER_DYNAMIC_TOOLS_ON_STARTUP=true ``` -------------------------------- ### Configure Environment Variables for MCP Server Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/README.md Sets up the necessary environment variables for the MCP server by creating and editing a `.env` file within the `mcp_server/` directory. This includes API tokens, endpoint URLs, and security keys. ```bash # Required DATAROBOT_API_TOKEN=[YOUR_DATAROBOT_API_KEY] DATAROBOT_ENDPOINT=[YOUR_DATAROBOT_ENDPOINT] # Required: Random string for application security. Use a long password generated securely such as: # `python -c "import os, binascii; print(binascii.hexlify(os.urandom(64)).decode('utf-8'))" SESSION_SECRET_KEY=[YOUR_SESSION_SECRET_KEY] # Optional - Server configuration # MCP_SERVER_NAME=datarobot-mcp-server # MCP_SERVER_PORT=8080 # MCP_SERVER_LOG_LEVEL=WARNING # APP_LOG_LEVEL=INFO # Optional - Dynamic tool registration # MCP_SERVER_REGISTER_DYNAMIC_TOOLS_ON_STARTUP=false # Optional - MCP target_type configuration # USE_MCP_TARGET_TYPE=true # Set to false for older environments that don't support MCP # Optional - AWS credentials (for batch predictions and memory) # AWS_ACCESS_KEY_ID=your_aws_access_key # AWS_SECRET_ACCESS_KEY=your_aws_secret_key # AWS_PREDICTIONS_S3_BUCKET=your_s3_bucket # Optional - Dynamic prompt registration # MCP_SERVER_REGISTER_DYNAMIC_PROMPTS_ON_STARTUP=false ``` -------------------------------- ### MCP Server Configuration Source: https://context7.com/datarobot-community/datarobot-agent-application/llms.txt Configure and run the Model Context Protocol server for tool integration. ```APIDOC ## MCP Server Configuration ### Description Configure and run the Model Context Protocol server for tool integration. ### Method Python Script / Environment Variables ### Endpoint N/A ### Parameters #### Python Configuration (`main.py`) - **config_factory**: Factory function to get user configuration. - **credentials_factory**: Factory function to get user credentials. - **lifecycle**: Server lifecycle handler. - **additional_module_paths**: List of paths to additional modules for tools, prompts, and resources. - **transport**: The transport protocol to use (e.g., "streamable-http"). - **load_native_mcp_tools**: Boolean to indicate whether to load native MCP tools. #### Environment Variables - **MCP_SERVER_PORT**: The port the MCP server will run on (e.g., 9000). - **MCP_DEPLOYMENT_ID**: Deployment ID for a remote MCP server. - **EXTERNAL_MCP_URL**: URL for an external MCP server. - **EXTERNAL_MCP_HEADERS**: Headers for an external MCP server (JSON string). - **EXTERNAL_MCP_TRANSPORT**: Transport protocol for an external MCP server (e.g., "streamable-http", "sse"). ### Request Example ```python # mcp_server/app/main.py from datarobot_genai.drmcp import create_mcp_server # ... other imports server = create_mcp_server( config_factory=get_user_config, credentials_factory=get_user_credentials, lifecycle=ServerLifecycle(), additional_module_paths=[ ("app/tools", "app.tools"), ("app/prompts", "app.prompts"), ("app/resources", "app.resources"), ], transport="streamable-http", load_native_mcp_tools=True, ) server.run(show_banner=True) ``` ```bash # Environment variables for MCP configuration export MCP_SERVER_PORT=9000 export MCP_DEPLOYMENT_ID=your_deployment_id export EXTERNAL_MCP_URL=https://example.com/mcp export EXTERNAL_MCP_HEADERS='{"Authorization":"Bearer token123"}' export EXTERNAL_MCP_TRANSPORT=streamable-http ``` ### Response #### Success Response The MCP server starts and runs, listening for connections and processing requests based on the configuration. #### Response Example (Server startup logs and banner) ``` -------------------------------- ### Create Agent Node with Tools and System Prompt in Python Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/agent/AGENTS.md Creates an agent node using the `create_agent` function. This function takes the LLM, tools, and a system prompt as arguments to define the agent's behavior. ```python @property def agent_node(self) -> Any: return create_agent( self.llm(), tools=self.tools, # or [] for no tools system_prompt=make_system_prompt( "Your agent's system prompt here." ), ) ``` -------------------------------- ### get_deployment_training_data_sample Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/deployment_info_tools.md Retrieves a sample of the deployment's training data in CSV format, including metadata about the full dataset. ```APIDOC ## GET /deployments/{deployment_id}/training_data_sample ### Description Get actual examples of training data to understand the expected format. ### Method GET ### Endpoint `/deployments/{deployment_id}/training_data_sample` ### Parameters #### Path Parameters - **deployment_id** (string) - Required - The unique identifier of the deployment. #### Query Parameters None ### Request Example None (GET request) ### Response #### Success Response (200) - Returns a CSV file containing sample training data with metadata about the full dataset. #### Response Example (CSV content would be provided here, not representable in JSON structure) ``` -------------------------------- ### GET /directAccess/weather/{city} Source: https://github.com/datarobot-community/datarobot-agent-application/blob/main/mcp_server/docs/dynamic_tool_registration.md This endpoint retrieves weather information for a specified city. It supports query parameters for units. ```APIDOC ## GET /directAccess/weather/{city} ### Description Retrieves weather information for a specified city. The `city` is a path parameter, and `units` can be specified as a query parameter. ### Method GET ### Endpoint `/directAccess/weather/{city}` ### Parameters #### Path Parameters - **city** (string) - Required - The name of the city for which to retrieve weather data. #### Query Parameters - **units** (string) - Optional - Specifies the unit system for temperature (e.g., `imperial` or `metric`). Defaults to the system's default if not provided. ### Request Example ```json { "path_params": {"city": "paris"}, "query_params": {"units": "imperial"} } ``` ### Response #### Success Response (200) - **temperature** (number) - The current temperature in the specified units. - **description** (string) - A brief description of the current weather conditions. - **city** (string) - The name of the city. - **units** (string) - The units used for temperature (e.g., `imperial` or `metric`). #### Response Example ```json { "temperature": 75, "description": "Clear", "city": "Paris", "units": "imperial" } ``` ``` -------------------------------- ### Import Infrastructure Modules and Export Outputs Source: https://context7.com/datarobot-community/datarobot-agent-application/llms.txt This Python snippet demonstrates how to import necessary infrastructure modules and configure the output path for local development, saving outputs to a JSON file. ```python import_infra_modules() default_collector.output_path = Path("pulumi_config.json") finalize() ```