Skip to main content
Glama
qkiomat

bas-mcp-server

by qkiomat

MCP Сервер для 1С та BAS ERP (bas-mcp-server)

Цей проєкт реалізує проміжний сервіс (MCP-сервер) на базі Node.js та TypeScript для підключення AI-агентів (таких як Claude Desktop, Cursor, VS Code) до систем 1С:Підприємство та BAS ERP (Business Automation Software).

Сервер взаємодіє з 1С через вбудований REST API (OData) та кастомний HTTP-сервіс для складних операцій.


Архітектура рішення

Варіант А: stdio через SSH-тунель (однокористувацький режим)

[Локальний AI Клієнт] (Claude Desktop / Cursor)
       │
       │  (MCP Protocol через SSH-тунель stdio)
       ▼
[Middleware MCP Server] (Node.js на боці сервера 1С)
       │
       │  (REST API / OData / HTTP)
       ▼
[1С:Підприємство / BAS ERP]

Варіант Б: SSE через HTTP/HTTPS (багатокористувацький режим)

[AI Клієнт Користувача 1] ───┐
                             ├───> [Middleware MCP Server] ───> [1С / BAS ERP]
[AI Клієнт Користувача 2] ───┘      (Порт 3000 / HTTP / SSE)

Related MCP server: 1C MCP Toolkit

Функціональність (MCP Tools)

Агент отримує доступ до наступних інструментів:

  • search_catalog — пошук контрагентів, товарів (номенклатури), складів тощо.

  • get_catalog_element — зчитування всіх реквізитів обраного елемента за його GUID.

  • create_catalog_element — створення нових контрагентів або інших елементів довідників.

  • create_document — створення документів (наприклад, Замовлення клієнта, Рахунок на оплату).

  • post_document — проведення створених документів у базі.

  • get_stock_balance — отримання актуальних залишків товарів на складах.


Швидкий старт (Mock-режим для тестів)

Ви можете протестувати сервер та його інтеграцію з AI-клієнтом локально без реального підключення до бази 1С.

  1. Встановіть залежності:

    npm install
  2. Скомпілюйте TypeScript код:

    npm run build
  3. Налаштуйте конфіг для тестування (вже містить ONEC_USE_MOCK=true у .env файлі за замовчуванням):

    cp .env.example .env
  4. Запустіть та протестуйте MCP-сервер у режимі інспектора (буде запущено як SSE сервер):

    npm run inspector

Налаштування підключення до реальної 1С / BAS

Крок 1. Налаштування на боці 1С

  1. Увімкніть OData: Для роботи довідників увімкніть стандартний REST-інтерфейс 1С. Це можна зробити кодом:

    СистемаИмпортаЭкспортаМакетаДанных.УстановитьИспользованиеRESTИнтерфейса(Истина);
  2. Встановіть Розширення для HTTP-сервісу: Для проведення документів та залишків додайте розширення конфігурації. Інструкція та готовий BSL-код знаходяться в докумені: docs/onec_http_service.md.

Крок 2. Конфігурація Middleware (.env)

Відредагуйте файл .env:

ONEC_URL=http://your-1c-server/base-name
ONEC_USER=McpAgent
ONEC_PASSWORD=agent-password
ONEC_USE_ODATA=true
ONEC_USE_MOCK=false

# Налаштування транспорту та безпеки
MCP_TRANSPORT=sse
PORT=3000
MCP_API_KEY=your-secure-mcp-token-here

Підключення до AI Клієнтів

Варіант 1: Через SSE / HTTP (Багатокористувацький режим)

Додайте наступний блок у конфіг Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "bas-mcp-sse": {
      "url": "http://your-server-ip:3000/sse?apiKey=your-secure-mcp-token-here"
    }
  }
}

Варіант 2: Через SSH-тунель (Stdio — для одного розробника)

