> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nofire.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Use the MCP server

> The tools NOFire AI exposes to your IDE, worked examples, and how to make an agent use them on every change.

Once the [MCP server is installed](/mcp/getting-started), your coding agent can ask NOFire AI about production without leaving the editor.

## Available tools

Once configured, these tools are available to your AI assistant:

| Tool                             | Use when                                                         |
| -------------------------------- | ---------------------------------------------------------------- |
| `nofire_search_entities`         | Discovering what infrastructure exists or verifying entity names |
| `nofire_get_entity_dependencies` | Understanding upstream/downstream service topology               |
| `nofire_get_entity_changes`      | Checking what changed recently (infra changes + VCS activity)    |
| `nofire_get_entity_metrics`      | Finding available Prometheus metrics and PromQL queries          |
| `nofire_assess_deployment_risk`  | Scoring risk before deploying changes                            |
| `nofire_analyze_blast_radius`    | Understanding cascading failure impact                           |
| `nofire_find_related_incidents`  | Checking incident history and root cause patterns                |
| `nofire_get_cluster_summary`     | Getting cluster-wide health overview                             |
| `nofire_get_recent_deploys`      | Seeing cluster-wide deploy + VCS timeline                        |

### Shift-left / proactive reliability

<AccordionGroup>
  <Accordion title="Assess Deployment Risk" icon="gauge-high">
    Score deployment risk for a service before merging:

    **Example:**

    ```
    What's the deployment risk for payment-service in prod?
    ```

    Uses `nofire_assess_deployment_risk` to calculate a weighted risk score (0-100) based on blast radius, dependency depth, incident history, and recent change velocity.

    Risk levels: **LOW** (0-39), **MEDIUM** (40-59), **HIGH** (60-79), **CRITICAL** (80-100).
  </Accordion>

  <Accordion title="Analyze Blast Radius" icon="bullseye">
    Understand cascading impact of service failures:

    **Example:**

    ```
    What's the blast radius if payment-service fails?
    ```

    Uses `nofire_analyze_blast_radius` to traverse the dependency graph and show direct + transitive impact.
  </Accordion>

  <Accordion title="Cluster Summary" icon="server">
    Get a cluster-wide health overview when you do not know where to start:

    **Example:**

    ```
    Give me a summary of the prod cluster in the last 6 hours
    ```

    Uses `nofire_get_cluster_summary` to show entity counts, top problematic services, and recent alert investigations.
  </Accordion>
</AccordionGroup>

### Incident response & RCA

<AccordionGroup>
  <Accordion title="Discover Entities" icon="search">
    Find services, pods, deployments in your cluster:

    **Example:**

    ```
    Show me all services with "payment" in the name
    ```

    Uses `nofire_search_entities` with partial name matching.
  </Accordion>

  <Accordion title="Get Entity Changes + VCS Activity" icon="clock-rotate-left">
    View recent infrastructure changes and correlated VCS activity (commits, PRs):

    **Example:**

    ```
    What changed in payment-service in the last 6 hours?
    ```

    Uses `nofire_get_entity_changes` which returns deployments, configuration updates, scaling events, plus merged PRs and pushes in the same time window.
  </Accordion>

  <Accordion title="Recent Deploys Timeline" icon="timeline">
    See cluster-wide deploy and change timeline:

    **Example:**

    ```
    Show me all deploys in prod in the last 24 hours
    ```

    Uses `nofire_get_recent_deploys` to show a chronological timeline of infra changes + VCS events across the cluster.
  </Accordion>

  <Accordion title="Find Related Incidents" icon="magnifying-glass-chart">
    Check incident history and root cause patterns:

    **Example:**

    ```
    Has payment-service had incidents in the last 30 days?
    ```

    Uses `nofire_find_related_incidents` with confidence filtering (only high-confidence root causes).
  </Accordion>

  <Accordion title="Get Dependencies" icon="diagram-nested">
    Explore service dependencies:

    **Example:**

    ```
    What services does payment-service depend on?
    ```

    Uses `nofire_get_entity_dependencies` to show upstream and downstream connections.
  </Accordion>
</AccordionGroup>

## Usage examples

### Pre-merge risk assessment

**Scenario:** You have modified payment processing code and want to assess risk before creating a PR.

**In Cursor:**

