Skip to main content
Glama
VinayakTiwari1103

MCP-Smallest.ai

图像

MCP-Smallest.ai

用于 Smallest.ai API 集成的模型上下文协议 (MCP) 服务器实现。该项目提供了与 Smallest.ai 知识库管理系统交互的标准化接口。

建筑学

系统概述

无标题-2025-03-21-0340(6)

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│                 │     │                 │     │                 │
│  Client App     │◄────┤   MCP Server    │◄────┤  Smallest.ai    │
│                 │     │                 │     │    API          │
└─────────────────┘     └─────────────────┘     └─────────────────┘

组件详细信息

1.客户端应用层

  • 实现 MCP 客户端协议

  • 处理请求格式

  • 管理响应解析

  • 提供错误处理

2. MCP 服务器层

  • 协议处理程序

    • 管理 MCP 协议通信

    • 处理客户端连接

    • 将请求路由到适当的工具

  • 工具实现

    • 知识库管理工具

    • 参数验证

    • 响应格式

    • 错误处理

  • API 集成

    • Smallest.ai API 通信

    • 身份验证管理

    • 请求/响应处理

3. Smallest.ai API层

  • 知识库管理

  • 数据存储和检索

  • 身份验证和授权

数据流

1. Client Request
   └─► MCP Protocol Validation
       └─► Tool Parameter Validation
           └─► API Request Formation
               └─► Smallest.ai API Call
                   └─► Response Processing
                       └─► Client Response

安全架构

┌─────────────────┐
│  Client Auth    │
└────────┬────────┘
         │
┌────────▼────────┐
│  MCP Validation │
└────────┬────────┘
         │
┌────────▼────────┐
│  API Auth       │
└────────┬────────┘
         │
┌────────▼────────┐
│  Smallest.ai    │
└─────────────────┘

Related MCP server: Rememberizer MCP Server

概述

该项目实现了一个 MCP 服务器,作为客户端和 Smallest.ai API 之间的中间件。它提供了一种通过模型上下文协议 (MCP) 与 Smallest.ai 知识库管理功能进行交互的标准化方式。

建筑学

[Client Application] <---> [MCP Server] <---> [Smallest.ai API]

成分

  1. MCP 服务器

    • 处理客户端请求

    • 管理 API 通信

    • 提供标准化的响应

    • 实现错误处理

  2. 知识库工具

    • listKnowledgeBases :列出所有知识库

    • createKnowledgeBase :创建新的知识库

    • getKnowledgeBase :检索特定知识库详细信息

  3. 文档资源

    • 可在docs://smallest.ai获取

    • 提供使用说明和示例

先决条件

  • Node.js 18+ 或 Bun 运行时

  • Smallest.ai API 密钥

  • TypeScript 知识

安装

  1. 克隆存储库:

git clone https://github.com/yourusername/MCP-smallest.ai.git
cd MCP-smallest.ai
  1. 安装依赖项:

bun install
  1. 在根目录中创建一个.env文件:

SMALLEST_AI_API_KEY=your_api_key_here

配置

使用 Smallest.ai API 配置创建一个config.ts文件:

export const config = {
    API_KEY: process.env.SMALLEST_AI_API_KEY,
    BASE_URL: 'https://atoms-api.smallest.ai/api/v1'
};

用法

启动服务器

bun run index.ts

测试服务器

bun run test-client.ts

可用工具

  1. 列出知识库

await client.callTool({
  name: "listKnowledgeBases",
  arguments: {}
});
  1. 创建知识库

await client.callTool({
  name: "createKnowledgeBase",
  arguments: {
    name: "My Knowledge Base",
    description: "Description of the knowledge base"
  }
});
  1. 获取知识库

await client.callTool({
  name: "getKnowledgeBase",
  arguments: {
    id: "knowledge_base_id"
  }
});

响应格式

所有回复都遵循以下结构:

{
  content: [{
    type: "text",
    text: JSON.stringify(data, null, 2)
  }]
}

错误处理

服务器实现了全面的错误处理:

  • HTTP 错误

  • API 错误

  • 参数验证错误

  • 类型安全的错误响应

发展

项目结构

MCP-smallest.ai/
├── index.ts           # MCP server implementation
├── test-client.ts     # Test client implementation
├── config.ts          # Configuration file
├── package.json       # Project dependencies
├── tsconfig.json      # TypeScript configuration
└── README.md          # This file

添加新工具

  1. 在index.ts中定义该工具:

server.tool(
  "toolName",
  {
    param1: z.string(),
    param2: z.number()
  },
  async (args) => {
    // Implementation
  }
);
  1. 更新资源中的文档:

server.resource(
  "documentation",
  "docs://smallest.ai",
  async (uri) => ({
    contents: [{
      uri: uri.href,
      text: `Updated documentation...`
    }]
  })
);

安全

  • API 密钥存储在环境变量中

  • 所有请求都经过身份验证

  • 参数验证已实现

  • 错误消息已净化

贡献

  1. 分叉存储库

  2. 创建你的功能分支( git checkout -b feature/amazing-feature )

  3. 提交您的更改( git commit -m 'Add some amazing feature' )

  4. 推送到分支( git push origin feature/amazing-feature )

  5. 打开拉取请求

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

致谢

Available Tools

3 tools
createKnowledgeBaseD
ParametersJSON Schema
NameRequiredDescriptionDefault
descriptionYes
nameYes

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

getKnowledgeBaseD
ParametersJSON Schema
NameRequiredDescriptionDefault
idYes

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

listKnowledgeBasesD
ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv1.0.0
    • First observedcreateKnowledgeBase
    • First observedgetKnowledgeBase
    • First observedlistKnowledgeBases

TDQS

D1.9/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: create, get, and list operations on knowledge bases. There is no overlap in functionality, and the action verbs (create, get, list) are unambiguous and standard for CRUD operations.

Naming Consistency5/5

All tool names follow a consistent camelCase pattern with a verb-noun structure (createKnowledgeBase, getKnowledgeBase, listKnowledgeBases). The naming is predictable and uniform across all three tools.

Tool Count3/5

With only 3 tools, the set feels thin for a knowledge base management server, as it lacks update and delete operations. However, it covers basic create, retrieve, and list functions, which is minimal but functional for a small scope.

Completeness3/5

The tools provide create, get, and list operations, but there are notable gaps such as update and delete for knowledge bases. This limits full lifecycle management, though core retrieval and creation are covered.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server that enables AI models to interact with SourceSync.ai's knowledge management platform for managing documents, ingesting content from various sources, and performing semantic searches.
    25
    59 npm
    1
    ISC
  • A
    license
    A
    quality
    D
    maintenance
    A comprehensive Model Context Protocol server that integrates Elasticsearch search with file operations, document validation, and version control to transform AI assistants into powerful knowledge management systems.
    27
    93 PyPI
    27
    MIT