Якщо ви не хочете відкривати порти в інтернет, ви можете використовувати SSH-тунель. Для цього у .env вкажіть MCP_TRANSPORT=stdio. Налаштуйте безпарольний доступ по SSH за допомогою ключів до вашого сервера (ssh-copy-id user@your-server-ip), а потім додайте конфіг у локальний Claude Desktop:

{
  "mcpServers": {
    "bas-mcp-stdio": {
      "command": "ssh",
      "args": [
        "-T",
        "user@your-server-ip",
        "node /path/to/your/project/bas-mcp/build/index.js"
      ]
    }
  }
}

Клієнт автоматично запустить процес на сервері через SSH та буде спілкуватися з ним за допомогою стандартних потоків (stdio).

Available Tools

6 tools
create_catalog_elementC

Створення нового елемента у довіднику 1С/BAS

ParametersJSON Schema
NameRequiredDescriptionDefault
fieldsYesОб'єкт із реквізитами нового елемента (наприклад, { Description: "ТОВ Ромашка", EDRPOU: "12345678" })
catalog_nameYesНазва довідника (наприклад, Контрагенты)

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It reveals that the tool creates a new element (a write operation) but does not describe validation, duplicate handling, authorization requirements, or what happens on success or failure. For a mutation tool with zero annotation coverage, this is a significant gap.

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

Conciseness4/5

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

The description is a single, front-loaded sentence that wastes no words. It is appropriately concise for a simple tool, though it could have been slightly more informative without losing conciseness. The structure is clean and direct.

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

Completeness3/5

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

Given the tool's simplicity and full schema coverage, the description plus schema is minimally viable. However, the lack of annotations and absence of an output schema leaves behavioral aspects opaque; there is no mention of return values, error conditions, or side effects. This prevents it from being fully complete.

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

Parameters3/5

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

The schema description coverage is 100%, with both parameters (catalog_name and fields) documented and given examples. The tool description itself adds no additional parameter semantics beyond what the schema already provides, so the baseline of 3 is appropriate.

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

Purpose4/5

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

The description uses the verb 'Створення' (creation) and specifies the resource 'element in 1C/BAS directory', clearly distinguishing it from sibling tools like search_catalog/get_catalog_element (read operations) and create_document (different resource type). It is concise but misses the word 'new' in a way that could be slightly clearer, yet the intent is unmistakable.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. There is no mention of prerequisites, when to prefer create_document over this tool, or any exclusion criteria. The description simply states the action without usage context.

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

create_documentA

Створення нового документа в 1С/BAS (наприклад, СчетНаОплатуПокупателю, ЗаказКлиента)

ParametersJSON Schema
NameRequiredDescriptionDefault
fieldsYesРеквізити документа, включаючи табличні частини (наприклад, ТоварныеЧасти / Товары)
document_nameYesНазва документа без префікса Document_ (наприклад, ЗаказКлиента)

TDQS

A3.9/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the creation action without any mention of side effects, permissions, validation, or return values. For a mutation tool, this is insufficient to inform the agent about consequences or prerequisites.

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

Conciseness5/5

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

The description is a single, well-structured sentence that states the purpose and provides examples without any fluff. It is front-loaded with the key action ('Створення') and immediately specifies the domain (1С/BAS), making it easy to grasp.

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

Completeness3/5

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

The description covers the basic purpose and gives parameter examples, but it lacks important context for a create operation: it does not mention that the document is not automatically posted, nor does it describe any return value or required fields within the 'fields' object. Given the presence of sibling post_document, this omission may lead to incomplete agent behavior.

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

Parameters4/5

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

The schema already provides extensive descriptions for both parameters, achieving 100% coverage. The description adds value by giving concrete examples of valid document_name values (e.g., ЗаказКлиента) and clarifying that fields includes tabular parts, which slightly enhances meaning beyond the schema. However, it does not significantly add new semantic detail.

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

Purpose5/5

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

The description clearly states the tool's function with a specific verb ('Створення' - creating) and resource ('нового документа' - new document), and provides concrete examples (СчетНаОплатуПокупателю, ЗаказКлиента). This distinguishes it from sibling tools like create_catalog_element, which target catalog elements rather than documents.

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

