Nife MCP Server

Serveur MCP distant (OAuth) pour Nife : déployez et gérez des sites, surveillez le trafic, la disponibilité et les statistiques depuis Claude et d’autres clients MCP. Open source, MIT.

Serveur MCP hébergé

npx add-mcp 'https://mcp.on.nifetency.com/mcp'

S’installe dans Claude Code, Codex, Cursor et plus

Documentation

Nife.io MCP Server

Python License: MIT Downloads Code style: black

A Model Context Protocol (MCP) server that interfaces with the Nife.io GraphQL API

Installation • Quick Start • Documentation • Contributing


Overview

Nife MCP Server provides a standardized interface to interact with Nife.io's GraphQL API through the Model Context Protocol, enabling seamless integration with Claude Desktop and other MCP-compatible applications.

Key Features

  • Intelligent Schema Discovery - Automatically discovers and adapts to the GraphQL schema
  • Dynamic Tool Generation - Creates MCP tools on-the-fly from schema
  • Zero Configuration - Works out of the box with minimal setup
  • Secure Authentication - Bearer token support with flexible configuration
  • Multiple Install Methods - PyPI, NPM, or GitHub
  • Cross-Platform - Works on macOS, Linux, and Windows
  • Production Ready - Comprehensive error handling and logging

Installation

Option 1: PyPI (Recommended for Python users)

pip install nife-mcp-server

Option 2: NPM (Best for Claude Desktop)

npx @nifelabs/mcp-server@latest

Option 3: From Source

git clone https://github.com/nifetency/nife-mcp-server
cd nife-mcp-server
pip install -r requirements.txt

Quick Start

1. Get Your Access Token

nifectl auth login
nifectl auth token

2. Configure Claude Desktop

You can use the Nife MCP Server in three ways depending on your setup.


1. Recommended: Using NPX (No Installation Required)

This is the easiest way to get started.

{
  "mcpServers": {
    "nife": {
      "command": "npx",
      "args": ["--yes", "@nifelabs/mcp-server@latest"],
      "env": {
        "NIFE_ACCESS_TOKEN": "your_token_here",
        "PYTHON": "PYTHON_PATH"

      }
    }
  }
}

2. Using Python (Installed via pip)

If you installed the package via pip:

pip install nife-mcp-server

Use this configuration:

{
  "mcpServers": {
    "nife": {
      "command": "python",
      "args": ["-m", "nife_mcp_server"],
      "env": {
        "NIFE_ACCESS_TOKEN": "your_token_here"
      }
    }
  }
}

3. Local Development (Source Code)

If you're running from source:

{
  "mcpServers": {
    "nife": {
      "command": "python",
      "args": ["-m", "nife_mcp_server.intelligent_main"],
      "env": {
        "PYTHONPATH": "C:\\path\\to\\nife-mcp-server\\src",
        "NIFE_ACCESS_TOKEN": "your_token_here"
      }
    }
  }
}

Replace the PYTHONPATH with your local project path.


Environment Variables

Variable Description


NIFE_ACCESS_TOKEN Your API access token from Nife


3. Restart Claude Desktop

Your Nife.io integration is now active! 🎉

📚 Documentation

Hosted connector tools: reliability, cost and platform

The hosted connector (nife-mcp-http) adds curated tools on top of the site, app and custom-domain tools. The stdio server (intelligent_main.py) loads the same tools next to its schema-generated ones when the optional dependencies are installed (pip install "nife-mcp-server[http]", or pip install -r requirements.txt). It uses NIFE_ACCESS_TOKEN as the caller's token. Without those packages it runs with only the schema-generated tools and logs a hint on stderr. Every call is made with the caller's own token. Organization-keyed tools check membership first, and alert, billing cycle and recommendation ids are checked against the caller's own lists before use.

Reliability (NERO)

ToolWhat it does
get_health_insightsOverall health, open incidents, anomalies, predictions and actions. Start here
list_incidents, get_incidentIncidents and their post-mortems
get_root_cause_analysisAI root cause analysis (slow; refresh=true runs a new one)
list_alertsAlerts with status and who handled them
acknowledge_alert, resolve_alertChange alert state (confirm with the user first)
list_anomalies, predict_failuresDetected anomalies and predicted failures
get_slo_status, get_health_reportSLO and error budget; deep per-service health
search_knowledge_basePast incidents and fixes by error text

Cost (FinOps)

ToolWhat it does
get_spending_overview, get_usage_statsSpend against limits; resource usage and cost
list_billing_cycles, get_billing_items, list_invoices, get_cloud_billing_summaryBilling detail
list_cost_recommendationsRanked savings opportunities with totals
get_cost_forecast, get_cost_anomalies, get_cost_usage_patternsOutlook, unusual cost, and what the recommendations rest on
get_cost_breakdownCost explorer: total grouped by provider, service or region
search_finops_resources, get_finops_resource_statsMulti-cloud inventory with monthly cost
apply_cost_recommendationCarries out one recommendation. Previews unless confirm=true

Platform, delivery and compliance (read-only)

ToolWhat it does
get_org_dora_metricsDeployment frequency, lead time, change failure rate and time to restore
get_deployment_history, get_incident_historyDeployment and incident events of one app
get_usage_summary, get_app_cost, get_app_usage_metricsRunning cost per account and app; CPU, memory and network usage
estimate_deployment_cost, get_creditsPrice a deployment before making it; prepaid balance and transactions
get_volume_overview, get_app_failoverVolumes, health and snapshots; failover targets and which one serves
list_clusters, get_cluster_capacityRegions and clusters; free CPU, memory, storage and pods
list_cloud_hosts, list_workloadsConnected servers and VMs; workload environments
list_backup_policies, get_restore_historyBackup schedules and restore results
get_capacity_thresholds, get_usage_report_subscriptionCapacity alert thresholds; emailed usage report schedule
get_audit_log_summary, get_regulatory_reporting, get_incident_regulatory_reportsAudit trail size; on-time reporting to CERT-In, DPB, RBI, SEBI or IRDAI

