Zerodb Typescript SDK

MCP搜索检索

提供方 AINative-Studio

搜索检索 未标注 API Key 社区 / 第三方

ZeroDB MCP Client 是一个为 ZeroDB MCP Bridge API 提供的生产就绪的 TypeScript/JavaScript 客户端,支持向量搜索、量子操作、NoSQL 表格、文件存储等核心功能。

一句话选型结论

按资料字段整理

Zerodb Typescript SDK 属于搜索检索类 MCP 服务器,传输方式未标注,API Key,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类搜索检索 传输方式未标注 鉴权API Key 部署方式未标注
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

搜索检索
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

适用场景

向量搜索TypeScript本地部署NoSQL文件存储量子操作

安装与配置

未标注 API Key
上游未给出传输方式
  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
联网搜索取证

让模型查最新资料并给出出处。

资料聚合

把一个主题的网页、文档集中抓回来整理。

情报与竞品检索

按关键词持续检索行业动态和竞品信息。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 基础信息齐全,可以先按官方文档接入试跑。

先想清楚的地方

  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 使用前要准备好API Key对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在搜索检索场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Zerodb Typescript SDK当前 未标注 未标注 未标注 无 2026-05-17
Brave Search 433812ff 2 未标注 未标注 无 2026-05-17
Sequentialthinking 1 SSE · 服务端推送 远程部署 有 2026-05-18
Baidu Netdisk 未标注 未标注 未标注 无 2026-05-17
ragflow 未标注 stdio · 本地进程 本地部署 有 2026-04-11
mindsdb (430e18) 未标注 未标注 未标注 有 2026-05-17

服务器档案

搜索检索
字段来自项目仓库与公开索引,中文说明由本站标注
提供方AINative-Studio上游标注的维护方 AINative-Studio
分类搜索检索本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式API Key远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

12.7 KB
来自项目仓库与上游目录的原文,未做删改

ZeroDB MCP客户端

用于ZeroDB MCP Bridge API的可生产类型脚本/JavaScript客户端。提供对所有ZeroDB功能的类型安全访问,包括向量搜索、量子操作、NoSQL表、文件存储、事件等。

特性

  • API全面覆盖:支持所有60+ZeroDB操作
  • 类型安全:完全支持TypeScript,具有全面的类型定义
  • 错误处理:具有详细错误信息的自定义错误类
  • 重试逻辑:针对瞬态故障的内置指数回退
  • 认证:同时支持API密钥和JWT令牌
  • 速率限制:自动速率限制处理,支持后重试
  • 验证:矢量、UUID和其他数据的输入验证
  • 框架支持:适用于Node.js、React、Next.js和其他框架

安装```bash

npm install @zerodb/mcp-client


或者用纱线:```bash
yarn add @zerodb/mcp-client

快速开始```typescript

import { ZeroDBClient } from '@zerodb/mcp-client';

// Initialize the client
const client = new ZeroDBClient({
apiKey: 'ZERODB_your_api_key',
baseURL: 'https://api.ainative.studio' // optional
});

// Search vectors
const results = await client.vectors.search({
project_id: 'your-project-uuid',
query_vector: embedding, // 1536-dimensional array
limit: 10,
threshold: 0.7
});

console.log(Found ${results.total_count} results);


## 认证

客户端支持两种身份验证方法:

### API密钥验证```typescript
const client = new ZeroDBClient({
apiKey: 'ZERODB_your_api_key'
});

JWT令牌身份验证```typescript

const client = new ZeroDBClient({
jwtToken: 'your_jwt_token'
});


### 更新身份验证```typescript
// Switch to JWT
client.setAuthToken('new_jwt_token', 'jwt');

// Switch to API key
client.setAuthToken('ZERODB_new_api_key', 'apiKey');