Usage Guidelines4/5

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

The description gives clear context that this is for creating documents, which implies when to use it. However, it does not explicitly mention when not to use it or compare with alternatives like post_document, which is a related sibling. The lack of exclusions or alternative options leaves room for ambiguity in distinguishing between creating and posting documents.

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

get_catalog_elementA

Отримання повних реквізитів елемента довідника за його Ref_Key (GUID)

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesGUID елемента (Ref_Key)
catalog_nameYesНазва довідника (наприклад, Контрагенты)

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, and the description only states the action without disclosing behavior such as read-only status, error handling, permissions, or return format. It implies a read operation but does not explicitly confirm safety or edge cases.

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

Conciseness5/5

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

The description is a single clear sentence, front-loaded with the action and resource, with no redundant words.

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

Completeness3/5

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

The tool is simple with two well-described parameters, but the description lacks explicit guidance on return shape or error behavior; however, for a read operation the core purpose is conveyed sufficiently.

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

Parameters3/5

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

Both parameters are already fully described in the schema (id as GUID Ref_Key, catalog_name as the catalog name). The description adds no additional parameter semantics beyond restating 'Ref_Key' for id.

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

Purpose5/5

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

The description states 'Отримання повних реквізитів елемента довідника' (obtaining full details of a catalog element) and specifies the identifier format 'Ref_Key (GUID)'. This clearly distinguishes from siblings like search_catalog and create_catalog_element.

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

Usage Guidelines3/5

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

The description implies usage when you have a Ref_Key and need full element details, but it does not explicitly state when to prefer this over search_catalog or mention exclusions.

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

get_stock_balanceA

Отримання поточних залишків товарів на складах 1С/BAS

ParametersJSON Schema
NameRequiredDescriptionDefault
warehouse_idNoGUID складу (Ref_Key) (опціонально)
nomenclature_idYesGUID номенклатури (Ref_Key)

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the burden of disclosing behavior. It correctly implies a read-only operation but provides no additional context about response structure, pagination, permissions, or data scope. This is minimal but not misleading.

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

Conciseness5/5

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

The description is a single, front-loaded sentence with no redundancy or filler words. It efficiently communicates the tool's purpose.

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

Completeness3/5

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

Given the absence of annotations and an output schema, the description should clarify what the caller receives. It states 'current balances' but does not specify whether the output is a single value or per-warehouse entries, nor any limitations. For a simple read tool with two parameters, this is mostly adequate but leaves ambiguity about return format.

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

Parameters3/5

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

The input schema covers both parameters fully, with descriptions indicating they are GUIDs (Ref_Key) for warehouse and nomenclature. The description adds no extra parameter semantics, but the schema is self-sufficient, so the baseline score of 3 is appropriate.

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

Purpose5/5

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

The description clearly states the tool retrieves current stock balances of goods in warehouses for 1C/BAS, using a specific verb and resource. It is distinct from sibling tools that handle catalog and document operations.

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

Usage Guidelines4/5

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

The description and tool name clearly indicate this is for querying stock balances, which distinguishes it from the sibling tools. However, it does not explicitly state when to use it versus alternatives or mention any exclusions, leaving the context to be inferred.

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

post_documentB

Проведення документа в 1С/BAS за його GUID (Ref_Key)

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYesGUID документа (Ref_Key)
document_nameYesНазва документа (наприклад, ЗаказКлиента)

TDQS

B3/5.0
Behavior1/5

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

There are no annotations, so the description carries full burden. It only says 'posting a document' without disclosing side effects, state changes, irreversibility, required permissions, or error conditions. This is a thin description with no behavioral context.

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

Conciseness5/5

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

The description is a single short sentence, front-loaded with the verb and resource. It contains no extraneous words and is perfectly concise, though it lacks depth.

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

Completeness2/5

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

