SourceSync.ai知识服
一种模型上下文协议服务器,使人工智能模型能够与SourceSync.ai的知识管理平台交互,以管理文档、从各种来源摄取内容并执行语义搜索。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"sourcesyncai-mcp": {
"args": [
"-y",
"sourcesyncai-mcp"
],
"command": "npx",
"env": {
"SOURCESYNC_API_KEY": "your_api_key",
"SOURCESYNC_NAMESPACE_ID": "your_namespace_id",
"SOURCESYNC_TENANT_ID": "your_tenant_id"
}
}
}
}
该服务需要配置环境变量:SOURCESYNC_API_KEY、SOURCESYNC_NAMESPACE_ID、SOURCESYNC_TENANT_ID
可用工具 (25 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
validateApiKey
Validates the API key by attempting to list namespaces. Returns the list of namespaces if successful.
该工具无需必填参数,直接调用即可
createNamespace 6 个参数 需填 4 项
Creates a new namespace with the provided configuration. Requires a name, file storage configuration, vector storage configuration, and embedding model configuration.
必填参数:name、fileStorageConfig、vectorStorageConfig、embeddingModelConfig
listNamespaces 1 个参数
Lists all namespaces available for the current API key and optional tenant ID.
该工具无需必填参数,直接调用即可
getNamespace 2 个参数
Retrieves a specific namespace by its ID.
该工具无需必填参数,直接调用即可
updateNamespace 12 个参数
Updates an existing namespace with the provided configuration parameters.
该工具无需必填参数,直接调用即可
deleteNamespace 2 个参数
Permanently deletes a namespace by its ID.
该工具无需必填参数,直接调用即可
ingestText 3 个参数 需填 1 项
Ingests raw text content into the namespace. Supports optional metadata and chunk configuration.
必填参数:ingestConfig
ingestFile 5 个参数 需填 1 项
Ingests a file into the namespace. Supports various file formats with automatic parsing.
必填参数:file
ingestUrls 3 个参数 需填 1 项
Ingests content from a list of URLs. Supports scraping options and metadata.
必填参数:ingestConfig
ingestSitemap 3 个参数 需填 1 项
Ingests content from a website using its sitemap.xml. Supports path filtering and link limits.
必填参数:ingestConfig
ingestWebsite 3 个参数 需填 1 项
Crawls and ingests content from a website recursively. Supports depth control and path filtering.
必填参数:ingestConfig
ingestConnector 3 个参数 需填 1 项
Ingests all documents in the connector that are in backlog or failed status. No need to provide the document ids or file ids for the ingestion. Ids are already in the backlog when picked thorough the picker. If not, the user has to go through the authorization flow again, where they will be asked to pick the documents again.
必填参数:ingestConfig
getIngestJobRunStatus 3 个参数 需填 1 项
Checks the status of a previously submitted ingestion job.
必填参数:ingestJobRunId
fetchDocuments 6 个参数 需填 1 项
Fetches documents from the namespace based on filter criteria. Supports pagination and including specific document properties.
必填参数:filterConfig
updateDocuments 5 个参数 需填 3 项
Updates metadata for documents that match the specified filter criteria.
必填参数:documents、filterConfig、data
deleteDocuments 4 个参数 需填 1 项
Permanently deletes documents that match the specified filter criteria.
必填参数:filterConfig
resyncDocuments 4 个参数 需填 1 项
Reprocesses documents that match the specified filter criteria. Useful for updating after schema changes.
必填参数:filterConfig
semanticSearch 7 个参数 需填 1 项
Performs semantic search across the namespace to find relevant content based on meaning rather than exact keyword matches.
必填参数:query
hybridSearch 8 个参数 需填 2 项
Performs a combined keyword and semantic search, balancing between exact matches and semantic similarity. Requires hybridConfig with weights for both search types.
必填参数:query、hybridConfig
createConnection 5 个参数 需填 2 项
Creates a new connection to a specific source. The connector parameter should be a valid SourceSync connector enum value. The clientRedirectUrl parameter is optional and can be used to specify a custom redirect URL for the connection. This will give you a authorization url which you can redirect the user to. The user will then be asked to pick the documents they want to ingest.
必填参数:name、connector
listConnections 3 个参数
Lists all connections for the current namespace, optionally filtered by connector type.
该工具无需必填参数,直接调用即可
getConnection 3 个参数 需填 1 项
Retrieves details for a specific connection by its ID.
必填参数:connectionId
updateConnection 5 个参数 需填 1 项
Updates a connection to a specific source. The connector parameter should be a valid SourceSync connector enum value. The clientRedirectUrl parameter is optional and can be used to specify a custom redirect URL for the connection. This will give you a authorization url which you can redirect the user to. The user will then be asked to pick the documents they want to ingest. This is useful if you want to update the connection to a different source or if you want to update the clientRedirectUrl or if you want to pick a different or new set of documents.
必填参数:connectionId
revokeConnection 3 个参数 需填 1 项
Revokes access for a specific connection, removing the integration with the external service.
必填参数:connectionId
fetchUrlContent 3 个参数 需填 1 项
Fetches the content of a URL. Particularly useful for fetching parsed text file URLs.
必填参数:url
服务介绍
SourceSync.ai MCP 服务器
这是一个为 SourceSync.ai API 实现的模型上下文协议(MCP)服务器。该服务器允许 AI 模型通过标准化接口与 SourceSync.ai 的知识管理平台进行交互。
功能
- 管理命名空间以组织知识
- 从各种来源(文本、URL、网站、外部服务)摄取内容
- 检索、更新和管理存储在知识库中的文档
- 对您的知识库执行语义和混合搜索
- 直接从解析的文本 URL 访问文档内容
- 管理与外部服务的连接
- 默认配置支持无缝 AI 集成
安装
使用 npx 运行
# Install and run with your API key and tenant ID
env SOURCESYNC_API_KEY=your_api_key npx -y sourcesyncai-mcp
通过 Smithery 安装
要通过 Smithery 自动为 Claude Desktop 安装 sourcesyncai-mcp:
npx -y @smithery/cli install @pbteja1998/sourcesyncai-mcp --client claude
手动安装
# Clone the repository
git clone https://github.com/yourusername/sourcesyncai-mcp.git
cd sourcesyncai-mcp
# Install dependencies
npm install
# Build the project
npm run build
# Run the server
node dist/index.js
在 Cursor 上运行
要在 Cursor 中配置 SourceSync.ai MCP:
- 打开 Cursor 设置
- 转到
功能 > MCP 服务器 - 点击
+ 添加新的 MCP 服务器 - 输入以下信息:
- 名称:
sourcesyncai-mcp(或您喜欢的名称) - 类型:
命令 - 命令:
env SOURCESYNCAI_API_KEY=your-api-key npx -y sourcesyncai-mcp
- 名称:
添加后,您可以根据自己的知识管理需求使用 SourceSync.ai 工具结合 Cursor 的 AI 功能。
在 Windsurf 上运行
将以下内容添加到您的 ./codeium/windsurf/model_config.json 文件中:
{
"mcpServers": {
"sourcesyncai-mcp": {
"command": "npx",
"args": ["-y", "soucesyncai-mcp"],
"env": {
"SOURCESYNC_API_KEY": "your_api_key",
"SOURCESYNC_NAMESPACE_ID": "your_namespace_id",
"SOURCESYNC_TENANT_ID": "your_tenant_id"
}
}
}
}
在 Claude Desktop 上运行
要使用此 MCP 服务器与 Claude Desktop:
-
找到 Claude Desktop 配置文件:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
-
编辑配置文件以添加 SourceSync.ai MCP 服务器:
{
"mcpServers": {
"sourcesyncai-mcp": {
"command": "npx",
"args": ["-y", "sourcesyncai-mcp"],
"env": {
"SOURCESYNC_API_KEY": "your_api_key",
"SOURCESYNC_NAMESPACE_ID": "your_namespace_id",
"SOURCESYNC_TENANT_ID": "your_tenant_id"
}
}
}
}
- 保存配置文件并重新启动 Claude Desktop
配置
环境变量
必需
SOURCESYNC_API_KEY: 您的 SourceSync.ai API 密钥(必需)
可选
SOURCESYNC_NAMESPACE_ID: 操作时使用的默认命名空间 IDSOURCESYNC_TENANT_ID: 您的租户 ID(可选)
配置示例
基本配置,使用默认值:
export SOURCESYNC_API_KEY=your_api_key
export SOURCESYNC_TENANT_ID=your_tenant_id
export SOURCESYNC_NAMESPACE_ID=your_namespace_id
可用工具
身份验证
validate_api_key: 验证 SourceSync.ai API 密钥
{
"name": "validate_api_key",
"arguments": {}
}
命名空间
create_namespace: 创建新命名空间list_namespaces: 列出所有命名空间get_namespace: 获取特定命名空间的详细信息update_namespace: 更新命名空间delete_namespace: 删除命名空间
{
"name": "create_namespace",
"arguments": {
"name": "my-namespace",
"fileStorageConfig": {
"provider": "S3_COMPATIBLE",
"config": {
"endpoint": "s3.amazonaws.com",
"accessKey": "your_access_key",
"secretKey": "your_secret_key",
"bucket": "your_bucket",
"region": "us-east-1"
}
},
"vectorStorageConfig": {
"provider": "PINECONE",
"config": {
"apiKey": "your_pinecone_api_key",
"environment": "your_environment",
"index": "your_index"
}
},
"embeddingModelConfig": {
"provider": "OPENAI",
"config": {
"apiKey": "your_openai_api_key",
"model": "text-embedding-3-small"
}
},
"tenantId": "tenant_XXX"
}
}
{
"name": "list_namespaces",
"arguments": {
"tenantId": "tenant_XXX"
}
}
{
"name": "get_namespace",
"arguments": {
"namespaceId": "namespace_XXX",
"tenantId": "tenant_XXX"
}
}
{
"name": "update_namespace",
"arguments": {
"namespaceId": "namespace_XXX",
"tenantId": "tenant_XXX",
"name": "updated-namespace-name"
}
}
{
"name": "delete_namespace",
"arguments": {
"namespaceId": "namespace_XXX",
"tenantId": "tenant_XXX"
}
}
数据摄取
ingest_text: 摄取文本内容ingest_urls: 从URL摄取内容ingest_sitemap: 从站点地图摄取内容ingest_website: 从网站摄取内容ingest_notion: 从Notion摄取内容ingest_google_drive: 从Google Drive摄取内容ingest_dropbox: 从Dropbox摄取内容ingest_onedrive: 从OneDrive摄取内容ingest_box: 从Box摄取内容get_ingest_job_run_status: 获取摄取任务运行状态
{
"name": "ingest_text",
"arguments": {
"namespaceId": "your_namespace_id",
"ingestConfig": {
"source": "TEXT",
"config": {
"name": "example-document",
"text": "This is an example document for ingestion.",
"metadata": {
"category": "example",
"author": "AI Assistant"
}
}
},
"tenantId": "tenant_XXX"
}
}
{
"name": "ingest_urls",
"arguments": {
"namespaceId": "your_namespace_id",
"ingestConfig": {
"source": "URLS",
"config": {
"urls": ["https://example.com/page1", "https://example.com/page2"],
"metadata": {
"source": "web",
"category": "documentation"
}
}
},
"tenantId": "tenant_XXX"
}
}
{
"name": "ingest_sitemap",
"arguments": {
"namespaceId": "your_namespace_id",
"ingestConfig": {
"source": "SITEMAP",
"config": {
"url": "https://example.com/sitemap.xml",
"metadata": {
"source": "sitemap",
"website": "example.com"
}
}
},
"tenantId": "tenant_XXX"
}
}
{
"name": "ingest_website",
"arguments": {
"namespaceId": "your_namespace_id",
"ingestConfig": {
"source": "WEBSITE",
"config": {
"url": "https://example.com",
"maxDepth": 3,
"maxPages": 100,
"metadata": {
"source": "website",
"domain": "example.com"
}
}
},
"tenantId": "tenant_XXX"
}
}
{
"name": "ingest_notion",
"arguments": {
"namespaceId": "your_namespace_id",
"ingestConfig": {
"source": "NOTION",
"config": {
"connectionId": "your_notion_connection_id",
"metadata": {
"source": "notion",
"workspace": "My Workspace"
}
}
},
"tenantId": "your_tenant_id"
}
}
{
"name": "ingest_google_drive",
"arguments": {
"namespaceId": "your_namespace_id",
"ingestConfig": {
"source": "GOOGLE_DRIVE",
"config": {
"connectionId": "connection_XXX",
"metadata": {
"source": "google_drive",
"owner": "user@example.com"
}
}
},
"tenantId": "tenant_XXX"
}
}
{
"name": "ingest_dropbox",
"arguments": {
"namespaceId": "your_namespace_id",
"ingestConfig": {
"source": "DROPBOX",
"config": {
"connectionId": "connection_XXX",
"metadata": {
"source": "dropbox",
"account": "user@example.com"
}
}
},
"tenantId": "tenant_XXX"
}
}
{
"name": "ingest_onedrive",
"arguments": {
"namespaceId": "your_namespace_id",
"ingestConfig": {
"source": "ONEDRIVE",
"config": {
"connectionId": "connection_XXX",
"metadata": {
"source": "onedrive",
"account": "user@example.com"
}
}
},
"tenantId": "tenant_XXX"
}
}
{
"name": "ingest_box",
"arguments": {
"namespaceId": "your_namespace_id",
"ingestConfig": {
"source": "BOX",
"config": {
"connectionId": "connection_XXX",
"metadata": {
"source": "box",
"owner": "user@example.com"
}
}
},
"tenantId": "tenant_XXX"
}
}
{
"name": "get_ingest_job_run_status",
"arguments": {
"namespaceId": "your_namespace_id",
"ingestJobRunId": "ingest_job_run_XXX",
"tenantId": "tenant_XXX"
}
}
文档
getDocuments: 检索带有可选过滤器的文档updateDocuments: 更新文档元数据deleteDocuments: 删除文档resyncDocuments: 重新同步文档fetchUrlContent: 从文档URL获取文本内容
{
"name": "getDocuments",
"arguments": {
"namespaceId": "namespace_XXX",
"tenantId": "tenant_XXX",
"filterConfig": {
"documentTypes": ["PDF"]
},
"includeConfig": {
"parsedTextFileUrl": true
}
}
}
{
"name": "updateDocuments",
"arguments": {
"namespaceId": "namespace_XXX",
"tenantId": "tenant_XXX",
"documentIds": ["doc_XXX", "doc_YYY"],
"filterConfig": {
"documentIds": ["doc_XXX", "doc_YYY"]
},
"data": {
"metadata": {
"status": "reviewed",
"category": "technical"
}
}
}
}
{
"name": "deleteDocuments",
"arguments": {
"namespaceId": "namespace_XXX",
"tenantId": "tenant_XXX",
"documentIds": ["doc_XXX", "doc_YYY"],
"filterConfig": {
"documentIds": ["doc_XXX", "doc_YYY"]
}
}
}
{
"name": "resyncDocuments",
"arguments": {
"namespaceId": "namespace_XXX",
"tenantId": "tenant_XXX",
"documentIds": ["doc_XXX", "doc_YYY"],
"filterConfig": {
"documentIds": ["doc_XXX", "doc_YYY"]
}
}
}
{
"name": "fetchUrlContent",
"arguments": {
"url": "https://api.sourcesync.ai/v1/documents/doc_XXX/content?format=text",
"apiKey": "your_api_key",
"tenantId": "tenant_XXX"
}
}
搜索
semantic_search: 执行语义搜索hybrid_search: 执行混合搜索(语义+关键词)
{
"name": "semantic_search",
"arguments": {
"namespaceId": "your_namespace_id",
"query": "example document",
"topK": 5,
"tenantId": "tenant_XXX"
}
}
{
"name": "hybrid_search",
"arguments": {
"namespaceId": "your_namespace_id",
"query": "example document",
"topK": 5,
"tenantId": "tenant_XXX",
"hybridConfig": {
"semanticWeight": 0.7,
"keywordWeight": 0.3
}
}
}
连接
create_connection: 创建到外部服务的新连接list_connections: 列出所有连接get_connection: 获取特定连接的详细信息update_connection: 更新连接revoke_connection: 撤销连接
{
"name": "create_connection",
"arguments": {
"tenantId": "tenant_XXX",
"namespaceId": "namespace_XXX",
"name": "My Connection",
"connector": "GOOGLE_DRIVE",
"clientRedirectUrl": "https://your-app.com/callback"
}
}
{
"name": "list_connections",
"arguments": {
"tenantId": "tenant_XXX",
"namespaceId": "namespace_XXX"
}
}
{
"name": "get_connection",
"arguments": {
"tenantId": "tenant_XXX",
"namespaceId": "namespace_XXX",
"connectionId": "connection_XXX"
}
}
{
"name": "update_connection",
"arguments": {
"tenantId": "tenant_XXX",
"namespaceId": "namespace_XXX",
"connectionId": "connection_XXX",
"name": "Updated Connection Name",
"clientRedirectUrl": "https://your-app.com/updated-callback"
}
}
{
"name": "revoke_connection",
"arguments": {
"tenantId": "tenant_XXX",
"namespaceId": "namespace_XXX",
"connectionId": "connection_XXX"
}
}
示例提示
以下是一些您可以使用Claude或Cursor配置MCP服务器后使用的示例提示:
- "在我的SourceSync知识库中搜索有关机器学习的信息。"
- "将这篇文章摄取到我的SourceSync知识库中:[URL]"
- "在SourceSync中为我的项目文档创建一个新的命名空间。"
- "列出我SourceSync命名空间中的所有文档。"
- "从我的SourceSync命名空间中获取文档[document_id]的文本内容。"
故障排除
连接问题
如果您遇到连接SourceSync.ai MCP服务器的问题:
-
验证路径:确保配置中的所有路径都是绝对路径,而不是相对路径。
-
检查权限:确保服务器文件具有执行权限 (
chmod +x dist/index.js)。 -
启用开发者模式:在Claude Desktop中启用开发者模式并检查MCP日志文件。
-
测试服务器:直接从命令行运行服务器:
node /path/to/sourcesyncai-mcp/dist/index.js -
重启AI客户端:更改后完全重启Claude Desktop或Cursor。
-
检查环境变量:确保所有必需的环境变量都已正确设置。
调试日志
对于详细的日志记录,添加DEBUG环境变量:
开发
项目结构
src/index.ts: 主入口点和服务设置src/schemas.ts: 所有工具的模式定义src/sourcesync.ts: 与 SourceSync.ai API 交互的客户端src/sourcesync.types.ts: TypeScript 类型定义
构建和测试
# Build the project
npm run build
# Run tests
npm test
许可证
MIT
链接
文档内容检索工作流程:
- 首先,使用
getDocuments并设置includeConfig.parsedTextFileUrl: true来获取带有内容 URL 的文档 - 从文档响应中提取 URL
- 使用
fetchUrlContent检索实际内容:
{
"name": "fetchUrlContent",
"arguments": {
"url": "https://example.com"
}
}