Installation
Requirements
- Node.js 18.x or higher
- npm, yarn, or pnpm
Package Installation
Install via npm:
bash
npm install tonl-mcp-bridgeOr using yarn:
bash
yarn add tonl-mcp-bridgeOr using pnpm:
bash
pnpm add tonl-mcp-bridgeGlobal Installation (CLI)
For command-line tools:
bash
npm install -g tonl-mcp-bridgeThis provides access to CLI commands:
tonl convert- Convert filestonl batch- Batch conversiontonl watch- Watch mode
Database Drivers
Depending on your database, install the required driver:
PostgreSQL
bash
npm install pgMySQL
bash
npm install mysql2SQLite
SQLite support is built-in. No additional driver needed.
Qdrant
bash
docker run -p 6333:6333 qdrant/qdrantTypeScript Support
TONL includes TypeScript definitions out of the box. No additional @types packages needed.
Verification
Verify installation:
typescript
import { jsonToTonl } from 'tonl-mcp-bridge';
const data = [{ id: 1, name: "Test" }];
const tonl = jsonToTonl(data);
console.log(tonl);Expected output:
data[1]{id:i8,name:str}:
1, TestTroubleshooting
Module Resolution Errors
If you encounter module resolution errors, ensure your tsconfig.json includes:
json
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "node"
}
}Database Connection Issues
For database adapters, verify:
- Database server is running
- Credentials are correct
- Network access is allowed
- Required driver is installed