Skip to main content
Glama
AaLexUser

mcp-wait

by AaLexUser
README.md
<div align="center">

# `mcp-wait`

[![TypeScript](https://img.shields.io/badge/TypeScript-5.8-white.svg)](https://www.typescriptlang.org/)
[![MCP server](https://img.shields.io/badge/MCP-server-white.svg)](https://modelcontextprotocol.io/)
[![License: MIT](https://img.shields.io/badge/License-MIT-white.svg)](https://opensource.org/licenses/MIT)

</div>

An MCP server that provides a `wait` tool for AI agents to pause execution until a time duration elapses or a process terminates. Useful for polling scenarios, waiting for builds, deployments, etc.

## Installation

```bash
npm install && npm run build
```

## Usage with MCP Clients

Add to your MCP client configuration (e.g., Claude Desktop, Claude Code):

```json
{
  "mcpServers": {
    "wait": {
      "command": "npx",
      "args": ["-y", "github:AaLexUser/mcp-wait"]
    }
  }
}
```

## Tool: `wait`

**Arguments** (at least one required):

| Argument | Type   | Description                          |
|----------|--------|--------------------------------------|
| `seconds`| number | Seconds to wait                      |
| `pid`    | number | Process ID to monitor until exit     |

**Behavior:**
- Only `seconds` → wait N seconds
- Only `pid` → wait until process exits
- Both → wait until **first** condition is met

**Returns:** A message indicating why waiting stopped and how long was waited.

## Examples

- Wait 5 seconds: `{ "seconds": 5 }`
- Wait for process 1234: `{ "pid": 1234 }`
- Wait up to 30 seconds for process 1234: `{ "seconds": 30, "pid": 1234 }`

## Development

```bash
npm run build    # Compile TypeScript
npm run lint     # Run ESLint
npm run format   # Format with Prettier
npm run check    # Lint + format check
```

## License

[MIT](./LICENSE)