配置选项```typescript

const client = new ZeroDBClient({
apiKey: 'ZERODB_your_api_key', // API key (or use jwtToken)
jwtToken: 'your_jwt_token', // JWT token (alternative to apiKey)
baseURL: 'https://api.ainative.studio', // API base URL (optional)
timeout: 30000, // Request timeout in ms (default: 30000)
retryAttempts: 3, // Number of retry attempts (default: 3)
retryDelay: 1000 // Initial retry delay in ms (default: 1000)
});


## API 参考

### 向量运算

#### 插入矢量```typescript
const result = await client.vectors.upsert({
project_id: 'project-uuid',
embedding: [0.1, 0.2, ...], // 1536 dimensions
document: 'This is a sample document',
namespace: 'default',
metadata: {
source: 'api',
type: 'article',
tags: ['technology', 'ai']
}
});
// Returns: { vector_id: string, status: string }

批量更新矢量```typescript

const result = await client.vectors.batchUpsert({
project_id: 'project-uuid',
namespace: 'documents',
vectors: [
{
embedding: [...],
document: 'Document 1',
metadata: { ... }
},
{
embedding: [...],
document: 'Document 2',
metadata: { ... }
}
]
});
// Returns: { vector_ids: string[], success_count: number, error_count: number }


#### 搜索向量```typescript
const results = await client.vectors.search({
project_id: 'project-uuid',
query_vector: [...], // 1536 dimensions
limit: 10,
threshold: 0.7,
namespace: 'default',
metadata_filter: {
category: 'technology'
}
});
// Returns: { vectors: Vector[], total_count: number, search_time_ms: number }

删除矢量```typescript

const result = await client.vectors.delete('project-uuid', 'vector-id');
// Returns: { status: string, deleted: boolean }


#### 按ID获取矢量```typescript
const vector = await client.vectors.get('project-uuid', 'vector-id');
// Returns: Vector object with all fields

列出向量```typescript

const vectors = await client.vectors.list({
project_id: 'project-uuid',
namespace: 'default',
limit: 100,
offset: 0
});
// Returns: Vector[]


#### 矢量统计```typescript
const stats = await client.vectors.stats('project-uuid');
// Returns: {
//   total_vectors: number,
//   namespaces: Array<{ namespace: string, count: number }>,
//   storage_bytes: number,
//   avg_vector_size: number
// }

创建矢量索引```typescript

const index = await client.vectors.createIndex({
project_id: 'project-uuid',
namespace: 'default',
index_type: 'HNSW' // or 'IVF' or 'FLAT'
});
// Returns: { index_id: string, estimated_build_time_seconds: number, status: string }


#### 优化矢量存储```typescript
const result = await client.vectors.optimize({
project_id: 'project-uuid',
strategy: 'compression' // or 'deduplication' or 'clustering'
});
// Returns: { optimized_vectors: number, storage_saved_bytes: number, optimization_time_ms: number }

导出向量```typescript

const result = await client.vectors.export({
project_id: 'project-uuid',
namespace: 'default',
format: 'json' // or 'csv' or 'parquet'
});
// Returns: { download_url: string, vector_count: number, file_size_bytes: number }


### 量子操作

#### 压缩矢量```typescript
const result = await client.quantum.compress({
project_id: 'project-uuid',
embedding: [...],
compression_ratio: 0.6,
preserve_semantics: true
});
// Returns: { compressed_embedding: number[], compression_achieved: number }

解压缩矢量```typescript

const result = await client.quantum.decompress({
project_id: 'project-uuid',
compressed_embedding: [...]
});
// Returns: { embedding: number[], quality_score: number }


#### 混合相似性```typescript
const result = await client.quantum.hybridSimilarity({
project_id: 'project-uuid',
query_vector: [...],
candidate_vector: [...],
metadata_boost: { relevance: 0.8 }
});
// Returns: { similarity_score: number, cosine_component: number, quantum_component: number }

表操作

