express-postgres-starter
v1.0.0
Published
> API for AI agents to search, license, and download b-roll video clips and voiceovers via plain language queries.
Readme
AILibrary MCP Server
API for AI agents to search, license, and download b-roll video clips and voiceovers via plain language queries.
AILibrary gives AI agents autonomous access to a licensed media library. Agents can search, preview, and download videos, images, and audio clips using natural language — with automatic per-download credit billing. No human required.
Live API: https://ailibrary-m43k.polsia.app
MCP Server Installation
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"ailibrary": {
"command": "npx",
"args": ["-y", "ailibrary-mcp"]
}
}
}Cursor
Add to .cursor/mcp.json in your project, or Settings → MCP → Add Server:
{
"mcpServers": {
"ailibrary": {
"command": "npx",
"args": ["-y", "ailibrary-mcp"]
}
}
}Windsurf / Cline / Continue
Same config works across all MCP-compatible clients:
{
"mcpServers": {
"ailibrary": {
"command": "npx",
"args": ["-y", "ailibrary-mcp"]
}
}
}Install via npm (alternative)
npm install -g ailibrary-mcpThen configure with:
{
"mcpServers": {
"ailibrary": {
"command": "ailibrary-mcp",
"args": []
}
}
}Authentication
No startup configuration required. Authentication uses an API key passed as a tool argument in each call — meaning multiple agents can use different keys with the same server instance.
Get your API key at ailibrary-m43k.polsia.app.
API keys start with alib_.
Tools
search_assets
Search the media library by natural language query.
search_assets(api_key, query, [type], [limit])| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| api_key | string | ✓ | Your AILibrary API key (alib_...) |
| query | string | ✓ | Natural language query, e.g. "drone nature shot", "upbeat corporate music" |
| type | string | — | Filter: video, image, or audio |
| limit | number | — | Max results (default 20, max 100) |
Returns: asset IDs, titles, types, preview URLs, duration, resolution, and credit cost.
download_asset
Download a specific asset by ID. Deducts credits and returns the download URL.
download_asset(api_key, asset_id)| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| api_key | string | ✓ | Your AILibrary API key |
| asset_id | number | ✓ | Asset ID from search_assets results |
Returns: download URL, credits deducted, remaining balance.
check_balance
Verify your API key is valid and active.
check_balance(api_key)| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| api_key | string | ✓ | Your AILibrary API key |
Returns: { valid: true } if the key works.
Example Agent Workflow
Agent task: "Create a 60-second product intro video using drone footage"
1. search_assets({ api_key: "alib_...", query: "drone product reveal", type: "video", limit: 5 })
→ Returns 5 matching clips with preview URLs and credit costs
2. download_asset({ api_key: "alib_...", asset_id: 42 })
→ Returns download URL, deducts 1 credit
3. search_assets({ api_key: "alib_...", query: "upbeat corporate background music", type: "audio" })
→ Returns matching audio tracks
4. download_asset({ api_key: "alib_...", asset_id: 87 })
→ Returns audio download URLThe agent handles the entire media sourcing workflow autonomously — no human needed to browse stock libraries or approve downloads.
Repository Structure
ailibrary/
├── server.js # Express API server
├── migrations/ # PostgreSQL migrations
├── public/ # Static assets
├── mcp-server/ # MCP server (TypeScript)
│ ├── src/index.ts # Server implementation
│ └── package.json # npm package: ailibrary-mcp
├── smithery.yaml # Smithery MCP registry config
└── servers.json # MCP server manifestBuild from Source
git clone https://github.com/Polsia-Inc/ailibrary.git
cd ailibrary/mcp-server
npm install
npm run build
node dist/index.jsLicense
MIT
Links
- Homepage: https://ailibrary-m43k.polsia.app
- npm: https://www.npmjs.com/package/ailibrary-mcp
- MCP Spec: https://modelcontextprotocol.io