```
I've modified these files:
- src/services/payment/stripe-client.ts
- src/services/payment/processor.ts
- src/api/payment-routes.ts

Can you assess the deployment risk using NOFire AI?
```

**Cursor Response:**

```
I've analyzed your changes using NOFire AI:

Affected Services: 1 (payment-service)

Risk Assessment:
  Overall Risk: 0.82 (HIGH)
  
  Risk Breakdown:
    - Blast Radius: 0.85 (15 services affected)
    - Payment processing is on critical path
    - Dependency depth: 2 (mid-level service)
    - Recent stability: 0.70
  
  Deployment Strategy:
    ⚠️  HIGH RISK - Staged deployment mandatory
    
    1. Deploy to staging environment first
    2. Run full payment test suite
    3. Deploy to production with canary (5% traffic)
    4. Monitor for 2 hours before full rollout
    5. Notify #payments and #platform teams
    
  Critical Services in Blast Radius:
    - api-gateway (entry point)
    - billing-service (financial impact)
    - refund-service (payment flow)
    
  Recommendation: Schedule deployment during low-traffic window
  with team available for monitoring.
```

### Onboarding New engineers

**Scenario:** New team member needs to understand the production architecture.

**In Cursor:**

```
I'm new to this codebase. Can you use NOFire AI to show me:
1. What services we have in production
2. How the payment flow works (service dependencies)
```

**Cursor Response:**

```
I've queried NOFire AI about your production environment:

Services in Production (showing payment-related):
  - api-gateway (entry point for all traffic)
  - payment-service (core payment processing)
  - billing-service (invoicing and subscriptions)
  - stripe-integration-service (payment provider)
  - notification-service (payment confirmations)
  - audit-service (transaction logging)

Payment Flow Dependencies:
  
  api-gateway
    ↓ calls
  payment-service
    ↓ depends on
    ├─ stripe-integration-service (payment processing)
    ├─ billing-service (invoice creation)
    ├─ notification-service (customer emails)
    └─ audit-service (compliance logging)

Critical Services to be careful with:
  - payment-service: 15 services depend on this
  - api-gateway: Entry point, affects all traffic
  
Would you like me to explain what each service does or show
recent changes to any of them?
```

### Investigating Production behavior

**Scenario:** A service has been flaky, you want to understand what changed.

**In Claude Desktop:**

```
Using NOFire AI, what changes happened to user-service 
in the last 24 hours?
```

**Claude Response:**

```
I've queried NOFire AI for recent changes to user-service:

Recent Changes (last 24 hours):
  
  1. Deployment (14 hours ago)
     - Image: user-service:v2.1.4 → v2.1.5
     - Type: Rolling update
     - Status: Completed
  
  2. Configuration Change (8 hours ago)
     - ConfigMap updated: database connection pool
     - MAX_POOL_SIZE: 20 → 50
  
  3. Pod Restart (3 hours ago)
     - 2 pods restarted due to OOMKilled
     - Memory limit hit
  
  4. Scaling Event (1 hour ago)
     - Replicas: 3 → 5
     - Reason: High CPU usage

Potential Issues:
  - Memory limit may be too low after config change
  - Connection pool increase might be causing memory pressure
  - Recent scaling event suggests ongoing performance issues

Would you like me to analyze these changes for root cause?
```

## Best practices

<AccordionGroup>
  <Accordion title="Check Risk Before Every Merge" icon="code-branch">
    Make it a habit to check deployment risk before you create or approve a pull request.
  </Accordion>

  <Accordion title="Use NOFire AI for Onboarding" icon="graduation-cap">
    New team members can ask NOFire AI about production:

    * "What services do we have in production?"
    * "How does auth-service connect to user-service?"
    * "What changed in payment-service this week?"

    Makes production knowledge accessible without tribal knowledge bottlenecks.
  </Accordion>

  <Accordion title="Include Context in Queries" icon="message">
    Provide context about what you are doing:

    ❌ "Check risk"
    ✅ "I am updating payment API error handling. What is the deployment risk?"

    ❌ "What changed?"
    ✅ "What changed in auth-service in the last 24 hours?"
  </Accordion>

  <Accordion title="Use for Incident Investigation" icon="magnifying-glass">
    When something breaks, ask NOFire AI:

    * "What changed in \[service] before the incident?"
    * "Analyze \[service] changes from 2 hours ago"
    * "What services depend on \[broken-service]?"

    Speeds up incident response by making telemetry data queryable.
  </Accordion>

  <Accordion title="Share findings with your team" icon="users">
    When you discover critical dependencies or high-risk services, document them. Share what NOFire AI teaches you about production.
  </Accordion>