创建表```typescript

const table = await client.tables.createTable({
project_id: 'project-uuid',
table_name: 'users',
schema: {
name: { type: 'string', nullable: false },
email: { type: 'string', nullable: false },
age: { type: 'number', nullable: true }
}
});


#### 插入行```typescript
const result = await client.tables.insertRows({
project_id: 'project-uuid',
table_name: 'users',
rows: [
{ name: 'John', email: 'john@example.com', age: 30 },
{ name: 'Jane', email: 'jane@example.com', age: 28 }
]
});

查询行```typescript

const result = await client.tables.queryRows({
project_id: 'project-uuid',
table_name: 'users',
filters: { age: { $gte: 25 } },
limit: 10,
order_by: 'name'
});


#### 更新行```typescript
const result = await client.tables.updateRows({
project_id: 'project-uuid',
table_name: 'users',
filters: { email: 'john@example.com' },
updates: { age: 31 }
});

删除行```typescript

const result = await client.tables.deleteRows({
project_id: 'project-uuid',
table_name: 'users',
filters: { age: { $lt: 18 } },
confirm: true
});


### 文件操作

#### 上传文件```typescript
const result = await client.files.uploadBuffer(
'project-uuid',
'document.pdf',
fileBuffer,
'application/pdf',
{ author: 'John Doe' }
);

下载文件```typescript

const result = await client.files.download({
project_id: 'project-uuid',
file_id: 'file-uuid'
});
const content = Buffer.from(result.file_data, 'base64');


#### 列出文件```typescript
const result = await client.files.list({
project_id: 'project-uuid',
prefix: 'documents/',
limit: 50
});

删除文件```typescript

const result = await client.files.delete({
project_id: 'project-uuid',
file_id: 'file-uuid'
});


### 活动操作

#### 创建活动```typescript
const result = await client.events.create({
project_id: 'project-uuid',
event_type: 'user.signup',
topic: 'users',
payload: { user_id: '123', email: 'user@example.com' },
source: 'web-app'
});

列出事件```typescript

const result = await client.events.list({
project_id: 'project-uuid',
topic: 'users',
limit: 100
});


#### 订阅活动```typescript
const result = await client.events.subscribe({
project_id: 'project-uuid',
topic: 'users',
webhook_url: 'https://myapp.com/webhooks/events'
});

项目运营

创建项目```typescript

const project = await client.projects.create({
name: 'My Project',
description: 'Project description',
tier: 'pro'
});


#### 列出项目```typescript
const result = await client.projects.list();

获取项目统计信息```typescript

const stats = await client.projects.stats({
project_id: 'project-uuid'
});


#### 删除项目```typescript
const result = await client.projects.delete({
project_id: 'project-uuid',
confirm: true
});

RLHF操作

收集互动```typescript

const result = await client.rlhf.collectInteraction({
type: 'click',
session_id: 'session-uuid',
element_clicked: 'search-button',
page_url: '/search'
});


#### 收集代理反馈```typescript
const result = await client.rlhf.collectAgentFeedback({
project_id: 'project-uuid',
agent_type: 'search-agent',
agent_response_id: 'response-uuid',
user_rating: 5,
feedback_text: 'Very helpful response'
});

管理员操作(仅限管理员)

系统统计信息```typescript

const stats = await client.admin.getSystemStats();


#### 系统健康```typescript
const health = await client.admin.getSystemHealth();

错误处理

客户端为不同的错误场景提供自定义错误类:```typescript
import {
ZeroDBError,
AuthenticationError,
AuthorizationError,
RateLimitError,
ValidationError,
NotFoundError,
NetworkError,
TimeoutError
} from '@zerodb/mcp-client';

try {
await client.vectors.search({
project_id: 'invalid-uuid',
query_vector: embedding,
limit: 10
});
} catch (error) {
if (error instanceof ValidationError) {
console.error('Validation failed:', error.message);
console.error('Field errors:', error.errors);
} else if (error instanceof AuthenticationError) {
console.error('Authentication failed:', error.message);
} else if (error instanceof RateLimitError) {
console.error('Rate limited. Retry after:', error.retryAfter);
} else if (error instanceof NotFoundError) {
console.error('Resource not found:', error.message);
} else {
console.error('Unexpected error:', error);
}
}


## 框架集成

### React/Next.js```typescript
import { ZeroDBClient } from '@zerodb/mcp-client';
import { useState, useEffect } from 'react';