The tool is a mutation-like operation with no output schema and no annotations. The description does not explain what happens on success, return values, prerequisites, or side effects. Complexity is low but completeness is inadequate for an operation that likely has significant business impact.

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

Parameters3/5

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

Schema description coverage is 100%, with both parameters (doc_id, document_name) clearly described. The tool description adds no extra meaning beyond mentioning GUID, which is already in the schema. Baseline 3 applies.

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

Purpose5/5

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

The description clearly states the tool posts (проведення) a document in 1C/BAS by its GUID, which is a specific verb+resource+method. This distinguishes it from sibling create_document, which creates rather than posts.

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

Usage Guidelines2/5

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

No usage guidance is provided. The description does not mention when to use this tool vs alternatives, prerequisites (e.g., document must exist), or when not to use it. It only states what it does, not the context.

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

search_catalogC

Пошук елементів у довідниках 1С/BAS (наприклад, Контрагенты, Номенклатура, Склады, ФизическиеЛица)

ParametersJSON Schema
NameRequiredDescriptionDefault
queryNoРядок пошуку (шукає за найменуванням, кодом або ЄДРПОУ)
filterNoСтандартний OData $filter вираз (опціонально, наприклад: "Parent_Key eq guid'...'")
catalog_nameYesНазва довідника без префікса Catalog_ (наприклад, Контрагенты)

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It mentions searching but does not specify return format, result limits, pagination, ordering, or whether the operation is read-only. The lack of such details leaves key behaviors undocumented.

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

Conciseness5/5

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

The description is a single, focused sentence that front-loads the verb and resource. Every word contributes to the core purpose with no redundancy or filler.

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

Completeness2/5

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

The tool has no annotations or output schema, so the description must compensate for missing behavioral context. It fails to mention what the search returns, how results are structured, or any constraints on the query/filter logic. This leaves significant gaps for a tool with three parameters.

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

Parameters3/5

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

Schema description coverage is 100%, so the descriptions of query, filter, and catalog_name already provide adequate meaning. The tool description adds examples of catalog names but no additional parameter semantics, keeping this at the baseline.

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

Purpose4/5

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

The description clearly states the tool's purpose: searching for elements in 1C/BAS directories, with examples of directories. This distinguishes it from sibling tools like get_catalog_element or create_catalog_element, though it does not explicitly contrast with get_catalog_element for cases where an ID is known.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description only explains what it does, not when to choose it over get_catalog_element or other search-like operations. No exclusions or prerequisites are mentioned.

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. Dates show when Glama detected each change.

  1. 6 tool updatesv1.0.0
    • First observedcreate_catalog_element
    • First observedcreate_document
    • First observedget_catalog_element
    • First observedget_stock_balance
    • First observedpost_document
    • First observedsearch_catalog

TDQS

A3.6/5.0
Disambiguation5/5

Each tool targets a distinct resource and action: search and get for catalogs, create for catalogs and documents, post for documents, and stock balance. No ambiguity between them.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (search_catalog, get_catalog_element, create_catalog_element, create_document, post_document, get_stock_balance).

Tool Count5/5

With 6 tools, the server is well-scoped for BAS/1C integration, covering essential operations without unnecessary bloat.

Completeness3/5

Catalogs have search/get/create but lack update and delete operations. Documents support create and post but no read/list capability, leaving notable lifecycle gaps.

Maintenance

ActivityStale
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Integrates AI agents with 1C:Enterprise databases via MCP and REST API, supporting a built-in HTTP server (no Python required) or a Python proxy mode.
    257
    GPL 3.0
  • F
    license
    Not graded
    quality
    F
    maintenance
    Enables Claude to interact with 1C:Enterprise via OData REST API, allowing natural language queries for inventory, orders, prices, and order creation.
    -
  • A
    license
    A
    quality
    B
    maintenance
    Bridges AI agents to 1C:Enterprise via OData, enabling natural language queries of business entities like counterparties and invoices with read-only access.
    8
    61
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/qkiomat/bas-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server