</AccordionGroup>

## Bonus: Automate with AGENTS.md

Make NOFire AI checks automatic by adding them to your `AGENTS.md` file. AI coding agents then always use NOFire AI for deployment risk and operational knowledge.

**Create or update `AGENTS.md` in your repository root:**

````markdown theme={"dark"}
# AGENTS.md

## NOFire AI MCP Integration

This project uses NOFire AI for deployment risk assessment and production knowledge.
NOFire AI MCP server is available in your IDE.

## When to use NOFire AI

**Automatically use NOFire AI in these scenarios:**

### Before Deployment (Shift-Left)
1. **Before completing any task** - Always assess deployment risk
2. **When modifying services** - Understand which production services are affected
3. **Before suggesting a merge**: check that it is safe to deploy
4. **On refactoring** - Check blast radius and dependency impact

### Production Knowledge (Anytime)
5. **When user asks about production** - Answer with real production data
6. **During incident investigation** - Find what changed recently
7. **For onboarding new engineers** - Help understand production architecture
8. **When debugging** - Query service dependencies and recent changes

## Required Pre-Merge Workflow

Before marking any task complete or suggesting a merge:

1. Run tests
2. **Discover affected entities:**
   ```
   nofire_search_entities(name="payment", cluster="prod")
   ```
3. **Assess deployment risk:**
   ```
   nofire_assess_deployment_risk(entity_name="payment-service", cluster="prod")
   ```
4. **Show the user** the risk score and recommendations
5. **For HIGH/CRITICAL risk**, check blast radius:
   ```
   nofire_analyze_blast_radius(entity_name="payment-service", cluster="prod")
   ```

## Risk score interpretation

- **CRITICAL (80-100)**: Peer review + feature flags required. Never deploy Fridays.
- **HIGH (60-79)**: Staged rollout, deploy during business hours with team available.
- **MEDIUM (40-59)**: Consider canary rollout (10% → 50% → 100%).
- **LOW (0-39)**: Standard deployment is safe.

## Available NOFire AI MCP Tools

| Tool | Use when |
|------|----------|
| `nofire_search_entities` | Discovering what infrastructure exists or verifying entity names |
| `nofire_get_entity_dependencies` | Understanding upstream/downstream service topology |
| `nofire_get_entity_changes` | Checking what changed recently (infra + VCS activity) |
| `nofire_get_entity_metrics` | Finding available Prometheus metrics and PromQL queries |
| `nofire_assess_deployment_risk` | Scoring risk before deploying changes |
| `nofire_analyze_blast_radius` | Understanding cascading failure impact |
| `nofire_find_related_incidents` | Checking incident history and root cause patterns |
| `nofire_get_cluster_summary` | Getting cluster-wide health overview (start here if unsure) |
| `nofire_get_recent_deploys` | Seeing cluster-wide deploy + VCS timeline |

## Connecting code to production

1. Use `nofire_get_entity_changes` or `nofire_get_recent_deploys` to find commit SHAs and PR references
2. Search the codebase for those commits to understand the code diff
3. Cross-reference with `nofire_find_related_incidents` to check if similar changes caused issues before

## When NOT to Use NOFire AI

Skip NOFire AI for:
- Documentation-only changes (*.md files)
- Test-only changes (no production code modified)
- Local development config (non-production)
- README updates, comment changes

## Critical Rule

**Always call NOFire AI before suggesting a merge that modifies production code.**
````

**Why this works:**

* Works with Cursor, GitHub Copilot, Jules, Aider, and most AI coding agents
* Makes shift-left and operational knowledge automatic
* Entire team follows same safety checks and has access to production knowledge

## Next steps

<CardGroup cols="2">
  <Card title="Troubleshooting" icon="wrench" href="/mcp/troubleshooting">
    The server does not appear, a tool returns nothing, or a token is rejected.
  </Card>

  <Card title="Deployment risk" icon="shield" href="/deployment-risk">
    What NOFire AI checks before you deploy.
  </Card>
</CardGroup>