function SearchComponent() {
const [results, setResults] = useState([]);
const client = new ZeroDBClient({ apiKey: process.env.ZERODB_API_KEY });

const search = async (query: string) => {
const embedding = await getEmbedding(query); // Your embedding function

const results = await client.vectors.search({
project_id: process.env.ZERODB_PROJECT_ID,
query_vector: embedding,
limit: 10
});

setResults(results.vectors);
};

return (

search(e.target.value)} />
{results.map(result => (

{result.document}

))}

);
}

Node.js后端```typescript

import express from 'express';
import { ZeroDBClient } from '@zerodb/mcp-client';

const app = express();
const client = new ZeroDBClient({
apiKey: process.env.ZERODB_API_KEY
});

app.post('/api/search', async (req, res) => {
try {
const { query, projectId } = req.body;

const results = await client.vectors.search({
project_id: projectId,
query_vector: query,
limit: 10
});

res.json(results);
} catch (error) {
if (error instanceof RateLimitError) {
res.status(429).json({ error: 'Rate limit exceeded' });
} else {
res.status(500).json({ error: error.message });
}
}
});

app.listen(3000);


## 最佳实践

### 1.重用客户端实例

创建单个客户端实例并在整个应用程序中重用它:```typescript
// lib/zerodb.ts
import { ZeroDBClient } from '@zerodb/mcp-client';

export const zerodbClient = new ZeroDBClient({
apiKey: process.env.ZERODB_API_KEY
});

2.处理速率限制```typescript

async function searchWithRetry(query: any, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
return await client.vectors.search(query);
} catch (error) {
if (error instanceof RateLimitError && i < maxRetries - 1) {
await new Promise(resolve => setTimeout(resolve, error.retryAfter * 1000));
continue;
}
throw error;
}
}
}


### 3.验证嵌入```typescript
import { validateEmbedding } from &#x27;@zerodb/mcp-client&#x27;;

try {
validateEmbedding(myEmbedding, 1536);
} catch (error) {
console.error(&#x27;Invalid embedding:&#x27;, error.message);
}

4.使用TypeScript

充分利用全型安全:```typescript
import { VectorSearchRequest, VectorSearchResult } from '@zerodb/mcp-client';

async function typedSearch(
request: VectorSearchRequest
): Promise {
return client.vectors.search(request);
}


## 测试```bash
npm test

示例

请参阅 examples/ 综合使用示例目录:

  • vectors-example.ts -矢量运算
  • tables-example.ts -表/NoSQL操作
  • files-example.ts -文件存储操作

许可证

麻省理工学院

支持

  • 文档:https://docs.ainative.studio
  • 问题:https://github.com/ainative-studio/zerodb-mcp-client/issues
  • 电子邮件:support@ainative.studio

贡献

欢迎投稿!请在提交PR之前阅读我们的投稿指南。

常见问题

5 问
答案由本站依据条目字段整理,不引用上游原文
Zerodb Typescript SDK 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

Zerodb Typescript SDK 怎么在客户端里配置?

它的传输方式未标注,在客户端 MCP 配置里按官方文档填写启动命令和参数,保存后重启客户端生效。

Zerodb Typescript SDK 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Zerodb Typescript SDK 需要 API Key 吗?

资料标注需要API Key认证,使用前准备好对应凭据,并按最小权限配置。

Zerodb Typescript SDK 能提供哪些能力?

资料显示能力标签包括 向量搜索、TypeScript、搜索。具体工具清单以官方文档为准。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。