These tools only read. Cloud credentials and kubeconfig locations are never requested.

Infrastructure and governance (read-only)

ToolWhat it does
list_connected_cloud_accountsEvery cloud account connected to an organization (AWS, GCP, Azure, OpenStack), without credentials. The site tool list_cloud_accounts lists only the AWS accounts a site can be hosted in
list_managed_clusters, list_vm_node_poolsProvisioned Kubernetes clusters (no kubeconfig) and VM pools
list_business_units, list_roles, get_plan_limitsBusiness units; role permissions; what the plan allows
list_agents, get_agent_metricsNife agents in customer clusters; cluster, node and app usage
get_agent_security_findings, get_agent_health_checksFindings with remediation; health checks per cluster
get_resource_forecastNia CPU and memory forecast for an organization or app (no charts)

The forecast service address can be changed with NIFE_LSTM_URL.

Virtual machines and cloud accounts (changes)

ToolWhat it does
vm_power_actionStart, stop or restart a server or VM. Previews unless confirm=true
validate_cloud_accountRe-check a cloud account's credentials and update its status

Cron jobs

ToolWhat it does
list_cron_job_runs, get_cron_job_run_logsRun history with failure reasons; the tail of one run's log
trigger_cron_job_runStart a run now. Previews unless confirm=true

Usage

Starting the Server

# If installed via pip
nife-mcp-server

# If running from source
python -m nife_mcp_server.intelligent_main

The server speaks MCP over stdin/stdout, so it is normally launched by your MCP client (e.g. Claude Desktop) rather than run by hand. It does not listen on a network port.

To run the hosted HTTP connector instead, install the http extra (pip install "nife-mcp-server[http]") and run nife-mcp-http. It listens on PORT (default 8000); see HOSTED.md.

Environment Variables

  • NIFE_ACCESS_TOKEN - Your Nife.io access token

The GraphQL endpoint is fixed to https://api.nife.io/graphql. The hosted connector has its own settings, listed in HOSTED.md.

Example Usage with Claude

Once configured, you can ask Claude:

"List all my applications in Nife.io"
"Show me the status of my deployments"
"Create a new application called 'my-app'"

Architecture

┌─────────────────┐
│  Claude Desktop │
└────────┬────────┘
         │ MCP Protocol
┌────────▼────────┐
│  Nife MCP Server│
└────────┬────────┘
         │ GraphQL
┌────────▼────────┐
│   Nife.io API   │
└─────────────────┘

Core Components

  • Schema Manager - Intelligent GraphQL schema introspection
  • Tool Generator - Dynamic MCP tool creation
  • Query Builder - Smart query construction
  • Authentication - Secure token management

API Endpoints

MCP Endpoints

EndpointMethodDescription
/api/mcp/contextGETRetrieve model context
/api/mcp/contextPOSTUpdate model context
/api/mcp/schemaGETGet GraphQL schema
/api/mcp/queryPOSTExecute custom queries
/api/mcp/healthGETHealth check

GraphQL Integration

The server provides full access to Nife.io's GraphQL API:

  • Query all resources (apps, deployments, etc.)
  • Execute mutations (create, update, delete)
  • Custom query execution
  • Schema introspection

Development

Setup Development Environment

# Clone the repository
git clone https://github.com/nifetency/nife-mcp-server
cd nife-mcp-server

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt
pip install -e .  # Install in editable mode



# Run the server
cd src
python -m nife_mcp_server.intelligent_main

Project Structure

nife-mcp-server/
├── src/
│   └── nife_mcp_server/
│       ├── intelligent_main.py  # Main server logic
│       ├── schema_manager.py    # GraphQL schema handling
│       ├── http_app.py          # Hosted (Streamable HTTP) connector
│       ├── http_auth.py         # Auth for the hosted connector
│       ├── oauth.py             # OAuth support
│       ├── nife_api.py          # Async client (GraphQL, express-backend, FinOps)
│       ├── tool_utils.py        # Shared tool helpers and ownership checks
│       ├── site_tools.py        # Site deploy, manage and inspect tools
│       ├── app_tools.py         # Container app tools
│       ├── domain_tools.py      # Custom-domain tools
│       ├── ops_tools.py         # NERO and FinOps tools
│       ├── platform_tools.py    # Delivery, compliance, usage and capacity tools
│       ├── infra_tools.py       # Cloud accounts, clusters, agents, governance
│       ├── vm_tools.py          # VM power actions and cloud account checks
│       ├── cron_tools.py        # Cron job runs
│       └── routes/
│           └── mcp.py          # MCP route handlers
├── tests/                      # Test suite
├── Dockerfile                  # Container image for the hosted server
└── bin/                        # Executable scripts

Running Tests

pytest
pytest --cov=nife_mcp_server  # With coverage

Contributing

We love contributions! Please see our Contributing Guide for details.

Ways to Contribute

  • Report bugs
  • Suggest features
  • Improve documentation
  • Submit pull requests

Development Process

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

Stats

GitHub stars GitHub forks GitHub issues GitHub pull requests

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Support

Roadmap

  • WebSocket support for real-time updates
  • GraphQL subscriptions
  • Enhanced caching layer
  • Query batching
  • Metrics and monitoring
  • Docker Compose examples
  • Kubernetes manifests

Star History

If you find this project useful, please consider giving it a star!

Star History Chart


Made by the Nife.io team

Website • Documentation • Blog • MCP Open Source