Skip to main content

A stdio bridge for the Alara MCP API

Project description

Alara Bridge (StdIO)

This package provides a Machine Cognition Protocol (MCP) bridge using standard input/output (stdio) to connect an MCP client (like Cursor) to the Alara backend API.

Features

  • Dynamically fetches available tools from the Alara OpenAPI schema.
  • Executes tool calls by forwarding requests to the Alara API.
  • Authenticates with the backend using an API key provided via environment variable.

Installation

# Install from PyPI
pip install alara

Configuration

This bridge uses the command-based configuration method for MCP clients like Cursor. The package includes a helper script to generate the necessary JSON snippet for you.

  1. Install the package:

    pip install alara
    
  2. Generate your API Key: Obtain your API key from the Alara platform dashboard.

  3. Generate MCP Configuration: Run the following command in your terminal, replacing YOUR_ALARA_API_KEY_HERE with the key you obtained:

    python -m alara.main --api-key YOUR_ALARA_API_KEY_HERE --print-mcp-config
    

    (Note: If python doesn't work, try python3)

  4. Copy the Output: The command will print a JSON object similar to the example below. Copy this entire object.

    {
        "mcpServers": {
            "alara": {
                "name": "Alara",
                "description": "Alara Bridge (Python Module)",
                "protocol": "stdio",
                "command": "/path/to/installed/python", // Path to python in venv
                "args": ["-m", "alara.main"],
                "cwd": "/path/to/alara/project/root",
                "env": {
                    "ALARA_API_KEY": "YOUR_ALARA_API_KEY_HERE", // Your key inserted here
                    "ALARA_MCP_URL": "https://alara-mcp.skolp.com" // Changed default backend URL
                }
            }
        }
    }
    

    (The command and cwd paths will be automatically detected based on your installation.)

  5. Configure Cursor: Open your Cursor configuration file (e.g., ~/.cursor/mcp.json) and paste the copied JSON object into the "mcpServers" section (or merge it if the section already exists).

  6. Reload MCP Clients: Reload the clients in Cursor (e.g., via the command palette).

Development Setup

  1. Clone the repository:

    git clone https://github.com/rizkisyaf/alara.git
    cd alara
    
  2. Create a Python virtual environment:

    python3 -m venv venv
    source venv/bin/activate 
    
  3. Install dependencies, including development tools:

    pip install -e ".[dev]" 
    

    (Note: Requires defining [project.optional-dependencies] in pyproject.toml if you have dev tools like pytest, ruff, etc.)

  4. Create a .env file in the project root with your API key for local testing:

    ALARA_API_KEY=YOUR_ALARA_API_KEY_HERE
    ALARA_MCP_URL=https://alara-mcp.skolp.com # Changed default backend URL
    # Optional: Set LOG_LEVEL=DEBUG for more verbose logging
    # LOG_LEVEL=DEBUG 
    
  5. Run the bridge directly (for testing purposes):

    python -m alara.main 
    

License

This project is licensed under the MIT License - see the LICENSE file for details (if one exists).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alara-0.3.3.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alara-0.3.3-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file alara-0.3.3.tar.gz.

File metadata

  • Download URL: alara-0.3.3.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for alara-0.3.3.tar.gz
Algorithm Hash digest
SHA256 9323cfa2197551ad3959cf583db2644769d55bbebe571a3c0ece8caa8ff60f63
MD5 1bd8d18f6227cc46945ee829f1c7b7f9
BLAKE2b-256 da1fee03395c02c978a8c9290569cc50ecf40111e4e7398aa83607c4def22cc2

See more details on using hashes here.

File details

Details for the file alara-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: alara-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for alara-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e82726e63af8986a7922f2bfc8abe3d9ac0b830fc94f9252d46f0c91a7b52d70
MD5 61c2586efd8c94cd9e17882c55da0f7e
BLAKE2b-256 d3a1356197244b5bb0d9aefe95343d6c31257c0b18e3896f7d1b236182351467

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page