semvec/pypi-packages huggingface dataset:
m2ai-mcp-n8n-advisor 1.0.0
MCP server for n8n workflow management
License: MIT
Requires Python: >=3.11
Keywords: ai, automation, claude, mcp, model-context-protocol, n8n, workflow

# n8n Advisor

MCP server for n8n workflow management. Provides AI assistants with the ability to review workflow status in n8n instances.

## Features

- **check_workflows**: Reviews all workflows and reports their status, including active/inactive counts and workflows with recent errors.

## Installation

```bash
pip install m2ai-mcp-n8n-advisor
```

## Configuration

Create a `.env` file or set environment variables:

```bash
# Base URL of your n8n instance (no trailing slash)
N8N_BASE_URL=https://your-n8n-instance.app.n8n.cloud

# API key from n8n Settings > API
N8N_API_KEY=your_api_key_here
```

### Getting Your n8n API Key

1. Open your n8n instance
2. Go to **Settings** > **API**
3. Create a new API key or copy an existing one
4. Use the full URL of your n8n instance for `N8N_BASE_URL`

## Usage

### Claude Desktop Configuration

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "n8n": {
      "command": "n8n-advisor",
      "env": {
        "N8N_BASE_URL": "https://your-n8n-instance.app.n8n.cloud",
        "N8N_API_KEY": "your_api_key_here"
      }
    }
  }
}
```

Or run directly with Python:

```json
{
  "mcpServers": {
    "n8n": {
      "command": "python",
      "args": ["-m", "n8n_mcp.server"],
      "env": {
        "N8N_BASE_URL": "https://your-n8n-instance.app.n8n.cloud",
        "N8N_API_KEY": "your_api_key_here"
      }
    }
  }
}
```

## Available Tools

### check_workflows

Reviews all workflows and reports their status.

**Parameters**: None

**Returns**:
- `total_workflows`: Total number of workflows
- `active_workflows`: Number of active workflows
- `inactive_workflows`: Number of inactive workflows
- `workflows_with_errors`: Count of workflows with recent errors
- `error_workflows`: List of workflows with errors (id, name, error count)
- `workflows`: Detailed list of all workflows with execution stats

**Example Response**:
```json
{
  "total_workflows": 5,
  "active_workflows": 3,
  "inactive_workflows": 2,
  "workflows_with_errors": 1,
  "error_workflows": [
    {"id": "2", "name": "Data Sync", "errors": 3}
  ],
  "workflows": [
    {
      "id": "1",
      "name": "Email Notifications",
      "active": true,
      "recent_executions": {
        "success": 10,
        "error": 0,
        "waiting": 0,
        "running": 0
      }
    }
  ]
}
```

## Development

```bash
# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run tests with coverage
pytest --cov=n8n_mcp

# Type checking
mypy src/

# Linting
ruff check src/
```

## License

MIT
typed-envs 0.2.4
Typed environment variables for python applications.
License: MIT
Requires Python: <4,>=3.9

## Typed Envs

typed_envs is used to create specialized `EnvironmentVariable` objects that behave exactly the same as any other instance of the `typ` used to create them.

typed_envs is used for:
    - defining your envs in a readable, user friendly way
    - enhancing type hints for the returned instances
    - enhancing __repr__ of the returned instance with extra contextual information

In the example below, `some_var` can be used just like as any other `int` object.

```
import typed_envs
some_var = typed_envs.create_env("SET_WITH_THIS_ENV", int, 10)
>>> isinstance(some_var, int)
True
>>> isinstance(some_var, EnvironmentVariable)
True
```

There are only 2 differences between `some_var` and `int(10)`:
    - `some_var` will properly type check as an instance of both `int` and `EnvironmentVariable`
    - `some_var.__repr__()` will include contextual information about the `EnvironmentVariable`.

```
>>> some_var
<EnvironmentVariable[name=`SET_WITH_THIS_ENV`, type=int, default_value=10, current_value=10, using_default=True]>
>>> str(some_var)
"10"
>>> some_var + 5
15
>>> 20 / some_var
2
```

### Mypy plugin

Mypy cannot natively model the dynamic subclass created by typed_envs. If you
want mypy to treat `EnvironmentVariable[T]` as having the methods and attributes
of both `EnvironmentVariable` and its underlying `T` (including for
`create_env(...)` and `EnvVarFactory.create_env(...)`), enable the plugin:

```
[mypy]
plugins = typed_envs.mypy_plugin
```

For `pyproject.toml` users:

```
[tool.mypy]
plugins = ["typed_envs.mypy_plugin"]
```

The plugin synthesizes a mypy-only class that inherits from both
`EnvironmentVariable` and the underlying type, so you can call methods from
either side without casts. It also preserves unions, optionals, and common
typing constructs like `Annotated`, `TypedDict`, and `Literal`.