Skip to main content
Glama
VinayakTiwari1103

MCP-Smallest.ai

изображение

MCP-Smallest.ai

Реализация сервера Model Context Protocol (MCP) для интеграции API Smallest.ai. Этот проект предоставляет стандартизированный интерфейс для взаимодействия с системой управления базой знаний Smallest.ai.

Архитектура

Обзор системы

Без названия-2025-03-21-0340(6)

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

Детали компонента

1. Уровень клиентского приложения

  • Реализует клиентский протокол MCP

  • Обрабатывает форматирование запроса

  • Управляет анализом ответов

  • Обеспечивает обработку ошибок

2. Уровень сервера MCP

  • Обработчик протоколов

    • Управляет коммуникацией по протоколу MCP

    • Обрабатывает клиентские соединения

    • Направляет запросы соответствующим инструментам

  • Реализация инструмента

    • Инструменты управления базой знаний

    • Проверка параметров

    • Форматирование ответа

    • Обработка ошибок

  • API-интеграция

    • API-коммуникация Smallest.ai

    • Управление аутентификацией

    • Обработка запросов/ответов

3. Уровень API Smallest.ai

  • Управление базой знаний

  • Хранение и извлечение данных

  • Аутентификация и авторизация

Поток данных

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, который действует как промежуточное ПО между клиентами и API Smallest.ai. Он предоставляет стандартизированный способ взаимодействия с функциями управления базой знаний Smallest.ai через протокол контекста модели.

Архитектура

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

Компоненты

  1. MCP-сервер

    • Обрабатывает запросы клиентов

    • Управляет коммуникацией API

    • Предоставляет стандартизированные ответы

    • Реализует обработку ошибок

  2. Инструменты базы знаний

    • listKnowledgeBases : список всех баз знаний

    • createKnowledgeBase : создает новые базы знаний

    • getKnowledgeBase : извлекает конкретные сведения из базы знаний

  3. Ресурс документации

    • Доступно на docs://smallest.ai

    • Предоставляет инструкции по использованию и примеры

Предпосылки

  • Node.js 18+ или среда выполнения Bun

  • API-ключ Smallest.ai

  • Знание 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

Конфигурация

Создайте файл config.ts с конфигурацией API Smallest.ai:

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