Skip to content

Conversation

danielchalef
Copy link
Member

Summary

  • Add conductor.json configuration with setup and run scripts for Conductor development workspaces
  • Add automated conductor-setup.sh script that installs dependencies and prepares workspace
  • Support both REST API development (FastAPI server) and MCP server development workflows

Key Features

  • Setup script: Automated dependency installation for core, server, and MCP components
  • REST API development: run script starts FastAPI server with auto-reload and dynamic port
  • MCP development: run-mcp script starts MCP server with SSE transport for AI assistant integration
  • Environment handling: Automatically copies .env configuration from repository root
  • Fail-fast validation: Checks for required tools and provides helpful error messages

Test Plan

  • Setup script successfully installs all dependencies
  • Environment configuration is properly copied
  • Code formatting runs without errors
  • FastAPI server starts correctly via "Run" button
  • MCP server starts correctly via custom script

This enables team members to quickly set up consistent development environments using Conductor workspaces.

🤖 Generated with Claude Code

- Add conductor.json with setup, run (REST API), and run-mcp scripts
- Add conductor-setup.sh for automated dependency installation
- Support both FastAPI server and MCP server development workflows
- Include environment setup and initial code formatting

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
# Copy environment file if it exists in the root
if [ -f "$CONDUCTOR_ROOT_PATH/.env" ]; then
echo "📋 Copying environment configuration..."
cp "$CONDUCTOR_ROOT_PATH/.env" .env
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security concern: Using cp without validation could potentially overwrite sensitive files. Consider adding validation to ensure the source file exists and is readable before copying:

Suggested change
cp "$CONDUCTOR_ROOT_PATH/.env" .env
if [ -f "$CONDUCTOR_ROOT_PATH/.env" ] && [ -r "$CONDUCTOR_ROOT_PATH/.env" ]; then
echo "📋 Copying environment configuration..."
cp "$CONDUCTOR_ROOT_PATH/.env" .env


# Install server dependencies
echo "📦 Installing server dependencies..."
cd server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best practice improvement: The script changes directories multiple times without error handling. If cd server fails, subsequent commands will run in the wrong directory. Consider using subshells or better error handling:

Suggested change
cd server
# Install server dependencies
echo "📦 Installing server dependencies..."
(cd server && uv sync --extra dev) || {
echo "❌ Failed to install server dependencies"
exit 1
}


# Run initial checks to ensure everything is working
echo "🔍 Running initial checks..."
uv run ruff check --select I --fix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance consideration: Running ruff format on the entire codebase during setup might be unnecessary and could modify files unexpectedly. Consider either:

  1. Just checking format without fixing: uv run ruff check --select I
  2. Or making this optional with a flag
  3. Or limiting scope to avoid modifying existing code
Suggested change
uv run ruff check --select I --fix
# Run initial checks to ensure everything is working (without modifying files)
echo "🔍 Running initial checks..."
uv run ruff check --select I
echo "✨ Graphiti workspace setup complete!"

"scripts": {
"setup": "./conductor-setup.sh",
"run": "cd server && uv run uvicorn graph_service.main:app --reload --port $CONDUCTOR_PORT",
"run-mcp": "cd mcp_server && uv run python graphiti_mcp_server.py --transport sse --use-custom-entities"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robustness suggestion: The MCP server command uses hardcoded flags that may not work in all environments. Consider making the transport and custom entities configurable via environment variables:

Suggested change
"run-mcp": "cd mcp_server && uv run python graphiti_mcp_server.py --transport sse --use-custom-entities"
"run-mcp": "cd mcp_server && uv run python graphiti_mcp_server.py --transport ${MCP_TRANSPORT:-sse} ${MCP_CUSTOM_ENTITIES:+--use-custom-entities}"

This would allow users to override defaults while maintaining backward compatibility.

@claude
Copy link
Contributor

claude bot commented Sep 28, 2025

Overall Review

This PR adds Conductor workspace configuration files to enable quick development environment setup. The implementation is solid but has several areas for improvement:

Strengths

  • Clear purpose: Well-documented configuration for development workflows
  • Comprehensive setup: Handles both core, server, and MCP components
  • Good UX: Helpful error messages and guidance for users
  • Proper structure: Follows logical dependency installation order

🔧 Areas for Improvement

Security & Robustness:

  • Environment file copying lacks validation (see inline comment)
  • Directory changes without proper error handling could cause issues
  • Ruff formatting during setup might unexpectedly modify existing code

Configuration:

  • MCP server flags are hardcoded - consider making them configurable
  • Missing validation that required directories exist before trying to cd into them

📋 Recommendations

  1. Add validation before file operations and directory changes
  2. Use subshells or better error handling for directory operations
  3. Make setup less invasive by avoiding automatic code formatting
  4. Consider environment variable configuration for MCP server options

🧪 Testing

The PR description indicates some manual testing was done, but consider adding:

  • Validation that setup script works in clean environment
  • Testing error cases (missing uv, missing directories, etc.)

The core functionality looks good and will be valuable for team productivity. The suggested improvements would make it more robust and user-friendly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant