open-index/open-npm huggingface dataset:
npm package: @riant/docker-bash-mcp
Description: MCP for interactive Docker container sessions with persistent shell access
Author: Riant
Latest version: 1.0.0

# Docker Bash MCP

一个用于与 Docker 容器进行交互式会话的 MCP (Model Context Protocol) 服务器。

## 为什么需要这个 MCP？

现有的 Docker MCP 工具大多只能执行一次性命令（如 `docker exec ... -c "command"`），每次执行都是独立的会话，无法保持状态。

本 MCP 的核心优势：

- **持久会话** - 创建会话后可以持续交互，工作目录、环境变量等状态都会保持
- **像人工操作** - AI 可以像真人一样进入容器，执行一系列命令，然后退出
- **简单直接** - 5 个工具，逻辑清晰，易于使用

## 安装与配置

### 方式一：使用 npx（推荐）

无需手动 clone 和安装依赖，直接在 MCP 客户端配置：

```json
{
  "mcpServers": {
    "docker-bash": {
      "command": "npx",
      "args": ["-y", "@riant/docker-bash-mcp"]
    }
  }
}
```

npx 会自动下载包并安装依赖，开箱即用。

### 方式二：手动安装

```bash
git clone https://github.com/Riant/docker-bash-mcp.git
cd docker-bash-mcp
npm install
```

配置：

```json
{
  "mcpServers": {
    "docker-bash": {
      "command": "node",
      "args": ["/path/to/docker-bash-mcp/index.js"]
    }
  }
}
```

## 工具列表

### 1. docker_create_session

创建与 Docker 容器的交互会话。

**参数：**
| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| container_id | string | 是 | 容器 ID 或名称 |
| shell | string | 否 | 使用的 shell，默认 `/bin/bash` |
| user | string | 否 | 以指定用户运行 |

**返回：**
```json
{
  "success": true,
  "session": {
    "sessionId": "xxx-xxx-xxx",
    "containerId": "my-container",
    "shell": "/bin/bash"
  }
}
```

### 2. docker_execute

在会话中执行命令。命令会在会话的当前工作目录下执行。

**参数：**
| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| session_id | string | 是 | 会话 ID |
| command | string | 是 | 要执行的命令 |

### 3. docker_read_output

读取命令执行的输出。

**参数：**
| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| session_id | string | 是 | 会话 ID |
| clear | boolean | 否 | 读取后清空缓冲区，默认 true |

**返回：**
```json
{
  "output": "命令输出内容",
  "lastActivity": "2024-01-01T00:00:00.000Z",
  "exited": false
}
```

### 4. docker_close_session

关闭并销毁会话。

**参数：**
| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| session_id | string | 是 | 会话 ID |

### 5. docker_list_sessions

列出所有活跃的会话。

## 使用示例

```
AI: 我来帮你操作容器

// 1. 创建会话
docker_create_session({ container_id: "my-container" })
// 返回: { sessionId: "abc-123" }

// 2. 切换目录
docker_execute({ session_id: "abc-123", command: "cd /home/app" })
docker_read_output({ session_id: "abc-123" })

// 3. 查看文件（工作目录保持在 /home/app）
docker_execute({ session_id: "abc-123", command: "ls -la" })
docker_read_output({ session_id: "abc-123" })

// 4. 查看 Node 版本
docker_execute({ session_id: "abc-123", command: "node -v" })
docker_read_output({ session_id: "abc-123" })
// 输出: v20.18.1

// 5. 完成任务，关闭会话
docker_close_session({ session_id: "abc-123" })
```

## 技术实现

- 使用 `node-pty` 创建伪终端 (PTY) 进程
- 通过 `docker exec -it` 进入容器的交互式 shell
- 会话状态通过 PTY 进程保持

## 依赖

- Node.js >= 16
- Docker
- @modelcontextprotocol/sdk
- node-pty
- uuid

## License

MIT
npm package: @riao/driver-test
Description: riao-driver-test
Author: riao
Latest version: 3.5.0

# riao-driver-test - Readme

## Development

Run a dev test with `npm start`.

## Running Tests

To run unit tests, `npm run test`

## Scripts

You can write custom scripts in the `script/` directory. See `script/example.ts` as an example.

Run your script with `npm run script -- example`

## Compiling

### Debug Builds

To compile a debug build, run `npm run build`. The build output will appear in the `./dist` folder.

### Prod Builds

To compile a production build, run `npm run lint:prod && npm run build`. The build output will appear in the `./dist` folder.

## More

### Generating Docs

`npm run doc` and browse docs/index.html!

### Deploying to npm

1. Did you bump your version?
2. `npm run publish`

You can test your build by running `npm run script -- pack`
npm package: @riao/files
Description: save & load files from your application, with the power of sql and riao.
Author: riao-files
Latest version: 1.0.0

# @riao/files

Save and load files from your application, with the power of typescript, sql and riao.

## Features

- **SQLite File Management**: Create and manage SQLite files with a simple, object-oriented interface
- **Automated Migrations**: Built-in migration system to handle file schema changes
- **Type Safety**: Full TypeScript support with type-safe database operations
- **Directory Creation**: Automatically creates necessary directories for database files
- **Extensible**: Abstract base class allows for custom file implementations with specific schemas

## Installation

```bash
npm install @riao/files
```

## Quick Start

### 1. Create a Custom File Class

Extend the `File` class and define your database migrations:

```typescript
import { File, FileOptions } from '@riao/files';
import { Migration } from '@riao/dbal';
import { BigIntKeyColumn, UsernameColumn } from '@riao/dbal/column-pack';

export class UserFile extends File {
  public override async getMigrations(): Promise<Record<string, Migration>> {
    return {
      'create-users-table': new (class extends Migration {
        override async up(): Promise<void> {
          await this.ddl.createTable({
            name: 'users',
            columns: [BigIntKeyColumn, UsernameColumn],
          });
        }
      })(this.db),
    };
  }
}
```

### 2. Use Your File Class

```typescript
import { UserFile } from './user-file';

async function saveUser() {
  // Create a new file instance
  const userFile = new UserFile({ filepath: './data/users.db' });
  
  // Initialize the file (creates directories, connects to DB, runs migrations)
  await userFile.init();
  
  // Use the database
  const repo = userFile.db.getQueryRepository({ table: 'users' });
  await repo.insertOne({ record: { username: 'john_doe' } });
  
  console.log('User saved successfully!');
}

async function loadUsers() {
  const userFile = new UserFile({ filepath: './data/users.db' });
  await userFile.init();
  
  const repo = userFile.db.getQueryRepository({ table: 'users' });
  const users = await repo.find({});
  
  console.log('Users:', users);
}

// Usage
saveUser().catch(console.error);
loadUsers().catch(console.error);
```

## Examples

Check out the [examples directory](./examples/) for more usage examples:

- [`save-file.ts`](./examples/save-file.ts) - Creating and saving data to a file
- [`load-file.ts`](./examples/load-file.ts) - Loading data from an existing file

## Contributing & Development

See [contributing.md](docs/contributing/contributing.md) for information on how to develop or contribute to this project!

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
npm package: @riao/iam
Description: Identity Access Management for Riao
Author: riao-iam
Latest version: 3.2.0

# @riao/iam - Readme

## Installation

`npm i @riao/iam`

## Encryption & Key Pairs

To use encryption and signing features, you need to generate a key pair. The `KeyPairGenerator` class supports generating RSA and Elliptic Curve key pairs.

### Quick Start with Encryptor/Decryptor (Recommended)

The `Encryptor` and `Decryptor` classes provide a simple, object-oriented interface for managing encryption and decryption:

```typescript
import { Encryptor, Decryptor, KeyPairGenerator } from '@riao/iam';

// Generate a key pair
const generator = new KeyPairGenerator({ algorithm: 'RS256' });
const keypair = generator.generate();

// Create Encryptor and Decryptor instances
const encryptor = new Encryptor(keypair.publicKey);
const decryptor = new Decryptor(keypair.privateKey);

// Encrypt and decrypt
const encrypted = encryptor.encrypt('Secret message');
const decrypted = decryptor.decrypt(encrypted);
console.log(decrypted.toString()); // 'Secret message'
```

## JSON Web Tokens (JWT)

The `Jwt` class provides a secure way to generate and verify JSON Web Tokens for authentication and authorization. It supports both symmetric signing (using a shared secret) and asymmetric signing (using public/private key pairs).

### Quick Start

```typescript
import { Jwt } from '@riao/iam';

// Create a JWT manager with a shared secret
const jwtManager = new Jwt({
	secret: 'your-secret-key',
	algorithm: 'HS512',
	expiresIn: '1h',
});

// Generate a token
const { token } = await jwtManager.generateToken({
	userId: 'user-123',
	role: 'admin',
});

// Verify and decode a token
const payload = await jwtManager.decodeToken(token);
console.log(payload.userId); // 'user-123'
```

For detailed usage, algorithms, security best practices, and advanced patterns, see the [JWT Guide](docs/jwt-guide.md).

### Documentation

- [Encryptor & Decryptor Guide](docs/encryptor-decryptor-guide.md) - **Recommended** - Object-oriented encryption/decryption interface
- [KeyPair Usage Guide](docs/keypair-guide.md) - Learn how to use the KeyPairGenerator for cryptographic operations
- [Encryption & Decryption Guide](docs/crypto-guide.md) - Lower-level `encrypt` and `decrypt` functions (for advanced use cases)
- [Hash Guide](docs/hash-guide.md) - Password hashing and verification with bcrypt
- [JWT Guide](docs/jwt-guide.md) - Generate and verify JSON Web Tokens for authentication and authorization

## Contributing & Development

See [contributing.md](docs/contributing/contributing.md) for information on how to develop or contribute to this project!
npm package: @riao/mysql
Description: riao driver for mysql
Author: riao
Latest version: 3.4.0

# riao-driver-mysql - Readme

## Development

Run a dev test with `npm start`.

## Running Tests

To run unit tests, `npm run test`

## Scripts

You can write custom scripts in the `script/` directory. See `script/example.ts` as an example.

Run your script with `npm run script -- example`

## Compiling

### Debug Builds

To compile a debug build, run `npm run build`. The build output will appear in the `./dist` folder.

### Prod Builds

To compile a production build, run `npm run lint:prod && npm run build`. The build output will appear in the `./dist` folder.

## More

### Generating Docs

`npm run doc` and browse docs/index.html!

### Deploying to npm

1. Did you bump your version?
2. `npm run publish`

You can test your build by running `npm run script -- pack`
npm package: @riasatsk/input
Description: Node.js Terminal input
Author: Riasat Sk
Latest version: 1.2.0

# @riasatsk/input

`@riasatsk/input` is a simple utility for reading user input from the command line in Node.js applications. It wraps the `readline` module to make input prompts more straightforward and easy to use.

## Installation

To use `@riasatsk/input` in your project, you need to install it via npm or yarn. Ensure you have Node.js installed on your machine.

### Using npm

```bash
npm install @riasatsk/input
```



```javascript
import input from "@riasatsk/input";

const name = await input("What is your name: ");

console.log("Hello " + name + "!");
```