# PwC Coding Agents Budget MCP Server

A local MCP (Model Context Protocol) server that provides PwC Coding Agents budget status information to Claude Code.

## Features

- Real-time budget monitoring through MCP
- Client-side caching (60s TTL) to minimize API calls
- Automatic configuration from Claude Code settings
- Zero external dependencies (uses your existing Claude Code auth)

## Prerequisites

- Node.js >= 18.0.0
- Claude Code configured with PwC AI-CoE Coding Agents Gateway

## Installation

Download and install the MCP server:

```bash
# Download the package
curl -O https://idi-coding-agents.pwc.it/downloads/pwc-budget-mcp-server.tgz

# Install globally
npm install -g ./pwc-budget-mcp-server.tgz
```

## Configuration

Add the MCP server to your `~/.claude/settings.json`:

```json
{
  "mcpServers": {
    "pwc-budget": {
      "command": "pwc-budget-mcp"
    }
  }
}
```

## Usage

Once configured, you can query your budget status in Claude Code:

- **Ask Claude**: "What's my PwC Coding Agents budget status?"
- **Use the tool**: Claude will automatically call `get_budget_status` when needed
- **Access resource**: The budget status is available at `budget://status`

## How It Works

The MCP server:
1. Reads your `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN` from `~/.claude/settings.json`
2. Queries the `/quota/status` endpoint at the gateway
3. Caches the response for 60 seconds to avoid excessive API calls
4. Exposes budget info through MCP protocol

## Cache Behavior

- Cache TTL: 60 seconds
- Cache location: In-memory (cleared on server restart)
- Automatic refresh: Cache is refreshed when expired

## Troubleshooting

### Server not starting

Ensure Node.js >= 18 is installed:
```bash
node --version
```

### Budget data not showing

1. Verify Claude Code settings contain `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN`
2. Test connectivity to the gateway:
   ```bash
   curl https://idi-coding-agents.pwc.it/quota/status
   ```
3. Ensure you're connected to PwC VPN

### "Unknown tool" errors

Restart Claude Code to reload the MCP server configuration.

## License

UNLICENSED - Internal PwC tool
