🤖 Criage MCP Server

Documentation for the MCP server for integrating Criage with AI tools via the Model Context Protocol.

Overview

Criage MCP Server provides full package manager functionality via the MCP (Model Context Protocol) for integration with AI tools.

What is MCP Server?

MCP Server allows AI assistants to directly interact with Criage for:

  • 🔍 Package search and installation - AI can find suitable packages and install them
  • 📦 Dependency management - automatic conflict resolution and updates
  • 🆕 Creating new packages - structure generation and manifest setup
  • 🔨 Building and publishing packages - automating the release process
  • 📊 Information retrieval - analyzing package and repository status

Benefits of AI Integration

🎯 Intelligent Search

AI understands your needs and finds suitable packages even from vague descriptions.

⚡ Automation of Routine

Automatic execution of common operations: installation, updates, project creation.

🔧 Smart Configuration

AI helps with configuration and solving compatibility issues.

Installation

Requirements

  • Go 1.21 or higher
  • Installed Criage
  • Claude Desktop or other MCP client

Building the Server

# Navigate to mcp-server directory
cd mcp-server

# Install dependencies
go mod tidy

# Build the server
go build -o criage-mcp-server.exe .
Note: On Windows use the .exe extension, on Linux/macOS you can omit the extension.

Integration with Claude Desktop

Configuration Setup

Add the MCP Server to Claude Desktop configuration:

Windows

Edit the file %APPDATA%\Claude\config.json:

{
  "mcpServers": {
    "criage": {
      "command": "C:\\path\\to\\criage-mcp-server.exe",
      "args": [],
      "env": {}
    }
  }
}

Linux/macOS

Edit the file ~/.config/claude-desktop/config.json:

{
  "mcpServers": {
    "criage": {
      "command": "/path/to/criage-mcp-server",
      "args": [],
      "env": {}
    }
  }
}

Verifying Integration

  1. Restart Claude Desktop
  2. Criage tools should appear in a new chat
  3. Try the query: "Show me available Criage tools"
Test: Send the message "Show all installed packages" in Claude Desktop. AI should use the list_packages tool and show the result.

Available Tools

📦 Package Management

  • install_package - Install package from repository
  • uninstall_package - Remove installed package
  • update_package - Update package to latest version
  • list_packages - List all installed packages

🔍 Search and Exploration

  • search_packages - Search packages by keywords
  • package_info - Detailed package information
  • repository_info - Repository information

🛠️ Development

  • create_package - Create new package
  • build_package - Build package
  • publish_package - Publish package to repository

Tool Parameters

Each tool accepts various parameters for precise operation configuration:

install_package

{
  "name": "package-name",        // Required: package name
  "version": "1.2.3",           // Optional: specific version
  "global": false,              // Optional: global installation
  "force": false,               // Optional: force reinstallation
  "arch": "amd64",             // Optional: target architecture
  "os": "windows"              // Optional: target OS
}

search_packages

{
  "query": "web framework",     // Required: search query
  "limit": 10,                 // Optional: maximum results
  "category": "web"            // Optional: filter by category
}

Usage Examples

Search and Install Package

User query: "Find a package for working with JSON and install it"

AI actions:
1. Uses search_packages with query "JSON"
2. Analyzes results and selects suitable package
3. Uses install_package for installation
4. Confirms successful installation

Creating New Project

User query: "Create a new package for REST API client"

AI actions:
1. Uses create_package with appropriate parameters
2. Configures manifest with description and dependencies
3. Suggests installing necessary packages for development
4. Explains the structure of the created project

Dependency Management

User query: "Show all outdated packages and update them"

AI actions:
1. Uses list_packages with outdated filter
2. For each outdated package uses update_package
3. Shows update results
4. Warns about possible conflicts

Repository Analysis

User query: "Show repository statistics and most popular packages"

AI actions:
1. Uses repository_info to get statistics
2. Analyzes data about package count and authors
3. Shows top popular packages
4. Provides usage recommendations

Configuration

Automatic Configuration

MCP Server uses standard Criage configuration from ~/.criage/config.json. On first run, default configuration is automatically created:

{
  "repositories": [
    {
      "name": "default",
      "url": "http://localhost:8080", 
      "priority": 1,
      "enabled": true
    }
  ],
  "global_path": "~/.criage/packages",
  "local_path": "./criage_modules",
  "cache_path": "~/.criage/cache",
  "temp_path": "~/.criage/temp",
  "timeout": 30,
  "max_concurrency": 4,
  "compression_level": 3,
  "force_https": false
}

Environment Variables

You can use environment variables to configure server behavior:

# Enable verbose logging
set CRIAGE_DEBUG=1

# Override config path
set CRIAGE_CONFIG_PATH=C:\custom\config.json

# Disable colors in output
set NO_COLOR=1

Repository Configuration

If you're using a custom Criage repository, update the configuration:

{
  "repositories": [
    {
      "name": "production",
      "url": "https://packages.mycompany.com",
      "priority": 10,
      "enabled": true,
      "token": "your-access-token"
    },
    {
      "name": "development", 
      "url": "https://dev-packages.mycompany.com",
      "priority": 5,
      "enabled": true
    }
  ]
}

Troubleshooting

Server Won't Start

Problem: MCP Server doesn't respond to Claude Desktop requests

Solutions:

  1. Ensure Go is installed correctly: go version
  2. Check executable file permissions
  3. Ensure ~/.criage directory is writable
  4. Check the path in Claude Desktop configuration is correct

Tools Not Showing in Claude

Problem: Claude Desktop doesn't show Criage tools

Solutions:

  1. Check JSON syntax in config.json
  2. Restart Claude Desktop
  3. Ensure server path is specified correctly
  4. Check Claude Desktop logs for errors

Package Operation Errors

Problem: Package operations fail with errors

Solutions:

  1. Check Criage repository availability
  2. Ensure repository configuration is correct
  3. Check access permissions to installation directories
  4. Enable debug mode: set CRIAGE_DEBUG=1

Debugging and Logging

Enable verbose logging for problem diagnosis:

# Windows
set CRIAGE_DEBUG=1
criage-mcp-server.exe

# Linux/macOS  
export CRIAGE_DEBUG=1
./criage-mcp-server

Compatibility Check

Ensure version compatibility:

  • Windows 10/11 - full support
  • Ubuntu 20.04+ - full support
  • macOS 10.15+ - full support
  • Claude Desktop - primary client
  • ⚠️ Other MCP clients - basic support
Getting Help: If the problem persists, create an issue in the GitHub repository with detailed problem description and debug logs.